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__) && !defined(__MINGW32__)
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 xmlChar *static_buf_content = (xmlChar *)"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_HYBRID);
1044 if (no == 4) return(XML_BUFFER_ALLOC_IMMUTABLE);
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);
8451 test_xmlInitializeDict(void) {
8457 mem_base = xmlMemBlocks();
8459 ret_val = xmlInitializeDict();
8460 desret_int(ret_val);
8462 xmlResetLastError();
8463 if (mem_base != xmlMemBlocks()) {
8464 printf("Leak of %d blocks found in xmlInitializeDict",
8465 xmlMemBlocks() - mem_base);
8478 if (quiet == 0) printf("Testing dict : 10 of 11 functions ...\n");
8479 test_ret += test_xmlDictCleanup();
8480 test_ret += test_xmlDictCreate();
8481 test_ret += test_xmlDictCreateSub();
8482 test_ret += test_xmlDictExists();
8483 test_ret += test_xmlDictLookup();
8484 test_ret += test_xmlDictOwns();
8485 test_ret += test_xmlDictQLookup();
8486 test_ret += test_xmlDictReference();
8487 test_ret += test_xmlDictSize();
8488 test_ret += test_xmlInitializeDict();
8491 printf("Module dict: %d errors\n", test_ret);
8496 test_UTF8Toisolat1(void) {
8499 #if defined(LIBXML_OUTPUT_ENABLED)
8500 #ifdef LIBXML_OUTPUT_ENABLED
8503 unsigned char * out; /* a pointer to an array of bytes to store the result */
8505 int * outlen; /* the length of @out */
8507 unsigned char * in; /* a pointer to an array of UTF-8 chars */
8509 int * inlen; /* the length of @in */
8512 for (n_out = 0;n_out < gen_nb_unsigned_char_ptr;n_out++) {
8513 for (n_outlen = 0;n_outlen < gen_nb_int_ptr;n_outlen++) {
8514 for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) {
8515 for (n_inlen = 0;n_inlen < gen_nb_int_ptr;n_inlen++) {
8516 mem_base = xmlMemBlocks();
8517 out = gen_unsigned_char_ptr(n_out, 0);
8518 outlen = gen_int_ptr(n_outlen, 1);
8519 in = gen_const_unsigned_char_ptr(n_in, 2);
8520 inlen = gen_int_ptr(n_inlen, 3);
8522 ret_val = UTF8Toisolat1(out, outlen, (const unsigned char *)in, inlen);
8523 desret_int(ret_val);
8525 des_unsigned_char_ptr(n_out, out, 0);
8526 des_int_ptr(n_outlen, outlen, 1);
8527 des_const_unsigned_char_ptr(n_in, (const unsigned char *)in, 2);
8528 des_int_ptr(n_inlen, inlen, 3);
8529 xmlResetLastError();
8530 if (mem_base != xmlMemBlocks()) {
8531 printf("Leak of %d blocks found in UTF8Toisolat1",
8532 xmlMemBlocks() - mem_base);
8534 printf(" %d", n_out);
8535 printf(" %d", n_outlen);
8536 printf(" %d", n_in);
8537 printf(" %d", n_inlen);
8553 test_isolat1ToUTF8(void) {
8558 unsigned char * out; /* a pointer to an array of bytes to store the result */
8560 int * outlen; /* the length of @out */
8562 unsigned char * in; /* a pointer to an array of ISO Latin 1 chars */
8564 int * inlen; /* the length of @in */
8567 for (n_out = 0;n_out < gen_nb_unsigned_char_ptr;n_out++) {
8568 for (n_outlen = 0;n_outlen < gen_nb_int_ptr;n_outlen++) {
8569 for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) {
8570 for (n_inlen = 0;n_inlen < gen_nb_int_ptr;n_inlen++) {
8571 mem_base = xmlMemBlocks();
8572 out = gen_unsigned_char_ptr(n_out, 0);
8573 outlen = gen_int_ptr(n_outlen, 1);
8574 in = gen_const_unsigned_char_ptr(n_in, 2);
8575 inlen = gen_int_ptr(n_inlen, 3);
8577 ret_val = isolat1ToUTF8(out, outlen, (const unsigned char *)in, inlen);
8578 desret_int(ret_val);
8580 des_unsigned_char_ptr(n_out, out, 0);
8581 des_int_ptr(n_outlen, outlen, 1);
8582 des_const_unsigned_char_ptr(n_in, (const unsigned char *)in, 2);
8583 des_int_ptr(n_inlen, inlen, 3);
8584 xmlResetLastError();
8585 if (mem_base != xmlMemBlocks()) {
8586 printf("Leak of %d blocks found in isolat1ToUTF8",
8587 xmlMemBlocks() - mem_base);
8589 printf(" %d", n_out);
8590 printf(" %d", n_outlen);
8591 printf(" %d", n_in);
8592 printf(" %d", n_inlen);
8606 test_xmlAddEncodingAlias(void) {
8610 char * name; /* the encoding name as parsed, in UTF-8 format (ASCII actually) */
8612 char * alias; /* the alias name as parsed, in UTF-8 format (ASCII actually) */
8615 for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
8616 for (n_alias = 0;n_alias < gen_nb_const_char_ptr;n_alias++) {
8617 name = gen_const_char_ptr(n_name, 0);
8618 alias = gen_const_char_ptr(n_alias, 1);
8620 ret_val = xmlAddEncodingAlias((const char *)name, (const char *)alias);
8621 desret_int(ret_val);
8623 des_const_char_ptr(n_name, (const char *)name, 0);
8624 des_const_char_ptr(n_alias, (const char *)alias, 1);
8625 xmlResetLastError();
8634 #define gen_nb_xmlCharEncodingHandler_ptr 1
8635 static xmlCharEncodingHandler * gen_xmlCharEncodingHandler_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
8638 static void des_xmlCharEncodingHandler_ptr(int no ATTRIBUTE_UNUSED, xmlCharEncodingHandler * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
8642 test_xmlCharEncCloseFunc(void) {
8647 xmlCharEncodingHandler * handler; /* char enconding transformation data structure */
8650 for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandler_ptr;n_handler++) {
8651 mem_base = xmlMemBlocks();
8652 handler = gen_xmlCharEncodingHandler_ptr(n_handler, 0);
8654 ret_val = xmlCharEncCloseFunc(handler);
8655 desret_int(ret_val);
8657 des_xmlCharEncodingHandler_ptr(n_handler, handler, 0);
8658 xmlResetLastError();
8659 if (mem_base != xmlMemBlocks()) {
8660 printf("Leak of %d blocks found in xmlCharEncCloseFunc",
8661 xmlMemBlocks() - mem_base);
8663 printf(" %d", n_handler);
8674 test_xmlCharEncFirstLine(void) {
8679 xmlCharEncodingHandler * handler; /* char enconding transformation data structure */
8681 xmlBufferPtr out; /* an xmlBuffer for the output. */
8683 xmlBufferPtr in; /* an xmlBuffer for the input */
8686 for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandler_ptr;n_handler++) {
8687 for (n_out = 0;n_out < gen_nb_xmlBufferPtr;n_out++) {
8688 for (n_in = 0;n_in < gen_nb_xmlBufferPtr;n_in++) {
8689 mem_base = xmlMemBlocks();
8690 handler = gen_xmlCharEncodingHandler_ptr(n_handler, 0);
8691 out = gen_xmlBufferPtr(n_out, 1);
8692 in = gen_xmlBufferPtr(n_in, 2);
8694 ret_val = xmlCharEncFirstLine(handler, out, in);
8695 desret_int(ret_val);
8697 des_xmlCharEncodingHandler_ptr(n_handler, handler, 0);
8698 des_xmlBufferPtr(n_out, out, 1);
8699 des_xmlBufferPtr(n_in, in, 2);
8700 xmlResetLastError();
8701 if (mem_base != xmlMemBlocks()) {
8702 printf("Leak of %d blocks found in xmlCharEncFirstLine",
8703 xmlMemBlocks() - mem_base);
8705 printf(" %d", n_handler);
8706 printf(" %d", n_out);
8707 printf(" %d", n_in);
8720 test_xmlCharEncInFunc(void) {
8725 xmlCharEncodingHandler * handler; /* char encoding transformation data structure */
8727 xmlBufferPtr out; /* an xmlBuffer for the output. */
8729 xmlBufferPtr in; /* an xmlBuffer for the input */
8732 for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandler_ptr;n_handler++) {
8733 for (n_out = 0;n_out < gen_nb_xmlBufferPtr;n_out++) {
8734 for (n_in = 0;n_in < gen_nb_xmlBufferPtr;n_in++) {
8735 mem_base = xmlMemBlocks();
8736 handler = gen_xmlCharEncodingHandler_ptr(n_handler, 0);
8737 out = gen_xmlBufferPtr(n_out, 1);
8738 in = gen_xmlBufferPtr(n_in, 2);
8740 ret_val = xmlCharEncInFunc(handler, out, in);
8741 desret_int(ret_val);
8743 des_xmlCharEncodingHandler_ptr(n_handler, handler, 0);
8744 des_xmlBufferPtr(n_out, out, 1);
8745 des_xmlBufferPtr(n_in, in, 2);
8746 xmlResetLastError();
8747 if (mem_base != xmlMemBlocks()) {
8748 printf("Leak of %d blocks found in xmlCharEncInFunc",
8749 xmlMemBlocks() - mem_base);
8751 printf(" %d", n_handler);
8752 printf(" %d", n_out);
8753 printf(" %d", n_in);
8766 test_xmlCharEncOutFunc(void) {
8771 xmlCharEncodingHandler * handler; /* char enconding transformation data structure */
8773 xmlBufferPtr out; /* an xmlBuffer for the output. */
8775 xmlBufferPtr in; /* an xmlBuffer for the input */
8778 for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandler_ptr;n_handler++) {
8779 for (n_out = 0;n_out < gen_nb_xmlBufferPtr;n_out++) {
8780 for (n_in = 0;n_in < gen_nb_xmlBufferPtr;n_in++) {
8781 mem_base = xmlMemBlocks();
8782 handler = gen_xmlCharEncodingHandler_ptr(n_handler, 0);
8783 out = gen_xmlBufferPtr(n_out, 1);
8784 in = gen_xmlBufferPtr(n_in, 2);
8786 ret_val = xmlCharEncOutFunc(handler, out, in);
8787 desret_int(ret_val);
8789 des_xmlCharEncodingHandler_ptr(n_handler, handler, 0);
8790 des_xmlBufferPtr(n_out, out, 1);
8791 des_xmlBufferPtr(n_in, in, 2);
8792 xmlResetLastError();
8793 if (mem_base != xmlMemBlocks()) {
8794 printf("Leak of %d blocks found in xmlCharEncOutFunc",
8795 xmlMemBlocks() - mem_base);
8797 printf(" %d", n_handler);
8798 printf(" %d", n_out);
8799 printf(" %d", n_in);
8812 test_xmlCleanupCharEncodingHandlers(void) {
8817 xmlCleanupCharEncodingHandlers();
8819 xmlResetLastError();
8827 test_xmlCleanupEncodingAliases(void) {
8832 mem_base = xmlMemBlocks();
8834 xmlCleanupEncodingAliases();
8836 xmlResetLastError();
8837 if (mem_base != xmlMemBlocks()) {
8838 printf("Leak of %d blocks found in xmlCleanupEncodingAliases",
8839 xmlMemBlocks() - mem_base);
8850 test_xmlDelEncodingAlias(void) {
8855 char * alias; /* the alias name as parsed, in UTF-8 format (ASCII actually) */
8858 for (n_alias = 0;n_alias < gen_nb_const_char_ptr;n_alias++) {
8859 mem_base = xmlMemBlocks();
8860 alias = gen_const_char_ptr(n_alias, 0);
8862 ret_val = xmlDelEncodingAlias((const char *)alias);
8863 desret_int(ret_val);
8865 des_const_char_ptr(n_alias, (const char *)alias, 0);
8866 xmlResetLastError();
8867 if (mem_base != xmlMemBlocks()) {
8868 printf("Leak of %d blocks found in xmlDelEncodingAlias",
8869 xmlMemBlocks() - mem_base);
8871 printf(" %d", n_alias);
8882 test_xmlDetectCharEncoding(void) {
8886 xmlCharEncoding ret_val;
8887 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). */
8889 int len; /* pointer to the length of the buffer */
8892 for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) {
8893 for (n_len = 0;n_len < gen_nb_int;n_len++) {
8894 mem_base = xmlMemBlocks();
8895 in = gen_const_unsigned_char_ptr(n_in, 0);
8896 len = gen_int(n_len, 1);
8898 ret_val = xmlDetectCharEncoding((const unsigned char *)in, len);
8899 desret_xmlCharEncoding(ret_val);
8901 des_const_unsigned_char_ptr(n_in, (const unsigned char *)in, 0);
8902 des_int(n_len, len, 1);
8903 xmlResetLastError();
8904 if (mem_base != xmlMemBlocks()) {
8905 printf("Leak of %d blocks found in xmlDetectCharEncoding",
8906 xmlMemBlocks() - mem_base);
8908 printf(" %d", n_in);
8909 printf(" %d", n_len);
8921 test_xmlFindCharEncodingHandler(void) {
8925 /* missing type support */
8931 test_xmlGetCharEncodingHandler(void) {
8935 /* missing type support */
8941 test_xmlGetCharEncodingName(void) {
8945 const char * ret_val;
8946 xmlCharEncoding enc; /* the encoding */
8949 for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
8950 mem_base = xmlMemBlocks();
8951 enc = gen_xmlCharEncoding(n_enc, 0);
8953 ret_val = xmlGetCharEncodingName(enc);
8954 desret_const_char_ptr(ret_val);
8956 des_xmlCharEncoding(n_enc, enc, 0);
8957 xmlResetLastError();
8958 if (mem_base != xmlMemBlocks()) {
8959 printf("Leak of %d blocks found in xmlGetCharEncodingName",
8960 xmlMemBlocks() - mem_base);
8962 printf(" %d", n_enc);
8973 test_xmlGetEncodingAlias(void) {
8977 const char * ret_val;
8978 char * alias; /* the alias name as parsed, in UTF-8 format (ASCII actually) */
8981 for (n_alias = 0;n_alias < gen_nb_const_char_ptr;n_alias++) {
8982 mem_base = xmlMemBlocks();
8983 alias = gen_const_char_ptr(n_alias, 0);
8985 ret_val = xmlGetEncodingAlias((const char *)alias);
8986 desret_const_char_ptr(ret_val);
8988 des_const_char_ptr(n_alias, (const char *)alias, 0);
8989 xmlResetLastError();
8990 if (mem_base != xmlMemBlocks()) {
8991 printf("Leak of %d blocks found in xmlGetEncodingAlias",
8992 xmlMemBlocks() - mem_base);
8994 printf(" %d", n_alias);
9005 test_xmlInitCharEncodingHandlers(void) {
9010 xmlInitCharEncodingHandlers();
9012 xmlResetLastError();
9020 test_xmlNewCharEncodingHandler(void) {
9024 /* missing type support */
9030 test_xmlParseCharEncoding(void) {
9034 xmlCharEncoding ret_val;
9035 char * name; /* the encoding name as parsed, in UTF-8 format (ASCII actually) */
9038 for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
9039 mem_base = xmlMemBlocks();
9040 name = gen_const_char_ptr(n_name, 0);
9042 ret_val = xmlParseCharEncoding((const char *)name);
9043 desret_xmlCharEncoding(ret_val);
9045 des_const_char_ptr(n_name, (const char *)name, 0);
9046 xmlResetLastError();
9047 if (mem_base != xmlMemBlocks()) {
9048 printf("Leak of %d blocks found in xmlParseCharEncoding",
9049 xmlMemBlocks() - mem_base);
9051 printf(" %d", n_name);
9061 #define gen_nb_xmlCharEncodingHandlerPtr 1
9062 static xmlCharEncodingHandlerPtr gen_xmlCharEncodingHandlerPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9065 static void des_xmlCharEncodingHandlerPtr(int no ATTRIBUTE_UNUSED, xmlCharEncodingHandlerPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9069 test_xmlRegisterCharEncodingHandler(void) {
9073 xmlCharEncodingHandlerPtr handler; /* the xmlCharEncodingHandlerPtr handler block */
9076 for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandlerPtr;n_handler++) {
9077 mem_base = xmlMemBlocks();
9078 handler = gen_xmlCharEncodingHandlerPtr(n_handler, 0);
9080 xmlRegisterCharEncodingHandler(handler);
9082 des_xmlCharEncodingHandlerPtr(n_handler, handler, 0);
9083 xmlResetLastError();
9084 if (mem_base != xmlMemBlocks()) {
9085 printf("Leak of %d blocks found in xmlRegisterCharEncodingHandler",
9086 xmlMemBlocks() - mem_base);
9088 printf(" %d", n_handler);
9098 test_encoding(void) {
9101 if (quiet == 0) printf("Testing encoding : 16 of 19 functions ...\n");
9102 test_ret += test_UTF8Toisolat1();
9103 test_ret += test_isolat1ToUTF8();
9104 test_ret += test_xmlAddEncodingAlias();
9105 test_ret += test_xmlCharEncCloseFunc();
9106 test_ret += test_xmlCharEncFirstLine();
9107 test_ret += test_xmlCharEncInFunc();
9108 test_ret += test_xmlCharEncOutFunc();
9109 test_ret += test_xmlCleanupCharEncodingHandlers();
9110 test_ret += test_xmlCleanupEncodingAliases();
9111 test_ret += test_xmlDelEncodingAlias();
9112 test_ret += test_xmlDetectCharEncoding();
9113 test_ret += test_xmlFindCharEncodingHandler();
9114 test_ret += test_xmlGetCharEncodingHandler();
9115 test_ret += test_xmlGetCharEncodingName();
9116 test_ret += test_xmlGetEncodingAlias();
9117 test_ret += test_xmlInitCharEncodingHandlers();
9118 test_ret += test_xmlNewCharEncodingHandler();
9119 test_ret += test_xmlParseCharEncoding();
9120 test_ret += test_xmlRegisterCharEncodingHandler();
9123 printf("Module encoding: %d errors\n", test_ret);
9128 test_xmlAddDocEntity(void) {
9132 xmlEntityPtr ret_val;
9133 xmlDocPtr doc; /* the document */
9135 xmlChar * name; /* the entity name */
9137 int type; /* the entity type XML_xxx_yyy_ENTITY */
9139 xmlChar * ExternalID; /* the entity external ID if available */
9141 xmlChar * SystemID; /* the entity system ID if available */
9143 xmlChar * content; /* the entity content */
9146 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9147 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9148 for (n_type = 0;n_type < gen_nb_int;n_type++) {
9149 for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
9150 for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
9151 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
9152 mem_base = xmlMemBlocks();
9153 doc = gen_xmlDocPtr(n_doc, 0);
9154 name = gen_const_xmlChar_ptr(n_name, 1);
9155 type = gen_int(n_type, 2);
9156 ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 3);
9157 SystemID = gen_const_xmlChar_ptr(n_SystemID, 4);
9158 content = gen_const_xmlChar_ptr(n_content, 5);
9160 ret_val = xmlAddDocEntity(doc, (const xmlChar *)name, type, (const xmlChar *)ExternalID, (const xmlChar *)SystemID, (const xmlChar *)content);
9161 desret_xmlEntityPtr(ret_val);
9163 des_xmlDocPtr(n_doc, doc, 0);
9164 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9165 des_int(n_type, type, 2);
9166 des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 3);
9167 des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 4);
9168 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 5);
9169 xmlResetLastError();
9170 if (mem_base != xmlMemBlocks()) {
9171 printf("Leak of %d blocks found in xmlAddDocEntity",
9172 xmlMemBlocks() - mem_base);
9174 printf(" %d", n_doc);
9175 printf(" %d", n_name);
9176 printf(" %d", n_type);
9177 printf(" %d", n_ExternalID);
9178 printf(" %d", n_SystemID);
9179 printf(" %d", n_content);
9195 test_xmlAddDtdEntity(void) {
9199 xmlEntityPtr ret_val;
9200 xmlDocPtr doc; /* the document */
9202 xmlChar * name; /* the entity name */
9204 int type; /* the entity type XML_xxx_yyy_ENTITY */
9206 xmlChar * ExternalID; /* the entity external ID if available */
9208 xmlChar * SystemID; /* the entity system ID if available */
9210 xmlChar * content; /* the entity content */
9213 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9214 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9215 for (n_type = 0;n_type < gen_nb_int;n_type++) {
9216 for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
9217 for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
9218 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
9219 mem_base = xmlMemBlocks();
9220 doc = gen_xmlDocPtr(n_doc, 0);
9221 name = gen_const_xmlChar_ptr(n_name, 1);
9222 type = gen_int(n_type, 2);
9223 ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 3);
9224 SystemID = gen_const_xmlChar_ptr(n_SystemID, 4);
9225 content = gen_const_xmlChar_ptr(n_content, 5);
9227 ret_val = xmlAddDtdEntity(doc, (const xmlChar *)name, type, (const xmlChar *)ExternalID, (const xmlChar *)SystemID, (const xmlChar *)content);
9228 desret_xmlEntityPtr(ret_val);
9230 des_xmlDocPtr(n_doc, doc, 0);
9231 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9232 des_int(n_type, type, 2);
9233 des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 3);
9234 des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 4);
9235 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 5);
9236 xmlResetLastError();
9237 if (mem_base != xmlMemBlocks()) {
9238 printf("Leak of %d blocks found in xmlAddDtdEntity",
9239 xmlMemBlocks() - mem_base);
9241 printf(" %d", n_doc);
9242 printf(" %d", n_name);
9243 printf(" %d", n_type);
9244 printf(" %d", n_ExternalID);
9245 printf(" %d", n_SystemID);
9246 printf(" %d", n_content);
9262 test_xmlCleanupPredefinedEntities(void) {
9265 #if defined(LIBXML_LEGACY_ENABLED)
9266 #ifdef LIBXML_LEGACY_ENABLED
9269 mem_base = xmlMemBlocks();
9271 xmlCleanupPredefinedEntities();
9273 xmlResetLastError();
9274 if (mem_base != xmlMemBlocks()) {
9275 printf("Leak of %d blocks found in xmlCleanupPredefinedEntities",
9276 xmlMemBlocks() - mem_base);
9288 #define gen_nb_xmlEntitiesTablePtr 1
9289 static xmlEntitiesTablePtr gen_xmlEntitiesTablePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9292 static void des_xmlEntitiesTablePtr(int no ATTRIBUTE_UNUSED, xmlEntitiesTablePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9296 test_xmlCopyEntitiesTable(void) {
9300 /* missing type support */
9306 test_xmlCreateEntitiesTable(void) {
9310 /* missing type support */
9316 test_xmlDumpEntitiesTable(void) {
9319 #if defined(LIBXML_OUTPUT_ENABLED)
9321 xmlBufferPtr buf; /* An XML buffer. */
9323 xmlEntitiesTablePtr table; /* An entity table */
9326 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
9327 for (n_table = 0;n_table < gen_nb_xmlEntitiesTablePtr;n_table++) {
9328 mem_base = xmlMemBlocks();
9329 buf = gen_xmlBufferPtr(n_buf, 0);
9330 table = gen_xmlEntitiesTablePtr(n_table, 1);
9332 xmlDumpEntitiesTable(buf, table);
9334 des_xmlBufferPtr(n_buf, buf, 0);
9335 des_xmlEntitiesTablePtr(n_table, table, 1);
9336 xmlResetLastError();
9337 if (mem_base != xmlMemBlocks()) {
9338 printf("Leak of %d blocks found in xmlDumpEntitiesTable",
9339 xmlMemBlocks() - mem_base);
9341 printf(" %d", n_buf);
9342 printf(" %d", n_table);
9354 #define gen_nb_xmlEntityPtr 1
9355 static xmlEntityPtr gen_xmlEntityPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9358 static void des_xmlEntityPtr(int no ATTRIBUTE_UNUSED, xmlEntityPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9362 test_xmlDumpEntityDecl(void) {
9365 #if defined(LIBXML_OUTPUT_ENABLED)
9367 xmlBufferPtr buf; /* An XML buffer. */
9369 xmlEntityPtr ent; /* An entity table */
9372 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
9373 for (n_ent = 0;n_ent < gen_nb_xmlEntityPtr;n_ent++) {
9374 mem_base = xmlMemBlocks();
9375 buf = gen_xmlBufferPtr(n_buf, 0);
9376 ent = gen_xmlEntityPtr(n_ent, 1);
9378 xmlDumpEntityDecl(buf, ent);
9380 des_xmlBufferPtr(n_buf, buf, 0);
9381 des_xmlEntityPtr(n_ent, ent, 1);
9382 xmlResetLastError();
9383 if (mem_base != xmlMemBlocks()) {
9384 printf("Leak of %d blocks found in xmlDumpEntityDecl",
9385 xmlMemBlocks() - mem_base);
9387 printf(" %d", n_buf);
9388 printf(" %d", n_ent);
9401 test_xmlEncodeEntitiesReentrant(void) {
9406 xmlDocPtr doc; /* the document containing the string */
9408 xmlChar * input; /* A string to convert to XML. */
9411 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9412 for (n_input = 0;n_input < gen_nb_const_xmlChar_ptr;n_input++) {
9413 mem_base = xmlMemBlocks();
9414 doc = gen_xmlDocPtr(n_doc, 0);
9415 input = gen_const_xmlChar_ptr(n_input, 1);
9417 ret_val = xmlEncodeEntitiesReentrant(doc, (const xmlChar *)input);
9418 desret_xmlChar_ptr(ret_val);
9420 des_xmlDocPtr(n_doc, doc, 0);
9421 des_const_xmlChar_ptr(n_input, (const xmlChar *)input, 1);
9422 xmlResetLastError();
9423 if (mem_base != xmlMemBlocks()) {
9424 printf("Leak of %d blocks found in xmlEncodeEntitiesReentrant",
9425 xmlMemBlocks() - mem_base);
9427 printf(" %d", n_doc);
9428 printf(" %d", n_input);
9440 test_xmlEncodeSpecialChars(void) {
9445 xmlDocPtr doc; /* the document containing the string */
9447 xmlChar * input; /* A string to convert to XML. */
9450 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9451 for (n_input = 0;n_input < gen_nb_const_xmlChar_ptr;n_input++) {
9452 mem_base = xmlMemBlocks();
9453 doc = gen_xmlDocPtr(n_doc, 0);
9454 input = gen_const_xmlChar_ptr(n_input, 1);
9456 ret_val = xmlEncodeSpecialChars(doc, (const xmlChar *)input);
9457 desret_xmlChar_ptr(ret_val);
9459 des_xmlDocPtr(n_doc, doc, 0);
9460 des_const_xmlChar_ptr(n_input, (const xmlChar *)input, 1);
9461 xmlResetLastError();
9462 if (mem_base != xmlMemBlocks()) {
9463 printf("Leak of %d blocks found in xmlEncodeSpecialChars",
9464 xmlMemBlocks() - mem_base);
9466 printf(" %d", n_doc);
9467 printf(" %d", n_input);
9479 test_xmlGetDocEntity(void) {
9483 xmlEntityPtr ret_val;
9484 xmlDocPtr doc; /* the document referencing the entity */
9486 xmlChar * name; /* the entity name */
9489 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9490 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9491 mem_base = xmlMemBlocks();
9492 doc = gen_xmlDocPtr(n_doc, 0);
9493 name = gen_const_xmlChar_ptr(n_name, 1);
9495 ret_val = xmlGetDocEntity(doc, (const xmlChar *)name);
9496 desret_xmlEntityPtr(ret_val);
9498 des_xmlDocPtr(n_doc, doc, 0);
9499 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9500 xmlResetLastError();
9501 if (mem_base != xmlMemBlocks()) {
9502 printf("Leak of %d blocks found in xmlGetDocEntity",
9503 xmlMemBlocks() - mem_base);
9505 printf(" %d", n_doc);
9506 printf(" %d", n_name);
9518 test_xmlGetDtdEntity(void) {
9522 xmlEntityPtr ret_val;
9523 xmlDocPtr doc; /* the document referencing the entity */
9525 xmlChar * name; /* the entity name */
9528 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9529 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9530 mem_base = xmlMemBlocks();
9531 doc = gen_xmlDocPtr(n_doc, 0);
9532 name = gen_const_xmlChar_ptr(n_name, 1);
9534 ret_val = xmlGetDtdEntity(doc, (const xmlChar *)name);
9535 desret_xmlEntityPtr(ret_val);
9537 des_xmlDocPtr(n_doc, doc, 0);
9538 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9539 xmlResetLastError();
9540 if (mem_base != xmlMemBlocks()) {
9541 printf("Leak of %d blocks found in xmlGetDtdEntity",
9542 xmlMemBlocks() - mem_base);
9544 printf(" %d", n_doc);
9545 printf(" %d", n_name);
9557 test_xmlGetParameterEntity(void) {
9561 xmlEntityPtr ret_val;
9562 xmlDocPtr doc; /* the document referencing the entity */
9564 xmlChar * name; /* the entity name */
9567 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9568 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9569 mem_base = xmlMemBlocks();
9570 doc = gen_xmlDocPtr(n_doc, 0);
9571 name = gen_const_xmlChar_ptr(n_name, 1);
9573 ret_val = xmlGetParameterEntity(doc, (const xmlChar *)name);
9574 desret_xmlEntityPtr(ret_val);
9576 des_xmlDocPtr(n_doc, doc, 0);
9577 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9578 xmlResetLastError();
9579 if (mem_base != xmlMemBlocks()) {
9580 printf("Leak of %d blocks found in xmlGetParameterEntity",
9581 xmlMemBlocks() - mem_base);
9583 printf(" %d", n_doc);
9584 printf(" %d", n_name);
9596 test_xmlGetPredefinedEntity(void) {
9600 xmlEntityPtr ret_val;
9601 xmlChar * name; /* the entity name */
9604 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9605 mem_base = xmlMemBlocks();
9606 name = gen_const_xmlChar_ptr(n_name, 0);
9608 ret_val = xmlGetPredefinedEntity((const xmlChar *)name);
9609 desret_xmlEntityPtr(ret_val);
9611 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
9612 xmlResetLastError();
9613 if (mem_base != xmlMemBlocks()) {
9614 printf("Leak of %d blocks found in xmlGetPredefinedEntity",
9615 xmlMemBlocks() - mem_base);
9617 printf(" %d", n_name);
9628 test_xmlInitializePredefinedEntities(void) {
9631 #if defined(LIBXML_LEGACY_ENABLED)
9632 #ifdef LIBXML_LEGACY_ENABLED
9635 mem_base = xmlMemBlocks();
9637 xmlInitializePredefinedEntities();
9639 xmlResetLastError();
9640 if (mem_base != xmlMemBlocks()) {
9641 printf("Leak of %d blocks found in xmlInitializePredefinedEntities",
9642 xmlMemBlocks() - mem_base);
9655 test_xmlNewEntity(void) {
9659 xmlEntityPtr ret_val;
9660 xmlDocPtr doc; /* the document */
9662 xmlChar * name; /* the entity name */
9664 int type; /* the entity type XML_xxx_yyy_ENTITY */
9666 xmlChar * ExternalID; /* the entity external ID if available */
9668 xmlChar * SystemID; /* the entity system ID if available */
9670 xmlChar * content; /* the entity content */
9673 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9674 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9675 for (n_type = 0;n_type < gen_nb_int;n_type++) {
9676 for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
9677 for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
9678 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
9679 mem_base = xmlMemBlocks();
9680 doc = gen_xmlDocPtr(n_doc, 0);
9681 name = gen_const_xmlChar_ptr(n_name, 1);
9682 type = gen_int(n_type, 2);
9683 ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 3);
9684 SystemID = gen_const_xmlChar_ptr(n_SystemID, 4);
9685 content = gen_const_xmlChar_ptr(n_content, 5);
9687 ret_val = xmlNewEntity(doc, (const xmlChar *)name, type, (const xmlChar *)ExternalID, (const xmlChar *)SystemID, (const xmlChar *)content);
9688 desret_xmlEntityPtr(ret_val);
9690 des_xmlDocPtr(n_doc, doc, 0);
9691 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9692 des_int(n_type, type, 2);
9693 des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 3);
9694 des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 4);
9695 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 5);
9696 xmlResetLastError();
9697 if (mem_base != xmlMemBlocks()) {
9698 printf("Leak of %d blocks found in xmlNewEntity",
9699 xmlMemBlocks() - mem_base);
9701 printf(" %d", n_doc);
9702 printf(" %d", n_name);
9703 printf(" %d", n_type);
9704 printf(" %d", n_ExternalID);
9705 printf(" %d", n_SystemID);
9706 printf(" %d", n_content);
9721 test_entities(void) {
9724 if (quiet == 0) printf("Testing entities : 13 of 17 functions ...\n");
9725 test_ret += test_xmlAddDocEntity();
9726 test_ret += test_xmlAddDtdEntity();
9727 test_ret += test_xmlCleanupPredefinedEntities();
9728 test_ret += test_xmlCopyEntitiesTable();
9729 test_ret += test_xmlCreateEntitiesTable();
9730 test_ret += test_xmlDumpEntitiesTable();
9731 test_ret += test_xmlDumpEntityDecl();
9732 test_ret += test_xmlEncodeEntitiesReentrant();
9733 test_ret += test_xmlEncodeSpecialChars();
9734 test_ret += test_xmlGetDocEntity();
9735 test_ret += test_xmlGetDtdEntity();
9736 test_ret += test_xmlGetParameterEntity();
9737 test_ret += test_xmlGetPredefinedEntity();
9738 test_ret += test_xmlInitializePredefinedEntities();
9739 test_ret += test_xmlNewEntity();
9742 printf("Module entities: %d errors\n", test_ret);
9747 test_xmlHashAddEntry(void) {
9752 xmlHashTablePtr table; /* the hash table */
9754 xmlChar * name; /* the name of the userdata */
9756 void * userdata; /* a pointer to the userdata */
9759 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9760 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9761 for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
9762 mem_base = xmlMemBlocks();
9763 table = gen_xmlHashTablePtr(n_table, 0);
9764 name = gen_const_xmlChar_ptr(n_name, 1);
9765 userdata = gen_userdata(n_userdata, 2);
9767 ret_val = xmlHashAddEntry(table, (const xmlChar *)name, userdata);
9768 desret_int(ret_val);
9770 des_xmlHashTablePtr(n_table, table, 0);
9771 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9772 des_userdata(n_userdata, userdata, 2);
9773 xmlResetLastError();
9774 if (mem_base != xmlMemBlocks()) {
9775 printf("Leak of %d blocks found in xmlHashAddEntry",
9776 xmlMemBlocks() - mem_base);
9778 printf(" %d", n_table);
9779 printf(" %d", n_name);
9780 printf(" %d", n_userdata);
9793 test_xmlHashAddEntry2(void) {
9798 xmlHashTablePtr table; /* the hash table */
9800 xmlChar * name; /* the name of the userdata */
9802 xmlChar * name2; /* a second name of the userdata */
9804 void * userdata; /* a pointer to the userdata */
9807 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9808 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9809 for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
9810 for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
9811 mem_base = xmlMemBlocks();
9812 table = gen_xmlHashTablePtr(n_table, 0);
9813 name = gen_const_xmlChar_ptr(n_name, 1);
9814 name2 = gen_const_xmlChar_ptr(n_name2, 2);
9815 userdata = gen_userdata(n_userdata, 3);
9817 ret_val = xmlHashAddEntry2(table, (const xmlChar *)name, (const xmlChar *)name2, userdata);
9818 desret_int(ret_val);
9820 des_xmlHashTablePtr(n_table, table, 0);
9821 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9822 des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
9823 des_userdata(n_userdata, userdata, 3);
9824 xmlResetLastError();
9825 if (mem_base != xmlMemBlocks()) {
9826 printf("Leak of %d blocks found in xmlHashAddEntry2",
9827 xmlMemBlocks() - mem_base);
9829 printf(" %d", n_table);
9830 printf(" %d", n_name);
9831 printf(" %d", n_name2);
9832 printf(" %d", n_userdata);
9846 test_xmlHashAddEntry3(void) {
9851 xmlHashTablePtr table; /* the hash table */
9853 xmlChar * name; /* the name of the userdata */
9855 xmlChar * name2; /* a second name of the userdata */
9857 xmlChar * name3; /* a third name of the userdata */
9859 void * userdata; /* a pointer to the userdata */
9862 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9863 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9864 for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
9865 for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) {
9866 for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
9867 mem_base = xmlMemBlocks();
9868 table = gen_xmlHashTablePtr(n_table, 0);
9869 name = gen_const_xmlChar_ptr(n_name, 1);
9870 name2 = gen_const_xmlChar_ptr(n_name2, 2);
9871 name3 = gen_const_xmlChar_ptr(n_name3, 3);
9872 userdata = gen_userdata(n_userdata, 4);
9874 ret_val = xmlHashAddEntry3(table, (const xmlChar *)name, (const xmlChar *)name2, (const xmlChar *)name3, userdata);
9875 desret_int(ret_val);
9877 des_xmlHashTablePtr(n_table, table, 0);
9878 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9879 des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
9880 des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 3);
9881 des_userdata(n_userdata, userdata, 4);
9882 xmlResetLastError();
9883 if (mem_base != xmlMemBlocks()) {
9884 printf("Leak of %d blocks found in xmlHashAddEntry3",
9885 xmlMemBlocks() - mem_base);
9887 printf(" %d", n_table);
9888 printf(" %d", n_name);
9889 printf(" %d", n_name2);
9890 printf(" %d", n_name3);
9891 printf(" %d", n_userdata);
9906 test_xmlHashCopy(void) {
9910 /* missing type support */
9916 test_xmlHashCreate(void) {
9920 /* missing type support */
9926 test_xmlHashCreateDict(void) {
9930 /* missing type support */
9936 test_xmlHashLookup(void) {
9941 xmlHashTablePtr table; /* the hash table */
9943 xmlChar * name; /* the name of the userdata */
9946 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9947 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9948 mem_base = xmlMemBlocks();
9949 table = gen_xmlHashTablePtr(n_table, 0);
9950 name = gen_const_xmlChar_ptr(n_name, 1);
9952 ret_val = xmlHashLookup(table, (const xmlChar *)name);
9953 desret_void_ptr(ret_val);
9955 des_xmlHashTablePtr(n_table, table, 0);
9956 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9957 xmlResetLastError();
9958 if (mem_base != xmlMemBlocks()) {
9959 printf("Leak of %d blocks found in xmlHashLookup",
9960 xmlMemBlocks() - mem_base);
9962 printf(" %d", n_table);
9963 printf(" %d", n_name);
9975 test_xmlHashLookup2(void) {
9980 xmlHashTablePtr table; /* the hash table */
9982 xmlChar * name; /* the name of the userdata */
9984 xmlChar * name2; /* a second name of the userdata */
9987 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9988 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9989 for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
9990 mem_base = xmlMemBlocks();
9991 table = gen_xmlHashTablePtr(n_table, 0);
9992 name = gen_const_xmlChar_ptr(n_name, 1);
9993 name2 = gen_const_xmlChar_ptr(n_name2, 2);
9995 ret_val = xmlHashLookup2(table, (const xmlChar *)name, (const xmlChar *)name2);
9996 desret_void_ptr(ret_val);
9998 des_xmlHashTablePtr(n_table, table, 0);
9999 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10000 des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
10001 xmlResetLastError();
10002 if (mem_base != xmlMemBlocks()) {
10003 printf("Leak of %d blocks found in xmlHashLookup2",
10004 xmlMemBlocks() - mem_base);
10006 printf(" %d", n_table);
10007 printf(" %d", n_name);
10008 printf(" %d", n_name2);
10021 test_xmlHashLookup3(void) {
10026 xmlHashTablePtr table; /* the hash table */
10028 xmlChar * name; /* the name of the userdata */
10030 xmlChar * name2; /* a second name of the userdata */
10032 xmlChar * name3; /* a third name of the userdata */
10035 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10036 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10037 for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10038 for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) {
10039 mem_base = xmlMemBlocks();
10040 table = gen_xmlHashTablePtr(n_table, 0);
10041 name = gen_const_xmlChar_ptr(n_name, 1);
10042 name2 = gen_const_xmlChar_ptr(n_name2, 2);
10043 name3 = gen_const_xmlChar_ptr(n_name3, 3);
10045 ret_val = xmlHashLookup3(table, (const xmlChar *)name, (const xmlChar *)name2, (const xmlChar *)name3);
10046 desret_void_ptr(ret_val);
10048 des_xmlHashTablePtr(n_table, table, 0);
10049 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10050 des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
10051 des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 3);
10052 xmlResetLastError();
10053 if (mem_base != xmlMemBlocks()) {
10054 printf("Leak of %d blocks found in xmlHashLookup3",
10055 xmlMemBlocks() - mem_base);
10057 printf(" %d", n_table);
10058 printf(" %d", n_name);
10059 printf(" %d", n_name2);
10060 printf(" %d", n_name3);
10074 test_xmlHashQLookup(void) {
10079 xmlHashTablePtr table; /* the hash table */
10081 xmlChar * prefix; /* the prefix of the userdata */
10083 xmlChar * name; /* the name of the userdata */
10086 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10087 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
10088 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10089 mem_base = xmlMemBlocks();
10090 table = gen_xmlHashTablePtr(n_table, 0);
10091 prefix = gen_const_xmlChar_ptr(n_prefix, 1);
10092 name = gen_const_xmlChar_ptr(n_name, 2);
10094 ret_val = xmlHashQLookup(table, (const xmlChar *)prefix, (const xmlChar *)name);
10095 desret_void_ptr(ret_val);
10097 des_xmlHashTablePtr(n_table, table, 0);
10098 des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
10099 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
10100 xmlResetLastError();
10101 if (mem_base != xmlMemBlocks()) {
10102 printf("Leak of %d blocks found in xmlHashQLookup",
10103 xmlMemBlocks() - mem_base);
10105 printf(" %d", n_table);
10106 printf(" %d", n_prefix);
10107 printf(" %d", n_name);
10120 test_xmlHashQLookup2(void) {
10125 xmlHashTablePtr table; /* the hash table */
10127 xmlChar * prefix; /* the prefix of the userdata */
10129 xmlChar * name; /* the name of the userdata */
10131 xmlChar * prefix2; /* the second prefix of the userdata */
10133 xmlChar * name2; /* a second name of the userdata */
10136 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10137 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
10138 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10139 for (n_prefix2 = 0;n_prefix2 < gen_nb_const_xmlChar_ptr;n_prefix2++) {
10140 for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10141 mem_base = xmlMemBlocks();
10142 table = gen_xmlHashTablePtr(n_table, 0);
10143 prefix = gen_const_xmlChar_ptr(n_prefix, 1);
10144 name = gen_const_xmlChar_ptr(n_name, 2);
10145 prefix2 = gen_const_xmlChar_ptr(n_prefix2, 3);
10146 name2 = gen_const_xmlChar_ptr(n_name2, 4);
10148 ret_val = xmlHashQLookup2(table, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)prefix2, (const xmlChar *)name2);
10149 desret_void_ptr(ret_val);
10151 des_xmlHashTablePtr(n_table, table, 0);
10152 des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
10153 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
10154 des_const_xmlChar_ptr(n_prefix2, (const xmlChar *)prefix2, 3);
10155 des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 4);
10156 xmlResetLastError();
10157 if (mem_base != xmlMemBlocks()) {
10158 printf("Leak of %d blocks found in xmlHashQLookup2",
10159 xmlMemBlocks() - mem_base);
10161 printf(" %d", n_table);
10162 printf(" %d", n_prefix);
10163 printf(" %d", n_name);
10164 printf(" %d", n_prefix2);
10165 printf(" %d", n_name2);
10180 test_xmlHashQLookup3(void) {
10185 xmlHashTablePtr table; /* the hash table */
10187 xmlChar * prefix; /* the prefix of the userdata */
10189 xmlChar * name; /* the name of the userdata */
10191 xmlChar * prefix2; /* the second prefix of the userdata */
10193 xmlChar * name2; /* a second name of the userdata */
10195 xmlChar * prefix3; /* the third prefix of the userdata */
10197 xmlChar * name3; /* a third name of the userdata */
10200 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10201 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
10202 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10203 for (n_prefix2 = 0;n_prefix2 < gen_nb_const_xmlChar_ptr;n_prefix2++) {
10204 for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10205 for (n_prefix3 = 0;n_prefix3 < gen_nb_const_xmlChar_ptr;n_prefix3++) {
10206 for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) {
10207 mem_base = xmlMemBlocks();
10208 table = gen_xmlHashTablePtr(n_table, 0);
10209 prefix = gen_const_xmlChar_ptr(n_prefix, 1);
10210 name = gen_const_xmlChar_ptr(n_name, 2);
10211 prefix2 = gen_const_xmlChar_ptr(n_prefix2, 3);
10212 name2 = gen_const_xmlChar_ptr(n_name2, 4);
10213 prefix3 = gen_const_xmlChar_ptr(n_prefix3, 5);
10214 name3 = gen_const_xmlChar_ptr(n_name3, 6);
10216 ret_val = xmlHashQLookup3(table, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)prefix2, (const xmlChar *)name2, (const xmlChar *)prefix3, (const xmlChar *)name3);
10217 desret_void_ptr(ret_val);
10219 des_xmlHashTablePtr(n_table, table, 0);
10220 des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
10221 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
10222 des_const_xmlChar_ptr(n_prefix2, (const xmlChar *)prefix2, 3);
10223 des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 4);
10224 des_const_xmlChar_ptr(n_prefix3, (const xmlChar *)prefix3, 5);
10225 des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 6);
10226 xmlResetLastError();
10227 if (mem_base != xmlMemBlocks()) {
10228 printf("Leak of %d blocks found in xmlHashQLookup3",
10229 xmlMemBlocks() - mem_base);
10231 printf(" %d", n_table);
10232 printf(" %d", n_prefix);
10233 printf(" %d", n_name);
10234 printf(" %d", n_prefix2);
10235 printf(" %d", n_name2);
10236 printf(" %d", n_prefix3);
10237 printf(" %d", n_name3);
10254 test_xmlHashRemoveEntry(void) {
10259 xmlHashTablePtr table; /* the hash table */
10261 xmlChar * name; /* the name of the userdata */
10263 xmlHashDeallocator f; /* the deallocator function for removed item (if any) */
10266 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10267 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10268 for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10269 mem_base = xmlMemBlocks();
10270 table = gen_xmlHashTablePtr(n_table, 0);
10271 name = gen_const_xmlChar_ptr(n_name, 1);
10272 f = gen_xmlHashDeallocator(n_f, 2);
10274 ret_val = xmlHashRemoveEntry(table, (const xmlChar *)name, f);
10275 desret_int(ret_val);
10277 des_xmlHashTablePtr(n_table, table, 0);
10278 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10279 des_xmlHashDeallocator(n_f, f, 2);
10280 xmlResetLastError();
10281 if (mem_base != xmlMemBlocks()) {
10282 printf("Leak of %d blocks found in xmlHashRemoveEntry",
10283 xmlMemBlocks() - mem_base);
10285 printf(" %d", n_table);
10286 printf(" %d", n_name);
10287 printf(" %d", n_f);
10300 test_xmlHashRemoveEntry2(void) {
10305 xmlHashTablePtr table; /* the hash table */
10307 xmlChar * name; /* the name of the userdata */
10309 xmlChar * name2; /* a second name of the userdata */
10311 xmlHashDeallocator f; /* the deallocator function for removed item (if any) */
10314 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10315 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10316 for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10317 for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10318 mem_base = xmlMemBlocks();
10319 table = gen_xmlHashTablePtr(n_table, 0);
10320 name = gen_const_xmlChar_ptr(n_name, 1);
10321 name2 = gen_const_xmlChar_ptr(n_name2, 2);
10322 f = gen_xmlHashDeallocator(n_f, 3);
10324 ret_val = xmlHashRemoveEntry2(table, (const xmlChar *)name, (const xmlChar *)name2, f);
10325 desret_int(ret_val);
10327 des_xmlHashTablePtr(n_table, table, 0);
10328 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10329 des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
10330 des_xmlHashDeallocator(n_f, f, 3);
10331 xmlResetLastError();
10332 if (mem_base != xmlMemBlocks()) {
10333 printf("Leak of %d blocks found in xmlHashRemoveEntry2",
10334 xmlMemBlocks() - mem_base);
10336 printf(" %d", n_table);
10337 printf(" %d", n_name);
10338 printf(" %d", n_name2);
10339 printf(" %d", n_f);
10353 test_xmlHashRemoveEntry3(void) {
10358 xmlHashTablePtr table; /* the hash table */
10360 xmlChar * name; /* the name of the userdata */
10362 xmlChar * name2; /* a second name of the userdata */
10364 xmlChar * name3; /* a third name of the userdata */
10366 xmlHashDeallocator f; /* the deallocator function for removed item (if any) */
10369 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10370 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10371 for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10372 for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) {
10373 for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10374 mem_base = xmlMemBlocks();
10375 table = gen_xmlHashTablePtr(n_table, 0);
10376 name = gen_const_xmlChar_ptr(n_name, 1);
10377 name2 = gen_const_xmlChar_ptr(n_name2, 2);
10378 name3 = gen_const_xmlChar_ptr(n_name3, 3);
10379 f = gen_xmlHashDeallocator(n_f, 4);
10381 ret_val = xmlHashRemoveEntry3(table, (const xmlChar *)name, (const xmlChar *)name2, (const xmlChar *)name3, f);
10382 desret_int(ret_val);
10384 des_xmlHashTablePtr(n_table, table, 0);
10385 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10386 des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
10387 des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 3);
10388 des_xmlHashDeallocator(n_f, f, 4);
10389 xmlResetLastError();
10390 if (mem_base != xmlMemBlocks()) {
10391 printf("Leak of %d blocks found in xmlHashRemoveEntry3",
10392 xmlMemBlocks() - mem_base);
10394 printf(" %d", n_table);
10395 printf(" %d", n_name);
10396 printf(" %d", n_name2);
10397 printf(" %d", n_name3);
10398 printf(" %d", n_f);
10413 test_xmlHashScan(void) {
10417 /* missing type support */
10423 test_xmlHashScan3(void) {
10427 /* missing type support */
10433 test_xmlHashScanFull(void) {
10437 /* missing type support */
10443 test_xmlHashScanFull3(void) {
10447 /* missing type support */
10453 test_xmlHashSize(void) {
10458 xmlHashTablePtr table; /* the hash table */
10461 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10462 mem_base = xmlMemBlocks();
10463 table = gen_xmlHashTablePtr(n_table, 0);
10465 ret_val = xmlHashSize(table);
10466 desret_int(ret_val);
10468 des_xmlHashTablePtr(n_table, table, 0);
10469 xmlResetLastError();
10470 if (mem_base != xmlMemBlocks()) {
10471 printf("Leak of %d blocks found in xmlHashSize",
10472 xmlMemBlocks() - mem_base);
10474 printf(" %d", n_table);
10485 test_xmlHashUpdateEntry(void) {
10490 xmlHashTablePtr table; /* the hash table */
10492 xmlChar * name; /* the name of the userdata */
10494 void * userdata; /* a pointer to the userdata */
10496 xmlHashDeallocator f; /* the deallocator function for replaced item (if any) */
10499 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10500 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10501 for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
10502 for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10503 mem_base = xmlMemBlocks();
10504 table = gen_xmlHashTablePtr(n_table, 0);
10505 name = gen_const_xmlChar_ptr(n_name, 1);
10506 userdata = gen_userdata(n_userdata, 2);
10507 f = gen_xmlHashDeallocator(n_f, 3);
10509 ret_val = xmlHashUpdateEntry(table, (const xmlChar *)name, userdata, f);
10510 desret_int(ret_val);
10512 des_xmlHashTablePtr(n_table, table, 0);
10513 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10514 des_userdata(n_userdata, userdata, 2);
10515 des_xmlHashDeallocator(n_f, f, 3);
10516 xmlResetLastError();
10517 if (mem_base != xmlMemBlocks()) {
10518 printf("Leak of %d blocks found in xmlHashUpdateEntry",
10519 xmlMemBlocks() - mem_base);
10521 printf(" %d", n_table);
10522 printf(" %d", n_name);
10523 printf(" %d", n_userdata);
10524 printf(" %d", n_f);
10538 test_xmlHashUpdateEntry2(void) {
10543 xmlHashTablePtr table; /* the hash table */
10545 xmlChar * name; /* the name of the userdata */
10547 xmlChar * name2; /* a second name of the userdata */
10549 void * userdata; /* a pointer to the userdata */
10551 xmlHashDeallocator f; /* the deallocator function for replaced item (if any) */
10554 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10555 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10556 for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10557 for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
10558 for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10559 mem_base = xmlMemBlocks();
10560 table = gen_xmlHashTablePtr(n_table, 0);
10561 name = gen_const_xmlChar_ptr(n_name, 1);
10562 name2 = gen_const_xmlChar_ptr(n_name2, 2);
10563 userdata = gen_userdata(n_userdata, 3);
10564 f = gen_xmlHashDeallocator(n_f, 4);
10566 ret_val = xmlHashUpdateEntry2(table, (const xmlChar *)name, (const xmlChar *)name2, userdata, f);
10567 desret_int(ret_val);
10569 des_xmlHashTablePtr(n_table, table, 0);
10570 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10571 des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
10572 des_userdata(n_userdata, userdata, 3);
10573 des_xmlHashDeallocator(n_f, f, 4);
10574 xmlResetLastError();
10575 if (mem_base != xmlMemBlocks()) {
10576 printf("Leak of %d blocks found in xmlHashUpdateEntry2",
10577 xmlMemBlocks() - mem_base);
10579 printf(" %d", n_table);
10580 printf(" %d", n_name);
10581 printf(" %d", n_name2);
10582 printf(" %d", n_userdata);
10583 printf(" %d", n_f);
10598 test_xmlHashUpdateEntry3(void) {
10603 xmlHashTablePtr table; /* the hash table */
10605 xmlChar * name; /* the name of the userdata */
10607 xmlChar * name2; /* a second name of the userdata */
10609 xmlChar * name3; /* a third name of the userdata */
10611 void * userdata; /* a pointer to the userdata */
10613 xmlHashDeallocator f; /* the deallocator function for replaced item (if any) */
10616 for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10617 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10618 for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10619 for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) {
10620 for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
10621 for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10622 mem_base = xmlMemBlocks();
10623 table = gen_xmlHashTablePtr(n_table, 0);
10624 name = gen_const_xmlChar_ptr(n_name, 1);
10625 name2 = gen_const_xmlChar_ptr(n_name2, 2);
10626 name3 = gen_const_xmlChar_ptr(n_name3, 3);
10627 userdata = gen_userdata(n_userdata, 4);
10628 f = gen_xmlHashDeallocator(n_f, 5);
10630 ret_val = xmlHashUpdateEntry3(table, (const xmlChar *)name, (const xmlChar *)name2, (const xmlChar *)name3, userdata, f);
10631 desret_int(ret_val);
10633 des_xmlHashTablePtr(n_table, table, 0);
10634 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10635 des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
10636 des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 3);
10637 des_userdata(n_userdata, userdata, 4);
10638 des_xmlHashDeallocator(n_f, f, 5);
10639 xmlResetLastError();
10640 if (mem_base != xmlMemBlocks()) {
10641 printf("Leak of %d blocks found in xmlHashUpdateEntry3",
10642 xmlMemBlocks() - mem_base);
10644 printf(" %d", n_table);
10645 printf(" %d", n_name);
10646 printf(" %d", n_name2);
10647 printf(" %d", n_name3);
10648 printf(" %d", n_userdata);
10649 printf(" %d", n_f);
10667 if (quiet == 0) printf("Testing hash : 16 of 24 functions ...\n");
10668 test_ret += test_xmlHashAddEntry();
10669 test_ret += test_xmlHashAddEntry2();
10670 test_ret += test_xmlHashAddEntry3();
10671 test_ret += test_xmlHashCopy();
10672 test_ret += test_xmlHashCreate();
10673 test_ret += test_xmlHashCreateDict();
10674 test_ret += test_xmlHashLookup();
10675 test_ret += test_xmlHashLookup2();
10676 test_ret += test_xmlHashLookup3();
10677 test_ret += test_xmlHashQLookup();
10678 test_ret += test_xmlHashQLookup2();
10679 test_ret += test_xmlHashQLookup3();
10680 test_ret += test_xmlHashRemoveEntry();
10681 test_ret += test_xmlHashRemoveEntry2();
10682 test_ret += test_xmlHashRemoveEntry3();
10683 test_ret += test_xmlHashScan();
10684 test_ret += test_xmlHashScan3();
10685 test_ret += test_xmlHashScanFull();
10686 test_ret += test_xmlHashScanFull3();
10687 test_ret += test_xmlHashSize();
10688 test_ret += test_xmlHashUpdateEntry();
10689 test_ret += test_xmlHashUpdateEntry2();
10690 test_ret += test_xmlHashUpdateEntry3();
10693 printf("Module hash: %d errors\n", test_ret);
10697 #define gen_nb_xmlLinkPtr 1
10698 static xmlLinkPtr gen_xmlLinkPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
10701 static void des_xmlLinkPtr(int no ATTRIBUTE_UNUSED, xmlLinkPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
10705 test_xmlLinkGetData(void) {
10710 xmlLinkPtr lk; /* a link */
10713 for (n_lk = 0;n_lk < gen_nb_xmlLinkPtr;n_lk++) {
10714 mem_base = xmlMemBlocks();
10715 lk = gen_xmlLinkPtr(n_lk, 0);
10717 ret_val = xmlLinkGetData(lk);
10718 desret_void_ptr(ret_val);
10720 des_xmlLinkPtr(n_lk, lk, 0);
10721 xmlResetLastError();
10722 if (mem_base != xmlMemBlocks()) {
10723 printf("Leak of %d blocks found in xmlLinkGetData",
10724 xmlMemBlocks() - mem_base);
10726 printf(" %d", n_lk);
10737 test_xmlListAppend(void) {
10742 xmlListPtr l; /* a list */
10744 void * data; /* the data */
10747 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10748 for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
10749 mem_base = xmlMemBlocks();
10750 l = gen_xmlListPtr(n_l, 0);
10751 data = gen_userdata(n_data, 1);
10753 ret_val = xmlListAppend(l, data);
10754 desret_int(ret_val);
10756 des_xmlListPtr(n_l, l, 0);
10757 des_userdata(n_data, data, 1);
10758 xmlResetLastError();
10759 if (mem_base != xmlMemBlocks()) {
10760 printf("Leak of %d blocks found in xmlListAppend",
10761 xmlMemBlocks() - mem_base);
10763 printf(" %d", n_l);
10764 printf(" %d", n_data);
10776 test_xmlListClear(void) {
10780 xmlListPtr l; /* a list */
10783 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10784 mem_base = xmlMemBlocks();
10785 l = gen_xmlListPtr(n_l, 0);
10789 des_xmlListPtr(n_l, l, 0);
10790 xmlResetLastError();
10791 if (mem_base != xmlMemBlocks()) {
10792 printf("Leak of %d blocks found in xmlListClear",
10793 xmlMemBlocks() - mem_base);
10795 printf(" %d", n_l);
10805 #define gen_nb_const_xmlListPtr 1
10806 static xmlListPtr gen_const_xmlListPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
10809 static void des_const_xmlListPtr(int no ATTRIBUTE_UNUSED, const xmlListPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
10813 test_xmlListCopy(void) {
10818 xmlListPtr cur; /* the new list */
10820 xmlListPtr old; /* the old list */
10823 for (n_cur = 0;n_cur < gen_nb_xmlListPtr;n_cur++) {
10824 for (n_old = 0;n_old < gen_nb_const_xmlListPtr;n_old++) {
10825 mem_base = xmlMemBlocks();
10826 cur = gen_xmlListPtr(n_cur, 0);
10827 old = gen_const_xmlListPtr(n_old, 1);
10829 ret_val = xmlListCopy(cur, (const xmlListPtr)old);
10830 desret_int(ret_val);
10832 des_xmlListPtr(n_cur, cur, 0);
10833 des_const_xmlListPtr(n_old, (const xmlListPtr)old, 1);
10834 xmlResetLastError();
10835 if (mem_base != xmlMemBlocks()) {
10836 printf("Leak of %d blocks found in xmlListCopy",
10837 xmlMemBlocks() - mem_base);
10839 printf(" %d", n_cur);
10840 printf(" %d", n_old);
10852 test_xmlListCreate(void) {
10856 /* missing type support */
10862 test_xmlListDup(void) {
10866 /* missing type support */
10872 test_xmlListEmpty(void) {
10877 xmlListPtr l; /* a list */
10880 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10881 mem_base = xmlMemBlocks();
10882 l = gen_xmlListPtr(n_l, 0);
10884 ret_val = xmlListEmpty(l);
10885 desret_int(ret_val);
10887 des_xmlListPtr(n_l, l, 0);
10888 xmlResetLastError();
10889 if (mem_base != xmlMemBlocks()) {
10890 printf("Leak of %d blocks found in xmlListEmpty",
10891 xmlMemBlocks() - mem_base);
10893 printf(" %d", n_l);
10904 test_xmlListEnd(void) {
10908 /* missing type support */
10914 test_xmlListFront(void) {
10918 /* missing type support */
10924 test_xmlListInsert(void) {
10929 xmlListPtr l; /* a list */
10931 void * data; /* the data */
10934 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10935 for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
10936 mem_base = xmlMemBlocks();
10937 l = gen_xmlListPtr(n_l, 0);
10938 data = gen_userdata(n_data, 1);
10940 ret_val = xmlListInsert(l, data);
10941 desret_int(ret_val);
10943 des_xmlListPtr(n_l, l, 0);
10944 des_userdata(n_data, data, 1);
10945 xmlResetLastError();
10946 if (mem_base != xmlMemBlocks()) {
10947 printf("Leak of %d blocks found in xmlListInsert",
10948 xmlMemBlocks() - mem_base);
10950 printf(" %d", n_l);
10951 printf(" %d", n_data);
10963 test_xmlListMerge(void) {
10967 xmlListPtr l1; /* the original list */
10969 xmlListPtr l2; /* the new list */
10972 for (n_l1 = 0;n_l1 < gen_nb_xmlListPtr;n_l1++) {
10973 for (n_l2 = 0;n_l2 < gen_nb_xmlListPtr;n_l2++) {
10974 mem_base = xmlMemBlocks();
10975 l1 = gen_xmlListPtr(n_l1, 0);
10976 l2 = gen_xmlListPtr(n_l2, 1);
10978 xmlListMerge(l1, l2);
10980 des_xmlListPtr(n_l1, l1, 0);
10981 des_xmlListPtr(n_l2, l2, 1);
10982 xmlResetLastError();
10983 if (mem_base != xmlMemBlocks()) {
10984 printf("Leak of %d blocks found in xmlListMerge",
10985 xmlMemBlocks() - mem_base);
10987 printf(" %d", n_l1);
10988 printf(" %d", n_l2);
11000 test_xmlListPopBack(void) {
11004 xmlListPtr l; /* a list */
11007 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11008 mem_base = xmlMemBlocks();
11009 l = gen_xmlListPtr(n_l, 0);
11013 des_xmlListPtr(n_l, l, 0);
11014 xmlResetLastError();
11015 if (mem_base != xmlMemBlocks()) {
11016 printf("Leak of %d blocks found in xmlListPopBack",
11017 xmlMemBlocks() - mem_base);
11019 printf(" %d", n_l);
11030 test_xmlListPopFront(void) {
11034 xmlListPtr l; /* a list */
11037 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11038 mem_base = xmlMemBlocks();
11039 l = gen_xmlListPtr(n_l, 0);
11041 xmlListPopFront(l);
11043 des_xmlListPtr(n_l, l, 0);
11044 xmlResetLastError();
11045 if (mem_base != xmlMemBlocks()) {
11046 printf("Leak of %d blocks found in xmlListPopFront",
11047 xmlMemBlocks() - mem_base);
11049 printf(" %d", n_l);
11060 test_xmlListPushBack(void) {
11065 xmlListPtr l; /* a list */
11067 void * data; /* new data */
11070 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11071 for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11072 mem_base = xmlMemBlocks();
11073 l = gen_xmlListPtr(n_l, 0);
11074 data = gen_userdata(n_data, 1);
11076 ret_val = xmlListPushBack(l, data);
11077 desret_int(ret_val);
11079 des_xmlListPtr(n_l, l, 0);
11080 des_userdata(n_data, data, 1);
11081 xmlResetLastError();
11082 if (mem_base != xmlMemBlocks()) {
11083 printf("Leak of %d blocks found in xmlListPushBack",
11084 xmlMemBlocks() - mem_base);
11086 printf(" %d", n_l);
11087 printf(" %d", n_data);
11099 test_xmlListPushFront(void) {
11104 xmlListPtr l; /* a list */
11106 void * data; /* new data */
11109 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11110 for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11111 mem_base = xmlMemBlocks();
11112 l = gen_xmlListPtr(n_l, 0);
11113 data = gen_userdata(n_data, 1);
11115 ret_val = xmlListPushFront(l, data);
11116 desret_int(ret_val);
11118 des_xmlListPtr(n_l, l, 0);
11119 des_userdata(n_data, data, 1);
11120 xmlResetLastError();
11121 if (mem_base != xmlMemBlocks()) {
11122 printf("Leak of %d blocks found in xmlListPushFront",
11123 xmlMemBlocks() - mem_base);
11125 printf(" %d", n_l);
11126 printf(" %d", n_data);
11138 test_xmlListRemoveAll(void) {
11143 xmlListPtr l; /* a list */
11145 void * data; /* list data */
11148 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11149 for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11150 mem_base = xmlMemBlocks();
11151 l = gen_xmlListPtr(n_l, 0);
11152 data = gen_userdata(n_data, 1);
11154 ret_val = xmlListRemoveAll(l, data);
11155 desret_int(ret_val);
11157 des_xmlListPtr(n_l, l, 0);
11158 des_userdata(n_data, data, 1);
11159 xmlResetLastError();
11160 if (mem_base != xmlMemBlocks()) {
11161 printf("Leak of %d blocks found in xmlListRemoveAll",
11162 xmlMemBlocks() - mem_base);
11164 printf(" %d", n_l);
11165 printf(" %d", n_data);
11177 test_xmlListRemoveFirst(void) {
11182 xmlListPtr l; /* a list */
11184 void * data; /* list data */
11187 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11188 for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11189 mem_base = xmlMemBlocks();
11190 l = gen_xmlListPtr(n_l, 0);
11191 data = gen_userdata(n_data, 1);
11193 ret_val = xmlListRemoveFirst(l, data);
11194 desret_int(ret_val);
11196 des_xmlListPtr(n_l, l, 0);
11197 des_userdata(n_data, data, 1);
11198 xmlResetLastError();
11199 if (mem_base != xmlMemBlocks()) {
11200 printf("Leak of %d blocks found in xmlListRemoveFirst",
11201 xmlMemBlocks() - mem_base);
11203 printf(" %d", n_l);
11204 printf(" %d", n_data);
11216 test_xmlListRemoveLast(void) {
11221 xmlListPtr l; /* a list */
11223 void * data; /* list data */
11226 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11227 for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11228 mem_base = xmlMemBlocks();
11229 l = gen_xmlListPtr(n_l, 0);
11230 data = gen_userdata(n_data, 1);
11232 ret_val = xmlListRemoveLast(l, data);
11233 desret_int(ret_val);
11235 des_xmlListPtr(n_l, l, 0);
11236 des_userdata(n_data, data, 1);
11237 xmlResetLastError();
11238 if (mem_base != xmlMemBlocks()) {
11239 printf("Leak of %d blocks found in xmlListRemoveLast",
11240 xmlMemBlocks() - mem_base);
11242 printf(" %d", n_l);
11243 printf(" %d", n_data);
11255 test_xmlListReverse(void) {
11259 xmlListPtr l; /* a list */
11262 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11263 mem_base = xmlMemBlocks();
11264 l = gen_xmlListPtr(n_l, 0);
11268 des_xmlListPtr(n_l, l, 0);
11269 xmlResetLastError();
11270 if (mem_base != xmlMemBlocks()) {
11271 printf("Leak of %d blocks found in xmlListReverse",
11272 xmlMemBlocks() - mem_base);
11274 printf(" %d", n_l);
11285 test_xmlListReverseSearch(void) {
11290 xmlListPtr l; /* a list */
11292 void * data; /* a search value */
11295 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11296 for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11297 mem_base = xmlMemBlocks();
11298 l = gen_xmlListPtr(n_l, 0);
11299 data = gen_userdata(n_data, 1);
11301 ret_val = xmlListReverseSearch(l, data);
11302 desret_void_ptr(ret_val);
11304 des_xmlListPtr(n_l, l, 0);
11305 des_userdata(n_data, data, 1);
11306 xmlResetLastError();
11307 if (mem_base != xmlMemBlocks()) {
11308 printf("Leak of %d blocks found in xmlListReverseSearch",
11309 xmlMemBlocks() - mem_base);
11311 printf(" %d", n_l);
11312 printf(" %d", n_data);
11324 test_xmlListReverseWalk(void) {
11328 /* missing type support */
11334 test_xmlListSearch(void) {
11339 xmlListPtr l; /* a list */
11341 void * data; /* a search value */
11344 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11345 for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11346 mem_base = xmlMemBlocks();
11347 l = gen_xmlListPtr(n_l, 0);
11348 data = gen_userdata(n_data, 1);
11350 ret_val = xmlListSearch(l, data);
11351 desret_void_ptr(ret_val);
11353 des_xmlListPtr(n_l, l, 0);
11354 des_userdata(n_data, data, 1);
11355 xmlResetLastError();
11356 if (mem_base != xmlMemBlocks()) {
11357 printf("Leak of %d blocks found in xmlListSearch",
11358 xmlMemBlocks() - mem_base);
11360 printf(" %d", n_l);
11361 printf(" %d", n_data);
11373 test_xmlListSize(void) {
11378 xmlListPtr l; /* a list */
11381 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11382 mem_base = xmlMemBlocks();
11383 l = gen_xmlListPtr(n_l, 0);
11385 ret_val = xmlListSize(l);
11386 desret_int(ret_val);
11388 des_xmlListPtr(n_l, l, 0);
11389 xmlResetLastError();
11390 if (mem_base != xmlMemBlocks()) {
11391 printf("Leak of %d blocks found in xmlListSize",
11392 xmlMemBlocks() - mem_base);
11394 printf(" %d", n_l);
11405 test_xmlListSort(void) {
11409 xmlListPtr l; /* a list */
11412 for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11413 mem_base = xmlMemBlocks();
11414 l = gen_xmlListPtr(n_l, 0);
11418 des_xmlListPtr(n_l, l, 0);
11419 xmlResetLastError();
11420 if (mem_base != xmlMemBlocks()) {
11421 printf("Leak of %d blocks found in xmlListSort",
11422 xmlMemBlocks() - mem_base);
11424 printf(" %d", n_l);
11435 test_xmlListWalk(void) {
11439 /* missing type support */
11447 if (quiet == 0) printf("Testing list : 19 of 26 functions ...\n");
11448 test_ret += test_xmlLinkGetData();
11449 test_ret += test_xmlListAppend();
11450 test_ret += test_xmlListClear();
11451 test_ret += test_xmlListCopy();
11452 test_ret += test_xmlListCreate();
11453 test_ret += test_xmlListDup();
11454 test_ret += test_xmlListEmpty();
11455 test_ret += test_xmlListEnd();
11456 test_ret += test_xmlListFront();
11457 test_ret += test_xmlListInsert();
11458 test_ret += test_xmlListMerge();
11459 test_ret += test_xmlListPopBack();
11460 test_ret += test_xmlListPopFront();
11461 test_ret += test_xmlListPushBack();
11462 test_ret += test_xmlListPushFront();
11463 test_ret += test_xmlListRemoveAll();
11464 test_ret += test_xmlListRemoveFirst();
11465 test_ret += test_xmlListRemoveLast();
11466 test_ret += test_xmlListReverse();
11467 test_ret += test_xmlListReverseSearch();
11468 test_ret += test_xmlListReverseWalk();
11469 test_ret += test_xmlListSearch();
11470 test_ret += test_xmlListSize();
11471 test_ret += test_xmlListSort();
11472 test_ret += test_xmlListWalk();
11475 printf("Module list: %d errors\n", test_ret);
11480 test_xmlNanoFTPCheckResponse(void) {
11483 #if defined(LIBXML_FTP_ENABLED)
11486 void * ctx; /* an FTP context */
11489 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11490 mem_base = xmlMemBlocks();
11491 ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11493 ret_val = xmlNanoFTPCheckResponse(ctx);
11494 desret_int(ret_val);
11496 des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11497 xmlResetLastError();
11498 if (mem_base != xmlMemBlocks()) {
11499 printf("Leak of %d blocks found in xmlNanoFTPCheckResponse",
11500 xmlMemBlocks() - mem_base);
11502 printf(" %d", n_ctx);
11514 test_xmlNanoFTPCleanup(void) {
11517 #if defined(LIBXML_FTP_ENABLED)
11520 mem_base = xmlMemBlocks();
11522 xmlNanoFTPCleanup();
11524 xmlResetLastError();
11525 if (mem_base != xmlMemBlocks()) {
11526 printf("Leak of %d blocks found in xmlNanoFTPCleanup",
11527 xmlMemBlocks() - mem_base);
11539 test_xmlNanoFTPCloseConnection(void) {
11542 #if defined(LIBXML_FTP_ENABLED)
11545 void * ctx; /* an FTP context */
11548 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11549 mem_base = xmlMemBlocks();
11550 ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11552 ret_val = xmlNanoFTPCloseConnection(ctx);
11553 desret_int(ret_val);
11555 des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11556 xmlResetLastError();
11557 if (mem_base != xmlMemBlocks()) {
11558 printf("Leak of %d blocks found in xmlNanoFTPCloseConnection",
11559 xmlMemBlocks() - mem_base);
11561 printf(" %d", n_ctx);
11573 test_xmlNanoFTPCwd(void) {
11576 #if defined(LIBXML_FTP_ENABLED)
11579 void * ctx; /* an FTP context */
11581 char * directory; /* a directory on the server */
11584 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11585 for (n_directory = 0;n_directory < gen_nb_const_char_ptr;n_directory++) {
11586 mem_base = xmlMemBlocks();
11587 ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11588 directory = gen_const_char_ptr(n_directory, 1);
11590 ret_val = xmlNanoFTPCwd(ctx, (const char *)directory);
11591 desret_int(ret_val);
11593 des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11594 des_const_char_ptr(n_directory, (const char *)directory, 1);
11595 xmlResetLastError();
11596 if (mem_base != xmlMemBlocks()) {
11597 printf("Leak of %d blocks found in xmlNanoFTPCwd",
11598 xmlMemBlocks() - mem_base);
11600 printf(" %d", n_ctx);
11601 printf(" %d", n_directory);
11614 test_xmlNanoFTPDele(void) {
11617 #if defined(LIBXML_FTP_ENABLED)
11620 void * ctx; /* an FTP context */
11622 const char * file; /* a file or directory on the server */
11625 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11626 for (n_file = 0;n_file < gen_nb_filepath;n_file++) {
11627 mem_base = xmlMemBlocks();
11628 ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11629 file = gen_filepath(n_file, 1);
11631 ret_val = xmlNanoFTPDele(ctx, file);
11632 desret_int(ret_val);
11634 des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11635 des_filepath(n_file, file, 1);
11636 xmlResetLastError();
11637 if (mem_base != xmlMemBlocks()) {
11638 printf("Leak of %d blocks found in xmlNanoFTPDele",
11639 xmlMemBlocks() - mem_base);
11641 printf(" %d", n_ctx);
11642 printf(" %d", n_file);
11655 test_xmlNanoFTPGet(void) {
11659 /* missing type support */
11665 test_xmlNanoFTPGetConnection(void) {
11669 /* missing type support */
11675 test_xmlNanoFTPGetResponse(void) {
11678 #if defined(LIBXML_FTP_ENABLED)
11681 void * ctx; /* an FTP context */
11684 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11685 mem_base = xmlMemBlocks();
11686 ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11688 ret_val = xmlNanoFTPGetResponse(ctx);
11689 desret_int(ret_val);
11691 des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11692 xmlResetLastError();
11693 if (mem_base != xmlMemBlocks()) {
11694 printf("Leak of %d blocks found in xmlNanoFTPGetResponse",
11695 xmlMemBlocks() - mem_base);
11697 printf(" %d", n_ctx);
11709 test_xmlNanoFTPGetSocket(void) {
11713 /* missing type support */
11719 test_xmlNanoFTPInit(void) {
11722 #if defined(LIBXML_FTP_ENABLED)
11725 mem_base = xmlMemBlocks();
11729 xmlResetLastError();
11730 if (mem_base != xmlMemBlocks()) {
11731 printf("Leak of %d blocks found in xmlNanoFTPInit",
11732 xmlMemBlocks() - mem_base);
11744 test_xmlNanoFTPList(void) {
11748 /* missing type support */
11754 test_xmlNanoFTPNewCtxt(void) {
11757 #if defined(LIBXML_FTP_ENABLED)
11760 const char * URL; /* The URL used to initialize the context */
11763 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
11764 mem_base = xmlMemBlocks();
11765 URL = gen_filepath(n_URL, 0);
11767 ret_val = xmlNanoFTPNewCtxt(URL);
11768 desret_xmlNanoFTPCtxtPtr(ret_val);
11770 des_filepath(n_URL, URL, 0);
11771 xmlResetLastError();
11772 if (mem_base != xmlMemBlocks()) {
11773 printf("Leak of %d blocks found in xmlNanoFTPNewCtxt",
11774 xmlMemBlocks() - mem_base);
11776 printf(" %d", n_URL);
11788 test_xmlNanoFTPOpen(void) {
11791 #if defined(LIBXML_FTP_ENABLED)
11794 const char * URL; /* the URL to the resource */
11797 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
11798 mem_base = xmlMemBlocks();
11799 URL = gen_filepath(n_URL, 0);
11801 ret_val = xmlNanoFTPOpen(URL);
11802 desret_xmlNanoFTPCtxtPtr(ret_val);
11804 des_filepath(n_URL, URL, 0);
11805 xmlResetLastError();
11806 if (mem_base != xmlMemBlocks()) {
11807 printf("Leak of %d blocks found in xmlNanoFTPOpen",
11808 xmlMemBlocks() - mem_base);
11810 printf(" %d", n_URL);
11822 test_xmlNanoFTPProxy(void) {
11825 #if defined(LIBXML_FTP_ENABLED)
11826 char * host; /* the proxy host name */
11828 int port; /* the proxy port */
11830 char * user; /* the proxy user name */
11832 char * passwd; /* the proxy password */
11834 int type; /* the type of proxy 1 for using SITE, 2 for USER a@b */
11837 for (n_host = 0;n_host < gen_nb_const_char_ptr;n_host++) {
11838 for (n_port = 0;n_port < gen_nb_int;n_port++) {
11839 for (n_user = 0;n_user < gen_nb_const_char_ptr;n_user++) {
11840 for (n_passwd = 0;n_passwd < gen_nb_const_char_ptr;n_passwd++) {
11841 for (n_type = 0;n_type < gen_nb_int;n_type++) {
11842 host = gen_const_char_ptr(n_host, 0);
11843 port = gen_int(n_port, 1);
11844 user = gen_const_char_ptr(n_user, 2);
11845 passwd = gen_const_char_ptr(n_passwd, 3);
11846 type = gen_int(n_type, 4);
11848 xmlNanoFTPProxy((const char *)host, port, (const char *)user, (const char *)passwd, type);
11850 des_const_char_ptr(n_host, (const char *)host, 0);
11851 des_int(n_port, port, 1);
11852 des_const_char_ptr(n_user, (const char *)user, 2);
11853 des_const_char_ptr(n_passwd, (const char *)passwd, 3);
11854 des_int(n_type, type, 4);
11855 xmlResetLastError();
11869 test_xmlNanoFTPQuit(void) {
11872 #if defined(LIBXML_FTP_ENABLED)
11875 void * ctx; /* an FTP context */
11878 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11879 mem_base = xmlMemBlocks();
11880 ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11882 ret_val = xmlNanoFTPQuit(ctx);
11883 desret_int(ret_val);
11885 des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11886 xmlResetLastError();
11887 if (mem_base != xmlMemBlocks()) {
11888 printf("Leak of %d blocks found in xmlNanoFTPQuit",
11889 xmlMemBlocks() - mem_base);
11891 printf(" %d", n_ctx);
11903 test_xmlNanoFTPRead(void) {
11906 #if defined(LIBXML_FTP_ENABLED)
11909 void * ctx; /* the FTP context */
11911 void * dest; /* a buffer */
11913 int len; /* the buffer length */
11916 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11917 for (n_dest = 0;n_dest < gen_nb_void_ptr;n_dest++) {
11918 for (n_len = 0;n_len < gen_nb_int;n_len++) {
11919 mem_base = xmlMemBlocks();
11920 ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11921 dest = gen_void_ptr(n_dest, 1);
11922 len = gen_int(n_len, 2);
11924 ret_val = xmlNanoFTPRead(ctx, dest, len);
11925 desret_int(ret_val);
11927 des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11928 des_void_ptr(n_dest, dest, 1);
11929 des_int(n_len, len, 2);
11930 xmlResetLastError();
11931 if (mem_base != xmlMemBlocks()) {
11932 printf("Leak of %d blocks found in xmlNanoFTPRead",
11933 xmlMemBlocks() - mem_base);
11935 printf(" %d", n_ctx);
11936 printf(" %d", n_dest);
11937 printf(" %d", n_len);
11951 test_xmlNanoFTPScanProxy(void) {
11954 #if defined(LIBXML_FTP_ENABLED)
11955 const char * URL; /* The proxy URL used to initialize the proxy context */
11958 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
11959 URL = gen_filepath(n_URL, 0);
11961 xmlNanoFTPScanProxy(URL);
11963 des_filepath(n_URL, URL, 0);
11964 xmlResetLastError();
11974 test_xmlNanoFTPUpdateURL(void) {
11977 #if defined(LIBXML_FTP_ENABLED)
11980 void * ctx; /* an FTP context */
11982 const char * URL; /* The URL used to update the context */
11985 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11986 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
11987 mem_base = xmlMemBlocks();
11988 ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11989 URL = gen_filepath(n_URL, 1);
11991 ret_val = xmlNanoFTPUpdateURL(ctx, URL);
11992 desret_int(ret_val);
11994 des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11995 des_filepath(n_URL, URL, 1);
11996 xmlResetLastError();
11997 if (mem_base != xmlMemBlocks()) {
11998 printf("Leak of %d blocks found in xmlNanoFTPUpdateURL",
11999 xmlMemBlocks() - mem_base);
12001 printf(" %d", n_ctx);
12002 printf(" %d", n_URL);
12014 test_nanoftp(void) {
12017 if (quiet == 0) printf("Testing nanoftp : 14 of 22 functions ...\n");
12018 test_ret += test_xmlNanoFTPCheckResponse();
12019 test_ret += test_xmlNanoFTPCleanup();
12020 test_ret += test_xmlNanoFTPCloseConnection();
12021 test_ret += test_xmlNanoFTPCwd();
12022 test_ret += test_xmlNanoFTPDele();
12023 test_ret += test_xmlNanoFTPGet();
12024 test_ret += test_xmlNanoFTPGetConnection();
12025 test_ret += test_xmlNanoFTPGetResponse();
12026 test_ret += test_xmlNanoFTPGetSocket();
12027 test_ret += test_xmlNanoFTPInit();
12028 test_ret += test_xmlNanoFTPList();
12029 test_ret += test_xmlNanoFTPNewCtxt();
12030 test_ret += test_xmlNanoFTPOpen();
12031 test_ret += test_xmlNanoFTPProxy();
12032 test_ret += test_xmlNanoFTPQuit();
12033 test_ret += test_xmlNanoFTPRead();
12034 test_ret += test_xmlNanoFTPScanProxy();
12035 test_ret += test_xmlNanoFTPUpdateURL();
12038 printf("Module nanoftp: %d errors\n", test_ret);
12043 test_xmlNanoHTTPAuthHeader(void) {
12046 #if defined(LIBXML_HTTP_ENABLED)
12048 const char * ret_val;
12049 void * ctx; /* the HTTP context */
12052 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12053 mem_base = xmlMemBlocks();
12054 ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12056 ret_val = xmlNanoHTTPAuthHeader(ctx);
12057 desret_const_char_ptr(ret_val);
12059 des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12060 xmlResetLastError();
12061 if (mem_base != xmlMemBlocks()) {
12062 printf("Leak of %d blocks found in xmlNanoHTTPAuthHeader",
12063 xmlMemBlocks() - mem_base);
12065 printf(" %d", n_ctx);
12077 test_xmlNanoHTTPCleanup(void) {
12080 #if defined(LIBXML_HTTP_ENABLED)
12083 mem_base = xmlMemBlocks();
12085 xmlNanoHTTPCleanup();
12087 xmlResetLastError();
12088 if (mem_base != xmlMemBlocks()) {
12089 printf("Leak of %d blocks found in xmlNanoHTTPCleanup",
12090 xmlMemBlocks() - mem_base);
12102 test_xmlNanoHTTPContentLength(void) {
12105 #if defined(LIBXML_HTTP_ENABLED)
12108 void * ctx; /* the HTTP context */
12111 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12112 mem_base = xmlMemBlocks();
12113 ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12115 ret_val = xmlNanoHTTPContentLength(ctx);
12116 desret_int(ret_val);
12118 des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12119 xmlResetLastError();
12120 if (mem_base != xmlMemBlocks()) {
12121 printf("Leak of %d blocks found in xmlNanoHTTPContentLength",
12122 xmlMemBlocks() - mem_base);
12124 printf(" %d", n_ctx);
12136 test_xmlNanoHTTPEncoding(void) {
12139 #if defined(LIBXML_HTTP_ENABLED)
12141 const char * ret_val;
12142 void * ctx; /* the HTTP context */
12145 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12146 mem_base = xmlMemBlocks();
12147 ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12149 ret_val = xmlNanoHTTPEncoding(ctx);
12150 desret_const_char_ptr(ret_val);
12152 des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12153 xmlResetLastError();
12154 if (mem_base != xmlMemBlocks()) {
12155 printf("Leak of %d blocks found in xmlNanoHTTPEncoding",
12156 xmlMemBlocks() - mem_base);
12158 printf(" %d", n_ctx);
12169 #define gen_nb_char_ptr_ptr 1
12170 static char ** gen_char_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
12173 static void des_char_ptr_ptr(int no ATTRIBUTE_UNUSED, char ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
12177 test_xmlNanoHTTPFetch(void) {
12180 #if defined(LIBXML_HTTP_ENABLED)
12183 const char * URL; /* The URL to load */
12185 const char * filename; /* the filename where the content should be saved */
12187 char ** contentType; /* if available the Content-Type information will be returned at that location */
12190 for (n_URL = 0;n_URL < gen_nb_fileoutput;n_URL++) {
12191 for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
12192 for (n_contentType = 0;n_contentType < gen_nb_char_ptr_ptr;n_contentType++) {
12193 mem_base = xmlMemBlocks();
12194 URL = gen_fileoutput(n_URL, 0);
12195 filename = gen_fileoutput(n_filename, 1);
12196 contentType = gen_char_ptr_ptr(n_contentType, 2);
12198 ret_val = xmlNanoHTTPFetch(URL, filename, contentType);
12199 desret_int(ret_val);
12201 des_fileoutput(n_URL, URL, 0);
12202 des_fileoutput(n_filename, filename, 1);
12203 des_char_ptr_ptr(n_contentType, contentType, 2);
12204 xmlResetLastError();
12205 if (mem_base != xmlMemBlocks()) {
12206 printf("Leak of %d blocks found in xmlNanoHTTPFetch",
12207 xmlMemBlocks() - mem_base);
12209 printf(" %d", n_URL);
12210 printf(" %d", n_filename);
12211 printf(" %d", n_contentType);
12225 test_xmlNanoHTTPInit(void) {
12228 #if defined(LIBXML_HTTP_ENABLED)
12231 mem_base = xmlMemBlocks();
12235 xmlResetLastError();
12236 if (mem_base != xmlMemBlocks()) {
12237 printf("Leak of %d blocks found in xmlNanoHTTPInit",
12238 xmlMemBlocks() - mem_base);
12250 test_xmlNanoHTTPMimeType(void) {
12253 #if defined(LIBXML_HTTP_ENABLED)
12255 const char * ret_val;
12256 void * ctx; /* the HTTP context */
12259 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12260 mem_base = xmlMemBlocks();
12261 ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12263 ret_val = xmlNanoHTTPMimeType(ctx);
12264 desret_const_char_ptr(ret_val);
12266 des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12267 xmlResetLastError();
12268 if (mem_base != xmlMemBlocks()) {
12269 printf("Leak of %d blocks found in xmlNanoHTTPMimeType",
12270 xmlMemBlocks() - mem_base);
12272 printf(" %d", n_ctx);
12284 test_xmlNanoHTTPOpen(void) {
12287 #if defined(LIBXML_HTTP_ENABLED)
12290 const char * URL; /* The URL to load */
12292 char ** contentType; /* if available the Content-Type information will be returned at that location */
12295 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12296 for (n_contentType = 0;n_contentType < gen_nb_char_ptr_ptr;n_contentType++) {
12297 mem_base = xmlMemBlocks();
12298 URL = gen_filepath(n_URL, 0);
12299 contentType = gen_char_ptr_ptr(n_contentType, 1);
12301 ret_val = xmlNanoHTTPOpen(URL, contentType);
12302 desret_xmlNanoHTTPCtxtPtr(ret_val);
12304 des_filepath(n_URL, URL, 0);
12305 des_char_ptr_ptr(n_contentType, contentType, 1);
12306 xmlResetLastError();
12307 if (mem_base != xmlMemBlocks()) {
12308 printf("Leak of %d blocks found in xmlNanoHTTPOpen",
12309 xmlMemBlocks() - mem_base);
12311 printf(" %d", n_URL);
12312 printf(" %d", n_contentType);
12325 test_xmlNanoHTTPOpenRedir(void) {
12328 #if defined(LIBXML_HTTP_ENABLED)
12331 const char * URL; /* The URL to load */
12333 char ** contentType; /* if available the Content-Type information will be returned at that location */
12335 char ** redir; /* if available the redirected URL will be returned */
12338 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12339 for (n_contentType = 0;n_contentType < gen_nb_char_ptr_ptr;n_contentType++) {
12340 for (n_redir = 0;n_redir < gen_nb_char_ptr_ptr;n_redir++) {
12341 mem_base = xmlMemBlocks();
12342 URL = gen_filepath(n_URL, 0);
12343 contentType = gen_char_ptr_ptr(n_contentType, 1);
12344 redir = gen_char_ptr_ptr(n_redir, 2);
12346 ret_val = xmlNanoHTTPOpenRedir(URL, contentType, redir);
12347 desret_xmlNanoHTTPCtxtPtr(ret_val);
12349 des_filepath(n_URL, URL, 0);
12350 des_char_ptr_ptr(n_contentType, contentType, 1);
12351 des_char_ptr_ptr(n_redir, redir, 2);
12352 xmlResetLastError();
12353 if (mem_base != xmlMemBlocks()) {
12354 printf("Leak of %d blocks found in xmlNanoHTTPOpenRedir",
12355 xmlMemBlocks() - mem_base);
12357 printf(" %d", n_URL);
12358 printf(" %d", n_contentType);
12359 printf(" %d", n_redir);
12373 test_xmlNanoHTTPRead(void) {
12376 #if defined(LIBXML_HTTP_ENABLED)
12379 void * ctx; /* the HTTP context */
12381 void * dest; /* a buffer */
12383 int len; /* the buffer length */
12386 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12387 for (n_dest = 0;n_dest < gen_nb_void_ptr;n_dest++) {
12388 for (n_len = 0;n_len < gen_nb_int;n_len++) {
12389 mem_base = xmlMemBlocks();
12390 ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12391 dest = gen_void_ptr(n_dest, 1);
12392 len = gen_int(n_len, 2);
12394 ret_val = xmlNanoHTTPRead(ctx, dest, len);
12395 desret_int(ret_val);
12397 des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12398 des_void_ptr(n_dest, dest, 1);
12399 des_int(n_len, len, 2);
12400 xmlResetLastError();
12401 if (mem_base != xmlMemBlocks()) {
12402 printf("Leak of %d blocks found in xmlNanoHTTPRead",
12403 xmlMemBlocks() - mem_base);
12405 printf(" %d", n_ctx);
12406 printf(" %d", n_dest);
12407 printf(" %d", n_len);
12421 test_xmlNanoHTTPRedir(void) {
12425 /* missing type support */
12431 test_xmlNanoHTTPReturnCode(void) {
12434 #if defined(LIBXML_HTTP_ENABLED)
12437 void * ctx; /* the HTTP context */
12440 for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12441 mem_base = xmlMemBlocks();
12442 ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12444 ret_val = xmlNanoHTTPReturnCode(ctx);
12445 desret_int(ret_val);
12447 des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12448 xmlResetLastError();
12449 if (mem_base != xmlMemBlocks()) {
12450 printf("Leak of %d blocks found in xmlNanoHTTPReturnCode",
12451 xmlMemBlocks() - mem_base);
12453 printf(" %d", n_ctx);
12465 test_xmlNanoHTTPSave(void) {
12468 #if defined(LIBXML_HTTP_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
12471 void * ctxt; /* the HTTP context */
12473 const char * filename; /* the filename where the content should be saved */
12476 for (n_ctxt = 0;n_ctxt < gen_nb_void_ptr;n_ctxt++) {
12477 for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
12478 mem_base = xmlMemBlocks();
12479 ctxt = gen_void_ptr(n_ctxt, 0);
12480 filename = gen_fileoutput(n_filename, 1);
12482 ret_val = xmlNanoHTTPSave(ctxt, filename);
12483 desret_int(ret_val);
12485 des_void_ptr(n_ctxt, ctxt, 0);
12486 des_fileoutput(n_filename, filename, 1);
12487 xmlResetLastError();
12488 if (mem_base != xmlMemBlocks()) {
12489 printf("Leak of %d blocks found in xmlNanoHTTPSave",
12490 xmlMemBlocks() - mem_base);
12492 printf(" %d", n_ctxt);
12493 printf(" %d", n_filename);
12506 test_xmlNanoHTTPScanProxy(void) {
12509 #if defined(LIBXML_HTTP_ENABLED)
12510 const char * URL; /* The proxy URL used to initialize the proxy context */
12513 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12514 URL = gen_filepath(n_URL, 0);
12516 xmlNanoHTTPScanProxy(URL);
12518 des_filepath(n_URL, URL, 0);
12519 xmlResetLastError();
12528 test_nanohttp(void) {
12531 if (quiet == 0) printf("Testing nanohttp : 13 of 17 functions ...\n");
12532 test_ret += test_xmlNanoHTTPAuthHeader();
12533 test_ret += test_xmlNanoHTTPCleanup();
12534 test_ret += test_xmlNanoHTTPContentLength();
12535 test_ret += test_xmlNanoHTTPEncoding();
12536 test_ret += test_xmlNanoHTTPFetch();
12537 test_ret += test_xmlNanoHTTPInit();
12538 test_ret += test_xmlNanoHTTPMimeType();
12539 test_ret += test_xmlNanoHTTPOpen();
12540 test_ret += test_xmlNanoHTTPOpenRedir();
12541 test_ret += test_xmlNanoHTTPRead();
12542 test_ret += test_xmlNanoHTTPRedir();
12543 test_ret += test_xmlNanoHTTPReturnCode();
12544 test_ret += test_xmlNanoHTTPSave();
12545 test_ret += test_xmlNanoHTTPScanProxy();
12548 printf("Module nanohttp: %d errors\n", test_ret);
12553 test_xmlByteConsumed(void) {
12558 xmlParserCtxtPtr ctxt; /* an XML parser context */
12561 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12562 mem_base = xmlMemBlocks();
12563 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12565 ret_val = xmlByteConsumed(ctxt);
12566 desret_long(ret_val);
12568 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12569 xmlResetLastError();
12570 if (mem_base != xmlMemBlocks()) {
12571 printf("Leak of %d blocks found in xmlByteConsumed",
12572 xmlMemBlocks() - mem_base);
12574 printf(" %d", n_ctxt);
12585 test_xmlClearNodeInfoSeq(void) {
12589 xmlParserNodeInfoSeqPtr seq; /* a node info sequence pointer */
12592 for (n_seq = 0;n_seq < gen_nb_xmlParserNodeInfoSeqPtr;n_seq++) {
12593 mem_base = xmlMemBlocks();
12594 seq = gen_xmlParserNodeInfoSeqPtr(n_seq, 0);
12596 xmlClearNodeInfoSeq(seq);
12598 des_xmlParserNodeInfoSeqPtr(n_seq, seq, 0);
12599 xmlResetLastError();
12600 if (mem_base != xmlMemBlocks()) {
12601 printf("Leak of %d blocks found in xmlClearNodeInfoSeq",
12602 xmlMemBlocks() - mem_base);
12604 printf(" %d", n_seq);
12615 test_xmlClearParserCtxt(void) {
12619 xmlParserCtxtPtr ctxt; /* an XML parser context */
12622 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12623 mem_base = xmlMemBlocks();
12624 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12626 xmlClearParserCtxt(ctxt);
12628 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12629 xmlResetLastError();
12630 if (mem_base != xmlMemBlocks()) {
12631 printf("Leak of %d blocks found in xmlClearParserCtxt",
12632 xmlMemBlocks() - mem_base);
12634 printf(" %d", n_ctxt);
12645 test_xmlCreateDocParserCtxt(void) {
12649 xmlParserCtxtPtr ret_val;
12650 xmlChar * cur; /* a pointer to an array of xmlChar */
12653 for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
12654 mem_base = xmlMemBlocks();
12655 cur = gen_const_xmlChar_ptr(n_cur, 0);
12657 ret_val = xmlCreateDocParserCtxt((const xmlChar *)cur);
12658 desret_xmlParserCtxtPtr(ret_val);
12660 des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
12661 xmlResetLastError();
12662 if (mem_base != xmlMemBlocks()) {
12663 printf("Leak of %d blocks found in xmlCreateDocParserCtxt",
12664 xmlMemBlocks() - mem_base);
12666 printf(" %d", n_cur);
12677 test_xmlCreatePushParserCtxt(void) {
12680 #if defined(LIBXML_PUSH_ENABLED)
12682 xmlParserCtxtPtr ret_val;
12683 xmlSAXHandlerPtr sax; /* a SAX handler */
12685 void * user_data; /* The user data returned on SAX callbacks */
12687 char * chunk; /* a pointer to an array of chars */
12689 int size; /* number of chars in the array */
12691 const char * filename; /* an optional file name or URI */
12694 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
12695 for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
12696 for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
12697 for (n_size = 0;n_size < gen_nb_int;n_size++) {
12698 for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
12699 mem_base = xmlMemBlocks();
12700 sax = gen_xmlSAXHandlerPtr(n_sax, 0);
12701 user_data = gen_userdata(n_user_data, 1);
12702 chunk = gen_const_char_ptr(n_chunk, 2);
12703 size = gen_int(n_size, 3);
12704 filename = gen_fileoutput(n_filename, 4);
12706 ret_val = xmlCreatePushParserCtxt(sax, user_data, (const char *)chunk, size, filename);
12707 desret_xmlParserCtxtPtr(ret_val);
12709 des_xmlSAXHandlerPtr(n_sax, sax, 0);
12710 des_userdata(n_user_data, user_data, 1);
12711 des_const_char_ptr(n_chunk, (const char *)chunk, 2);
12712 des_int(n_size, size, 3);
12713 des_fileoutput(n_filename, filename, 4);
12714 xmlResetLastError();
12715 if (mem_base != xmlMemBlocks()) {
12716 printf("Leak of %d blocks found in xmlCreatePushParserCtxt",
12717 xmlMemBlocks() - mem_base);
12719 printf(" %d", n_sax);
12720 printf(" %d", n_user_data);
12721 printf(" %d", n_chunk);
12722 printf(" %d", n_size);
12723 printf(" %d", n_filename);
12739 test_xmlCtxtReadDoc(void) {
12744 xmlParserCtxtPtr ctxt; /* an XML parser context */
12746 xmlChar * cur; /* a pointer to a zero terminated string */
12748 const char * URL; /* the base URL to use for the document */
12750 char * encoding; /* the document encoding, or NULL */
12752 int options; /* a combination of xmlParserOption */
12755 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12756 for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
12757 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12758 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
12759 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
12760 mem_base = xmlMemBlocks();
12761 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12762 cur = gen_const_xmlChar_ptr(n_cur, 1);
12763 URL = gen_filepath(n_URL, 2);
12764 encoding = gen_const_char_ptr(n_encoding, 3);
12765 options = gen_parseroptions(n_options, 4);
12767 ret_val = xmlCtxtReadDoc(ctxt, (const xmlChar *)cur, URL, (const char *)encoding, options);
12768 desret_xmlDocPtr(ret_val);
12770 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12771 des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1);
12772 des_filepath(n_URL, URL, 2);
12773 des_const_char_ptr(n_encoding, (const char *)encoding, 3);
12774 des_parseroptions(n_options, options, 4);
12775 xmlResetLastError();
12776 if (mem_base != xmlMemBlocks()) {
12777 printf("Leak of %d blocks found in xmlCtxtReadDoc",
12778 xmlMemBlocks() - mem_base);
12780 printf(" %d", n_ctxt);
12781 printf(" %d", n_cur);
12782 printf(" %d", n_URL);
12783 printf(" %d", n_encoding);
12784 printf(" %d", n_options);
12799 test_xmlCtxtReadFile(void) {
12804 xmlParserCtxtPtr ctxt; /* an XML parser context */
12806 const char * filename; /* a file or URL */
12808 char * encoding; /* the document encoding, or NULL */
12810 int options; /* a combination of xmlParserOption */
12813 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12814 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
12815 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
12816 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
12817 mem_base = xmlMemBlocks();
12818 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12819 filename = gen_filepath(n_filename, 1);
12820 encoding = gen_const_char_ptr(n_encoding, 2);
12821 options = gen_parseroptions(n_options, 3);
12823 ret_val = xmlCtxtReadFile(ctxt, filename, (const char *)encoding, options);
12824 desret_xmlDocPtr(ret_val);
12826 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12827 des_filepath(n_filename, filename, 1);
12828 des_const_char_ptr(n_encoding, (const char *)encoding, 2);
12829 des_parseroptions(n_options, options, 3);
12830 xmlResetLastError();
12831 if (mem_base != xmlMemBlocks()) {
12832 printf("Leak of %d blocks found in xmlCtxtReadFile",
12833 xmlMemBlocks() - mem_base);
12835 printf(" %d", n_ctxt);
12836 printf(" %d", n_filename);
12837 printf(" %d", n_encoding);
12838 printf(" %d", n_options);
12852 test_xmlCtxtReadMemory(void) {
12857 xmlParserCtxtPtr ctxt; /* an XML parser context */
12859 char * buffer; /* a pointer to a char array */
12861 int size; /* the size of the array */
12863 const char * URL; /* the base URL to use for the document */
12865 char * encoding; /* the document encoding, or NULL */
12867 int options; /* a combination of xmlParserOption */
12870 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12871 for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
12872 for (n_size = 0;n_size < gen_nb_int;n_size++) {
12873 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12874 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
12875 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
12876 mem_base = xmlMemBlocks();
12877 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12878 buffer = gen_const_char_ptr(n_buffer, 1);
12879 size = gen_int(n_size, 2);
12880 URL = gen_filepath(n_URL, 3);
12881 encoding = gen_const_char_ptr(n_encoding, 4);
12882 options = gen_parseroptions(n_options, 5);
12884 ret_val = xmlCtxtReadMemory(ctxt, (const char *)buffer, size, URL, (const char *)encoding, options);
12885 desret_xmlDocPtr(ret_val);
12887 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12888 des_const_char_ptr(n_buffer, (const char *)buffer, 1);
12889 des_int(n_size, size, 2);
12890 des_filepath(n_URL, URL, 3);
12891 des_const_char_ptr(n_encoding, (const char *)encoding, 4);
12892 des_parseroptions(n_options, options, 5);
12893 xmlResetLastError();
12894 if (mem_base != xmlMemBlocks()) {
12895 printf("Leak of %d blocks found in xmlCtxtReadMemory",
12896 xmlMemBlocks() - mem_base);
12898 printf(" %d", n_ctxt);
12899 printf(" %d", n_buffer);
12900 printf(" %d", n_size);
12901 printf(" %d", n_URL);
12902 printf(" %d", n_encoding);
12903 printf(" %d", n_options);
12919 test_xmlCtxtReset(void) {
12923 xmlParserCtxtPtr ctxt; /* an XML parser context */
12926 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12927 mem_base = xmlMemBlocks();
12928 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12930 xmlCtxtReset(ctxt);
12932 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12933 xmlResetLastError();
12934 if (mem_base != xmlMemBlocks()) {
12935 printf("Leak of %d blocks found in xmlCtxtReset",
12936 xmlMemBlocks() - mem_base);
12938 printf(" %d", n_ctxt);
12949 test_xmlCtxtResetPush(void) {
12954 xmlParserCtxtPtr ctxt; /* an XML parser context */
12956 char * chunk; /* a pointer to an array of chars */
12958 int size; /* number of chars in the array */
12960 const char * filename; /* an optional file name or URI */
12962 char * encoding; /* the document encoding, or NULL */
12965 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12966 for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
12967 for (n_size = 0;n_size < gen_nb_int;n_size++) {
12968 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
12969 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
12970 mem_base = xmlMemBlocks();
12971 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12972 chunk = gen_const_char_ptr(n_chunk, 1);
12973 size = gen_int(n_size, 2);
12974 filename = gen_filepath(n_filename, 3);
12975 encoding = gen_const_char_ptr(n_encoding, 4);
12977 ret_val = xmlCtxtResetPush(ctxt, (const char *)chunk, size, filename, (const char *)encoding);
12978 desret_int(ret_val);
12980 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12981 des_const_char_ptr(n_chunk, (const char *)chunk, 1);
12982 des_int(n_size, size, 2);
12983 des_filepath(n_filename, filename, 3);
12984 des_const_char_ptr(n_encoding, (const char *)encoding, 4);
12985 xmlResetLastError();
12986 if (mem_base != xmlMemBlocks()) {
12987 printf("Leak of %d blocks found in xmlCtxtResetPush",
12988 xmlMemBlocks() - mem_base);
12990 printf(" %d", n_ctxt);
12991 printf(" %d", n_chunk);
12992 printf(" %d", n_size);
12993 printf(" %d", n_filename);
12994 printf(" %d", n_encoding);
13009 test_xmlCtxtUseOptions(void) {
13014 xmlParserCtxtPtr ctxt; /* an XML parser context */
13016 int options; /* a combination of xmlParserOption */
13019 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13020 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
13021 mem_base = xmlMemBlocks();
13022 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13023 options = gen_parseroptions(n_options, 1);
13025 ret_val = xmlCtxtUseOptions(ctxt, options);
13026 desret_int(ret_val);
13028 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13029 des_parseroptions(n_options, options, 1);
13030 xmlResetLastError();
13031 if (mem_base != xmlMemBlocks()) {
13032 printf("Leak of %d blocks found in xmlCtxtUseOptions",
13033 xmlMemBlocks() - mem_base);
13035 printf(" %d", n_ctxt);
13036 printf(" %d", n_options);
13048 test_xmlGetExternalEntityLoader(void) {
13052 /* missing type support */
13058 test_xmlGetFeature(void) {
13061 #if defined(LIBXML_LEGACY_ENABLED)
13062 #ifdef LIBXML_LEGACY_ENABLED
13065 xmlParserCtxtPtr ctxt; /* an XML/HTML parser context */
13067 char * name; /* the feature name */
13069 void * result; /* location to store the result */
13072 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13073 for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
13074 for (n_result = 0;n_result < gen_nb_void_ptr;n_result++) {
13075 mem_base = xmlMemBlocks();
13076 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13077 name = gen_const_char_ptr(n_name, 1);
13078 result = gen_void_ptr(n_result, 2);
13080 ret_val = xmlGetFeature(ctxt, (const char *)name, result);
13081 desret_int(ret_val);
13083 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13084 des_const_char_ptr(n_name, (const char *)name, 1);
13085 des_void_ptr(n_result, result, 2);
13086 xmlResetLastError();
13087 if (mem_base != xmlMemBlocks()) {
13088 printf("Leak of %d blocks found in xmlGetFeature",
13089 xmlMemBlocks() - mem_base);
13091 printf(" %d", n_ctxt);
13092 printf(" %d", n_name);
13093 printf(" %d", n_result);
13107 #define gen_nb_const_char_ptr_ptr 1
13108 static char ** gen_const_char_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
13111 static void des_const_char_ptr_ptr(int no ATTRIBUTE_UNUSED, const char ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
13115 test_xmlGetFeaturesList(void) {
13118 #if defined(LIBXML_LEGACY_ENABLED)
13119 #ifdef LIBXML_LEGACY_ENABLED
13122 int * len; /* the length of the features name array (input/output) */
13124 char ** result; /* an array of string to be filled with the features name. */
13127 for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
13128 for (n_result = 0;n_result < gen_nb_const_char_ptr_ptr;n_result++) {
13129 mem_base = xmlMemBlocks();
13130 len = gen_int_ptr(n_len, 0);
13131 result = gen_const_char_ptr_ptr(n_result, 1);
13133 ret_val = xmlGetFeaturesList(len, (const char **)result);
13134 desret_int(ret_val);
13136 des_int_ptr(n_len, len, 0);
13137 des_const_char_ptr_ptr(n_result, (const char **)result, 1);
13138 xmlResetLastError();
13139 if (mem_base != xmlMemBlocks()) {
13140 printf("Leak of %d blocks found in xmlGetFeaturesList",
13141 xmlMemBlocks() - mem_base);
13143 printf(" %d", n_len);
13144 printf(" %d", n_result);
13158 test_xmlHasFeature(void) {
13163 xmlFeature feature; /* the feature to be examined */
13166 for (n_feature = 0;n_feature < gen_nb_xmlFeature;n_feature++) {
13167 mem_base = xmlMemBlocks();
13168 feature = gen_xmlFeature(n_feature, 0);
13170 ret_val = xmlHasFeature(feature);
13171 desret_int(ret_val);
13173 des_xmlFeature(n_feature, feature, 0);
13174 xmlResetLastError();
13175 if (mem_base != xmlMemBlocks()) {
13176 printf("Leak of %d blocks found in xmlHasFeature",
13177 xmlMemBlocks() - mem_base);
13179 printf(" %d", n_feature);
13190 test_xmlIOParseDTD(void) {
13193 #if defined(LIBXML_VALID_ENABLED)
13194 #ifdef LIBXML_VALID_ENABLED
13196 xmlSAXHandlerPtr sax; /* the SAX handler block or NULL */
13198 xmlParserInputBufferPtr input; /* an Input Buffer */
13200 xmlCharEncoding enc; /* the charset encoding if known */
13203 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
13204 for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
13205 for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
13206 sax = gen_xmlSAXHandlerPtr(n_sax, 0);
13207 input = gen_xmlParserInputBufferPtr(n_input, 1);
13208 enc = gen_xmlCharEncoding(n_enc, 2);
13210 ret_val = xmlIOParseDTD(sax, input, enc);
13212 desret_xmlDtdPtr(ret_val);
13214 des_xmlSAXHandlerPtr(n_sax, sax, 0);
13215 des_xmlParserInputBufferPtr(n_input, input, 1);
13216 des_xmlCharEncoding(n_enc, enc, 2);
13217 xmlResetLastError();
13230 test_xmlInitNodeInfoSeq(void) {
13234 xmlParserNodeInfoSeqPtr seq; /* a node info sequence pointer */
13237 for (n_seq = 0;n_seq < gen_nb_xmlParserNodeInfoSeqPtr;n_seq++) {
13238 mem_base = xmlMemBlocks();
13239 seq = gen_xmlParserNodeInfoSeqPtr(n_seq, 0);
13241 xmlInitNodeInfoSeq(seq);
13243 des_xmlParserNodeInfoSeqPtr(n_seq, seq, 0);
13244 xmlResetLastError();
13245 if (mem_base != xmlMemBlocks()) {
13246 printf("Leak of %d blocks found in xmlInitNodeInfoSeq",
13247 xmlMemBlocks() - mem_base);
13249 printf(" %d", n_seq);
13260 test_xmlInitParser(void) {
13265 mem_base = xmlMemBlocks();
13269 xmlResetLastError();
13270 if (mem_base != xmlMemBlocks()) {
13271 printf("Leak of %d blocks found in xmlInitParser",
13272 xmlMemBlocks() - mem_base);
13283 test_xmlInitParserCtxt(void) {
13288 xmlParserCtxtPtr ctxt; /* an XML parser context */
13291 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13292 mem_base = xmlMemBlocks();
13293 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13295 ret_val = xmlInitParserCtxt(ctxt);
13296 desret_int(ret_val);
13298 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13299 xmlResetLastError();
13300 if (mem_base != xmlMemBlocks()) {
13301 printf("Leak of %d blocks found in xmlInitParserCtxt",
13302 xmlMemBlocks() - mem_base);
13304 printf(" %d", n_ctxt);
13315 test_xmlKeepBlanksDefault(void) {
13320 int val; /* int 0 or 1 */
13323 for (n_val = 0;n_val < gen_nb_int;n_val++) {
13324 mem_base = xmlMemBlocks();
13325 val = gen_int(n_val, 0);
13327 ret_val = xmlKeepBlanksDefault(val);
13328 desret_int(ret_val);
13330 des_int(n_val, val, 0);
13331 xmlResetLastError();
13332 if (mem_base != xmlMemBlocks()) {
13333 printf("Leak of %d blocks found in xmlKeepBlanksDefault",
13334 xmlMemBlocks() - mem_base);
13336 printf(" %d", n_val);
13347 test_xmlLineNumbersDefault(void) {
13352 int val; /* int 0 or 1 */
13355 for (n_val = 0;n_val < gen_nb_int;n_val++) {
13356 mem_base = xmlMemBlocks();
13357 val = gen_int(n_val, 0);
13359 ret_val = xmlLineNumbersDefault(val);
13360 desret_int(ret_val);
13362 des_int(n_val, val, 0);
13363 xmlResetLastError();
13364 if (mem_base != xmlMemBlocks()) {
13365 printf("Leak of %d blocks found in xmlLineNumbersDefault",
13366 xmlMemBlocks() - mem_base);
13368 printf(" %d", n_val);
13379 test_xmlLoadExternalEntity(void) {
13383 xmlParserInputPtr ret_val;
13384 const char * URL; /* the URL for the entity to load */
13386 char * ID; /* the Public ID for the entity to load */
13388 xmlParserCtxtPtr ctxt; /* the context in which the entity is called or NULL */
13391 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
13392 for (n_ID = 0;n_ID < gen_nb_const_char_ptr;n_ID++) {
13393 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13394 mem_base = xmlMemBlocks();
13395 URL = gen_filepath(n_URL, 0);
13396 ID = gen_const_char_ptr(n_ID, 1);
13397 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 2);
13399 ret_val = xmlLoadExternalEntity(URL, (const char *)ID, ctxt);
13400 desret_xmlParserInputPtr(ret_val);
13402 des_filepath(n_URL, URL, 0);
13403 des_const_char_ptr(n_ID, (const char *)ID, 1);
13404 des_xmlParserCtxtPtr(n_ctxt, ctxt, 2);
13405 xmlResetLastError();
13406 if (mem_base != xmlMemBlocks()) {
13407 printf("Leak of %d blocks found in xmlLoadExternalEntity",
13408 xmlMemBlocks() - mem_base);
13410 printf(" %d", n_URL);
13411 printf(" %d", n_ID);
13412 printf(" %d", n_ctxt);
13425 test_xmlNewIOInputStream(void) {
13429 xmlParserInputPtr ret_val;
13430 xmlParserCtxtPtr ctxt; /* an XML parser context */
13432 xmlParserInputBufferPtr input; /* an I/O Input */
13434 xmlCharEncoding enc; /* the charset encoding if known */
13437 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13438 for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
13439 for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
13440 mem_base = xmlMemBlocks();
13441 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13442 input = gen_xmlParserInputBufferPtr(n_input, 1);
13443 enc = gen_xmlCharEncoding(n_enc, 2);
13445 ret_val = xmlNewIOInputStream(ctxt, input, enc);
13446 if (ret_val != NULL) input = NULL;
13447 desret_xmlParserInputPtr(ret_val);
13449 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13450 des_xmlParserInputBufferPtr(n_input, input, 1);
13451 des_xmlCharEncoding(n_enc, enc, 2);
13452 xmlResetLastError();
13453 if (mem_base != xmlMemBlocks()) {
13454 printf("Leak of %d blocks found in xmlNewIOInputStream",
13455 xmlMemBlocks() - mem_base);
13457 printf(" %d", n_ctxt);
13458 printf(" %d", n_input);
13459 printf(" %d", n_enc);
13472 test_xmlNewParserCtxt(void) {
13476 xmlParserCtxtPtr ret_val;
13478 mem_base = xmlMemBlocks();
13480 ret_val = xmlNewParserCtxt();
13481 desret_xmlParserCtxtPtr(ret_val);
13483 xmlResetLastError();
13484 if (mem_base != xmlMemBlocks()) {
13485 printf("Leak of %d blocks found in xmlNewParserCtxt",
13486 xmlMemBlocks() - mem_base);
13496 #define gen_nb_xmlNodePtr_ptr 1
13497 static xmlNodePtr * gen_xmlNodePtr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
13500 static void des_xmlNodePtr_ptr(int no ATTRIBUTE_UNUSED, xmlNodePtr * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
13504 test_xmlParseBalancedChunkMemory(void) {
13507 #if defined(LIBXML_SAX1_ENABLED)
13508 #ifdef LIBXML_SAX1_ENABLED
13511 xmlDocPtr doc; /* the document the chunk pertains to */
13513 xmlSAXHandlerPtr sax; /* the SAX handler bloc (possibly NULL) */
13515 void * user_data; /* The user data returned on SAX callbacks (possibly NULL) */
13517 int depth; /* Used for loop detection, use 0 */
13519 xmlChar * string; /* the input string in UTF8 or ISO-Latin (zero terminated) */
13521 xmlNodePtr * lst; /* the return value for the set of parsed nodes */
13524 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
13525 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
13526 for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
13527 for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
13528 for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
13529 for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
13530 mem_base = xmlMemBlocks();
13531 doc = gen_xmlDocPtr(n_doc, 0);
13532 sax = gen_xmlSAXHandlerPtr(n_sax, 1);
13533 user_data = gen_userdata(n_user_data, 2);
13534 depth = gen_int(n_depth, 3);
13535 string = gen_const_xmlChar_ptr(n_string, 4);
13536 lst = gen_xmlNodePtr_ptr(n_lst, 5);
13538 #ifdef LIBXML_SAX1_ENABLED
13539 if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL;
13543 ret_val = xmlParseBalancedChunkMemory(doc, sax, user_data, depth, (const xmlChar *)string, lst);
13544 desret_int(ret_val);
13546 des_xmlDocPtr(n_doc, doc, 0);
13547 des_xmlSAXHandlerPtr(n_sax, sax, 1);
13548 des_userdata(n_user_data, user_data, 2);
13549 des_int(n_depth, depth, 3);
13550 des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 4);
13551 des_xmlNodePtr_ptr(n_lst, lst, 5);
13552 xmlResetLastError();
13553 if (mem_base != xmlMemBlocks()) {
13554 printf("Leak of %d blocks found in xmlParseBalancedChunkMemory",
13555 xmlMemBlocks() - mem_base);
13557 printf(" %d", n_doc);
13558 printf(" %d", n_sax);
13559 printf(" %d", n_user_data);
13560 printf(" %d", n_depth);
13561 printf(" %d", n_string);
13562 printf(" %d", n_lst);
13580 test_xmlParseBalancedChunkMemoryRecover(void) {
13583 #if defined(LIBXML_SAX1_ENABLED)
13584 #ifdef LIBXML_SAX1_ENABLED
13587 xmlDocPtr doc; /* the document the chunk pertains to */
13589 xmlSAXHandlerPtr sax; /* the SAX handler bloc (possibly NULL) */
13591 void * user_data; /* The user data returned on SAX callbacks (possibly NULL) */
13593 int depth; /* Used for loop detection, use 0 */
13595 xmlChar * string; /* the input string in UTF8 or ISO-Latin (zero terminated) */
13597 xmlNodePtr * lst; /* the return value for the set of parsed nodes */
13599 int recover; /* return nodes even if the data is broken (use 0) */
13602 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
13603 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
13604 for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
13605 for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
13606 for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
13607 for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
13608 for (n_recover = 0;n_recover < gen_nb_int;n_recover++) {
13609 mem_base = xmlMemBlocks();
13610 doc = gen_xmlDocPtr(n_doc, 0);
13611 sax = gen_xmlSAXHandlerPtr(n_sax, 1);
13612 user_data = gen_userdata(n_user_data, 2);
13613 depth = gen_int(n_depth, 3);
13614 string = gen_const_xmlChar_ptr(n_string, 4);
13615 lst = gen_xmlNodePtr_ptr(n_lst, 5);
13616 recover = gen_int(n_recover, 6);
13618 #ifdef LIBXML_SAX1_ENABLED
13619 if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL;
13623 ret_val = xmlParseBalancedChunkMemoryRecover(doc, sax, user_data, depth, (const xmlChar *)string, lst, recover);
13624 desret_int(ret_val);
13626 des_xmlDocPtr(n_doc, doc, 0);
13627 des_xmlSAXHandlerPtr(n_sax, sax, 1);
13628 des_userdata(n_user_data, user_data, 2);
13629 des_int(n_depth, depth, 3);
13630 des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 4);
13631 des_xmlNodePtr_ptr(n_lst, lst, 5);
13632 des_int(n_recover, recover, 6);
13633 xmlResetLastError();
13634 if (mem_base != xmlMemBlocks()) {
13635 printf("Leak of %d blocks found in xmlParseBalancedChunkMemoryRecover",
13636 xmlMemBlocks() - mem_base);
13638 printf(" %d", n_doc);
13639 printf(" %d", n_sax);
13640 printf(" %d", n_user_data);
13641 printf(" %d", n_depth);
13642 printf(" %d", n_string);
13643 printf(" %d", n_lst);
13644 printf(" %d", n_recover);
13663 test_xmlParseChunk(void) {
13666 #if defined(LIBXML_PUSH_ENABLED)
13669 xmlParserCtxtPtr ctxt; /* an XML parser context */
13671 char * chunk; /* an char array */
13673 int size; /* the size in byte of the chunk */
13675 int terminate; /* last chunk indicator */
13678 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13679 for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
13680 for (n_size = 0;n_size < gen_nb_int;n_size++) {
13681 for (n_terminate = 0;n_terminate < gen_nb_int;n_terminate++) {
13682 mem_base = xmlMemBlocks();
13683 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13684 chunk = gen_const_char_ptr(n_chunk, 1);
13685 size = gen_int(n_size, 2);
13686 terminate = gen_int(n_terminate, 3);
13688 ret_val = xmlParseChunk(ctxt, (const char *)chunk, size, terminate);
13689 if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}
13690 desret_int(ret_val);
13692 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13693 des_const_char_ptr(n_chunk, (const char *)chunk, 1);
13694 des_int(n_size, size, 2);
13695 des_int(n_terminate, terminate, 3);
13696 xmlResetLastError();
13697 if (mem_base != xmlMemBlocks()) {
13698 printf("Leak of %d blocks found in xmlParseChunk",
13699 xmlMemBlocks() - mem_base);
13701 printf(" %d", n_ctxt);
13702 printf(" %d", n_chunk);
13703 printf(" %d", n_size);
13704 printf(" %d", n_terminate);
13719 test_xmlParseCtxtExternalEntity(void) {
13724 xmlParserCtxtPtr ctx; /* the existing parsing context */
13726 xmlChar * URL; /* the URL for the entity to load */
13728 xmlChar * ID; /* the System ID for the entity to load */
13730 xmlNodePtr * lst; /* the return value for the set of parsed nodes */
13733 for (n_ctx = 0;n_ctx < gen_nb_xmlParserCtxtPtr;n_ctx++) {
13734 for (n_URL = 0;n_URL < gen_nb_const_xmlChar_ptr;n_URL++) {
13735 for (n_ID = 0;n_ID < gen_nb_const_xmlChar_ptr;n_ID++) {
13736 for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
13737 mem_base = xmlMemBlocks();
13738 ctx = gen_xmlParserCtxtPtr(n_ctx, 0);
13739 URL = gen_const_xmlChar_ptr(n_URL, 1);
13740 ID = gen_const_xmlChar_ptr(n_ID, 2);
13741 lst = gen_xmlNodePtr_ptr(n_lst, 3);
13743 ret_val = xmlParseCtxtExternalEntity(ctx, (const xmlChar *)URL, (const xmlChar *)ID, lst);
13744 desret_int(ret_val);
13746 des_xmlParserCtxtPtr(n_ctx, ctx, 0);
13747 des_const_xmlChar_ptr(n_URL, (const xmlChar *)URL, 1);
13748 des_const_xmlChar_ptr(n_ID, (const xmlChar *)ID, 2);
13749 des_xmlNodePtr_ptr(n_lst, lst, 3);
13750 xmlResetLastError();
13751 if (mem_base != xmlMemBlocks()) {
13752 printf("Leak of %d blocks found in xmlParseCtxtExternalEntity",
13753 xmlMemBlocks() - mem_base);
13755 printf(" %d", n_ctx);
13756 printf(" %d", n_URL);
13757 printf(" %d", n_ID);
13758 printf(" %d", n_lst);
13772 test_xmlParseDTD(void) {
13775 #if defined(LIBXML_VALID_ENABLED)
13776 #ifdef LIBXML_VALID_ENABLED
13779 xmlChar * ExternalID; /* a NAME* containing the External ID of the DTD */
13781 xmlChar * SystemID; /* a NAME* containing the URL to the DTD */
13784 for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
13785 for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
13786 mem_base = xmlMemBlocks();
13787 ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 0);
13788 SystemID = gen_const_xmlChar_ptr(n_SystemID, 1);
13790 ret_val = xmlParseDTD((const xmlChar *)ExternalID, (const xmlChar *)SystemID);
13791 desret_xmlDtdPtr(ret_val);
13793 des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 0);
13794 des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 1);
13795 xmlResetLastError();
13796 if (mem_base != xmlMemBlocks()) {
13797 printf("Leak of %d blocks found in xmlParseDTD",
13798 xmlMemBlocks() - mem_base);
13800 printf(" %d", n_ExternalID);
13801 printf(" %d", n_SystemID);
13815 test_xmlParseDoc(void) {
13818 #if defined(LIBXML_SAX1_ENABLED)
13819 #ifdef LIBXML_SAX1_ENABLED
13822 xmlChar * cur; /* a pointer to an array of xmlChar */
13825 for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
13826 mem_base = xmlMemBlocks();
13827 cur = gen_const_xmlChar_ptr(n_cur, 0);
13829 ret_val = xmlParseDoc((const xmlChar *)cur);
13830 desret_xmlDocPtr(ret_val);
13832 des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
13833 xmlResetLastError();
13834 if (mem_base != xmlMemBlocks()) {
13835 printf("Leak of %d blocks found in xmlParseDoc",
13836 xmlMemBlocks() - mem_base);
13838 printf(" %d", n_cur);
13851 test_xmlParseDocument(void) {
13856 xmlParserCtxtPtr ctxt; /* an XML parser context */
13859 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13860 mem_base = xmlMemBlocks();
13861 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13863 ret_val = xmlParseDocument(ctxt);
13864 if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}
13865 desret_int(ret_val);
13867 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13868 xmlResetLastError();
13869 if (mem_base != xmlMemBlocks()) {
13870 printf("Leak of %d blocks found in xmlParseDocument",
13871 xmlMemBlocks() - mem_base);
13873 printf(" %d", n_ctxt);
13884 test_xmlParseEntity(void) {
13887 #if defined(LIBXML_SAX1_ENABLED)
13888 #ifdef LIBXML_SAX1_ENABLED
13891 const char * filename; /* the filename */
13894 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
13895 mem_base = xmlMemBlocks();
13896 filename = gen_filepath(n_filename, 0);
13898 ret_val = xmlParseEntity(filename);
13899 desret_xmlDocPtr(ret_val);
13901 des_filepath(n_filename, filename, 0);
13902 xmlResetLastError();
13903 if (mem_base != xmlMemBlocks()) {
13904 printf("Leak of %d blocks found in xmlParseEntity",
13905 xmlMemBlocks() - mem_base);
13907 printf(" %d", n_filename);
13920 test_xmlParseExtParsedEnt(void) {
13925 xmlParserCtxtPtr ctxt; /* an XML parser context */
13928 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13929 mem_base = xmlMemBlocks();
13930 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13932 ret_val = xmlParseExtParsedEnt(ctxt);
13933 if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}
13934 desret_int(ret_val);
13936 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13937 xmlResetLastError();
13938 if (mem_base != xmlMemBlocks()) {
13939 printf("Leak of %d blocks found in xmlParseExtParsedEnt",
13940 xmlMemBlocks() - mem_base);
13942 printf(" %d", n_ctxt);
13953 test_xmlParseExternalEntity(void) {
13956 #if defined(LIBXML_SAX1_ENABLED)
13957 #ifdef LIBXML_SAX1_ENABLED
13960 xmlDocPtr doc; /* the document the chunk pertains to */
13962 xmlSAXHandlerPtr sax; /* the SAX handler bloc (possibly NULL) */
13964 void * user_data; /* The user data returned on SAX callbacks (possibly NULL) */
13966 int depth; /* Used for loop detection, use 0 */
13968 xmlChar * URL; /* the URL for the entity to load */
13970 xmlChar * ID; /* the System ID for the entity to load */
13972 xmlNodePtr * lst; /* the return value for the set of parsed nodes */
13975 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
13976 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
13977 for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
13978 for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
13979 for (n_URL = 0;n_URL < gen_nb_const_xmlChar_ptr;n_URL++) {
13980 for (n_ID = 0;n_ID < gen_nb_const_xmlChar_ptr;n_ID++) {
13981 for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
13982 mem_base = xmlMemBlocks();
13983 doc = gen_xmlDocPtr(n_doc, 0);
13984 sax = gen_xmlSAXHandlerPtr(n_sax, 1);
13985 user_data = gen_userdata(n_user_data, 2);
13986 depth = gen_int(n_depth, 3);
13987 URL = gen_const_xmlChar_ptr(n_URL, 4);
13988 ID = gen_const_xmlChar_ptr(n_ID, 5);
13989 lst = gen_xmlNodePtr_ptr(n_lst, 6);
13991 ret_val = xmlParseExternalEntity(doc, sax, user_data, depth, (const xmlChar *)URL, (const xmlChar *)ID, lst);
13992 desret_int(ret_val);
13994 des_xmlDocPtr(n_doc, doc, 0);
13995 des_xmlSAXHandlerPtr(n_sax, sax, 1);
13996 des_userdata(n_user_data, user_data, 2);
13997 des_int(n_depth, depth, 3);
13998 des_const_xmlChar_ptr(n_URL, (const xmlChar *)URL, 4);
13999 des_const_xmlChar_ptr(n_ID, (const xmlChar *)ID, 5);
14000 des_xmlNodePtr_ptr(n_lst, lst, 6);
14001 xmlResetLastError();
14002 if (mem_base != xmlMemBlocks()) {
14003 printf("Leak of %d blocks found in xmlParseExternalEntity",
14004 xmlMemBlocks() - mem_base);
14006 printf(" %d", n_doc);
14007 printf(" %d", n_sax);
14008 printf(" %d", n_user_data);
14009 printf(" %d", n_depth);
14010 printf(" %d", n_URL);
14011 printf(" %d", n_ID);
14012 printf(" %d", n_lst);
14031 test_xmlParseFile(void) {
14034 #if defined(LIBXML_SAX1_ENABLED)
14035 #ifdef LIBXML_SAX1_ENABLED
14038 const char * filename; /* the filename */
14041 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14042 mem_base = xmlMemBlocks();
14043 filename = gen_filepath(n_filename, 0);
14045 ret_val = xmlParseFile(filename);
14046 desret_xmlDocPtr(ret_val);
14048 des_filepath(n_filename, filename, 0);
14049 xmlResetLastError();
14050 if (mem_base != xmlMemBlocks()) {
14051 printf("Leak of %d blocks found in xmlParseFile",
14052 xmlMemBlocks() - mem_base);
14054 printf(" %d", n_filename);
14067 test_xmlParseInNodeContext(void) {
14071 xmlParserErrors ret_val;
14072 xmlNodePtr node; /* the context node */
14074 char * data; /* the input string */
14076 int datalen; /* the input string length in bytes */
14078 int options; /* a combination of xmlParserOption */
14080 xmlNodePtr * lst; /* the return value for the set of parsed nodes */
14083 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
14084 for (n_data = 0;n_data < gen_nb_const_char_ptr;n_data++) {
14085 for (n_datalen = 0;n_datalen < gen_nb_int;n_datalen++) {
14086 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
14087 for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
14088 mem_base = xmlMemBlocks();
14089 node = gen_xmlNodePtr(n_node, 0);
14090 data = gen_const_char_ptr(n_data, 1);
14091 datalen = gen_int(n_datalen, 2);
14092 options = gen_parseroptions(n_options, 3);
14093 lst = gen_xmlNodePtr_ptr(n_lst, 4);
14095 ret_val = xmlParseInNodeContext(node, (const char *)data, datalen, options, lst);
14096 desret_xmlParserErrors(ret_val);
14098 des_xmlNodePtr(n_node, node, 0);
14099 des_const_char_ptr(n_data, (const char *)data, 1);
14100 des_int(n_datalen, datalen, 2);
14101 des_parseroptions(n_options, options, 3);
14102 des_xmlNodePtr_ptr(n_lst, lst, 4);
14103 xmlResetLastError();
14104 if (mem_base != xmlMemBlocks()) {
14105 printf("Leak of %d blocks found in xmlParseInNodeContext",
14106 xmlMemBlocks() - mem_base);
14108 printf(" %d", n_node);
14109 printf(" %d", n_data);
14110 printf(" %d", n_datalen);
14111 printf(" %d", n_options);
14112 printf(" %d", n_lst);
14127 test_xmlParseMemory(void) {
14130 #if defined(LIBXML_SAX1_ENABLED)
14131 #ifdef LIBXML_SAX1_ENABLED
14134 char * buffer; /* an pointer to a char array */
14136 int size; /* the size of the array */
14139 for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
14140 for (n_size = 0;n_size < gen_nb_int;n_size++) {
14141 mem_base = xmlMemBlocks();
14142 buffer = gen_const_char_ptr(n_buffer, 0);
14143 size = gen_int(n_size, 1);
14145 ret_val = xmlParseMemory((const char *)buffer, size);
14146 desret_xmlDocPtr(ret_val);
14148 des_const_char_ptr(n_buffer, (const char *)buffer, 0);
14149 des_int(n_size, size, 1);
14150 xmlResetLastError();
14151 if (mem_base != xmlMemBlocks()) {
14152 printf("Leak of %d blocks found in xmlParseMemory",
14153 xmlMemBlocks() - mem_base);
14155 printf(" %d", n_buffer);
14156 printf(" %d", n_size);
14169 #define gen_nb_const_xmlParserNodeInfoPtr 1
14170 static xmlParserNodeInfoPtr gen_const_xmlParserNodeInfoPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14173 static void des_const_xmlParserNodeInfoPtr(int no ATTRIBUTE_UNUSED, const xmlParserNodeInfoPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14177 test_xmlParserAddNodeInfo(void) {
14181 xmlParserCtxtPtr ctxt; /* an XML parser context */
14183 xmlParserNodeInfoPtr info; /* a node info sequence pointer */
14186 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
14187 for (n_info = 0;n_info < gen_nb_const_xmlParserNodeInfoPtr;n_info++) {
14188 mem_base = xmlMemBlocks();
14189 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
14190 info = gen_const_xmlParserNodeInfoPtr(n_info, 1);
14192 xmlParserAddNodeInfo(ctxt, (const xmlParserNodeInfoPtr)info);
14194 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
14195 des_const_xmlParserNodeInfoPtr(n_info, (const xmlParserNodeInfoPtr)info, 1);
14196 xmlResetLastError();
14197 if (mem_base != xmlMemBlocks()) {
14198 printf("Leak of %d blocks found in xmlParserAddNodeInfo",
14199 xmlMemBlocks() - mem_base);
14201 printf(" %d", n_ctxt);
14202 printf(" %d", n_info);
14213 #define gen_nb_const_xmlParserCtxtPtr 1
14214 static xmlParserCtxtPtr gen_const_xmlParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14217 static void des_const_xmlParserCtxtPtr(int no ATTRIBUTE_UNUSED, const xmlParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14220 #define gen_nb_const_xmlNodePtr 1
14221 static xmlNodePtr gen_const_xmlNodePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14224 static void des_const_xmlNodePtr(int no ATTRIBUTE_UNUSED, const xmlNodePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14228 test_xmlParserFindNodeInfo(void) {
14232 const xmlParserNodeInfo * ret_val;
14233 xmlParserCtxtPtr ctx; /* an XML parser context */
14235 xmlNodePtr node; /* an XML node within the tree */
14238 for (n_ctx = 0;n_ctx < gen_nb_const_xmlParserCtxtPtr;n_ctx++) {
14239 for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
14240 mem_base = xmlMemBlocks();
14241 ctx = gen_const_xmlParserCtxtPtr(n_ctx, 0);
14242 node = gen_const_xmlNodePtr(n_node, 1);
14244 ret_val = xmlParserFindNodeInfo((const xmlParserCtxtPtr)ctx, (const xmlNodePtr)node);
14245 desret_const_xmlParserNodeInfo_ptr(ret_val);
14247 des_const_xmlParserCtxtPtr(n_ctx, (const xmlParserCtxtPtr)ctx, 0);
14248 des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 1);
14249 xmlResetLastError();
14250 if (mem_base != xmlMemBlocks()) {
14251 printf("Leak of %d blocks found in xmlParserFindNodeInfo",
14252 xmlMemBlocks() - mem_base);
14254 printf(" %d", n_ctx);
14255 printf(" %d", n_node);
14266 #define gen_nb_const_xmlParserNodeInfoSeqPtr 1
14267 static xmlParserNodeInfoSeqPtr gen_const_xmlParserNodeInfoSeqPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14270 static void des_const_xmlParserNodeInfoSeqPtr(int no ATTRIBUTE_UNUSED, const xmlParserNodeInfoSeqPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14274 test_xmlParserFindNodeInfoIndex(void) {
14278 unsigned long ret_val;
14279 xmlParserNodeInfoSeqPtr seq; /* a node info sequence pointer */
14281 xmlNodePtr node; /* an XML node pointer */
14284 for (n_seq = 0;n_seq < gen_nb_const_xmlParserNodeInfoSeqPtr;n_seq++) {
14285 for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
14286 mem_base = xmlMemBlocks();
14287 seq = gen_const_xmlParserNodeInfoSeqPtr(n_seq, 0);
14288 node = gen_const_xmlNodePtr(n_node, 1);
14290 ret_val = xmlParserFindNodeInfoIndex((const xmlParserNodeInfoSeqPtr)seq, (const xmlNodePtr)node);
14291 desret_unsigned_long(ret_val);
14293 des_const_xmlParserNodeInfoSeqPtr(n_seq, (const xmlParserNodeInfoSeqPtr)seq, 0);
14294 des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 1);
14295 xmlResetLastError();
14296 if (mem_base != xmlMemBlocks()) {
14297 printf("Leak of %d blocks found in xmlParserFindNodeInfoIndex",
14298 xmlMemBlocks() - mem_base);
14300 printf(" %d", n_seq);
14301 printf(" %d", n_node);
14312 #define gen_nb_xmlParserInputPtr 1
14313 static xmlParserInputPtr gen_xmlParserInputPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14316 static void des_xmlParserInputPtr(int no ATTRIBUTE_UNUSED, xmlParserInputPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14320 test_xmlParserInputGrow(void) {
14325 xmlParserInputPtr in; /* an XML parser input */
14327 int len; /* an indicative size for the lookahead */
14330 for (n_in = 0;n_in < gen_nb_xmlParserInputPtr;n_in++) {
14331 for (n_len = 0;n_len < gen_nb_int;n_len++) {
14332 mem_base = xmlMemBlocks();
14333 in = gen_xmlParserInputPtr(n_in, 0);
14334 len = gen_int(n_len, 1);
14336 ret_val = xmlParserInputGrow(in, len);
14337 desret_int(ret_val);
14339 des_xmlParserInputPtr(n_in, in, 0);
14340 des_int(n_len, len, 1);
14341 xmlResetLastError();
14342 if (mem_base != xmlMemBlocks()) {
14343 printf("Leak of %d blocks found in xmlParserInputGrow",
14344 xmlMemBlocks() - mem_base);
14346 printf(" %d", n_in);
14347 printf(" %d", n_len);
14359 test_xmlParserInputRead(void) {
14364 xmlParserInputPtr in; /* an XML parser input */
14366 int len; /* an indicative size for the lookahead */
14369 for (n_in = 0;n_in < gen_nb_xmlParserInputPtr;n_in++) {
14370 for (n_len = 0;n_len < gen_nb_int;n_len++) {
14371 mem_base = xmlMemBlocks();
14372 in = gen_xmlParserInputPtr(n_in, 0);
14373 len = gen_int(n_len, 1);
14375 ret_val = xmlParserInputRead(in, len);
14376 desret_int(ret_val);
14378 des_xmlParserInputPtr(n_in, in, 0);
14379 des_int(n_len, len, 1);
14380 xmlResetLastError();
14381 if (mem_base != xmlMemBlocks()) {
14382 printf("Leak of %d blocks found in xmlParserInputRead",
14383 xmlMemBlocks() - mem_base);
14385 printf(" %d", n_in);
14386 printf(" %d", n_len);
14398 test_xmlPedanticParserDefault(void) {
14403 int val; /* int 0 or 1 */
14406 for (n_val = 0;n_val < gen_nb_int;n_val++) {
14407 mem_base = xmlMemBlocks();
14408 val = gen_int(n_val, 0);
14410 ret_val = xmlPedanticParserDefault(val);
14411 desret_int(ret_val);
14413 des_int(n_val, val, 0);
14414 xmlResetLastError();
14415 if (mem_base != xmlMemBlocks()) {
14416 printf("Leak of %d blocks found in xmlPedanticParserDefault",
14417 xmlMemBlocks() - mem_base);
14419 printf(" %d", n_val);
14430 test_xmlReadDoc(void) {
14435 xmlChar * cur; /* a pointer to a zero terminated string */
14437 const char * URL; /* the base URL to use for the document */
14439 char * encoding; /* the document encoding, or NULL */
14441 int options; /* a combination of xmlParserOption */
14444 for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
14445 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
14446 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
14447 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
14448 mem_base = xmlMemBlocks();
14449 cur = gen_const_xmlChar_ptr(n_cur, 0);
14450 URL = gen_filepath(n_URL, 1);
14451 encoding = gen_const_char_ptr(n_encoding, 2);
14452 options = gen_parseroptions(n_options, 3);
14454 ret_val = xmlReadDoc((const xmlChar *)cur, URL, (const char *)encoding, options);
14455 desret_xmlDocPtr(ret_val);
14457 des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
14458 des_filepath(n_URL, URL, 1);
14459 des_const_char_ptr(n_encoding, (const char *)encoding, 2);
14460 des_parseroptions(n_options, options, 3);
14461 xmlResetLastError();
14462 if (mem_base != xmlMemBlocks()) {
14463 printf("Leak of %d blocks found in xmlReadDoc",
14464 xmlMemBlocks() - mem_base);
14466 printf(" %d", n_cur);
14467 printf(" %d", n_URL);
14468 printf(" %d", n_encoding);
14469 printf(" %d", n_options);
14483 test_xmlReadFile(void) {
14488 const char * filename; /* a file or URL */
14490 char * encoding; /* the document encoding, or NULL */
14492 int options; /* a combination of xmlParserOption */
14495 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14496 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
14497 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
14498 mem_base = xmlMemBlocks();
14499 filename = gen_filepath(n_filename, 0);
14500 encoding = gen_const_char_ptr(n_encoding, 1);
14501 options = gen_parseroptions(n_options, 2);
14503 ret_val = xmlReadFile(filename, (const char *)encoding, options);
14504 desret_xmlDocPtr(ret_val);
14506 des_filepath(n_filename, filename, 0);
14507 des_const_char_ptr(n_encoding, (const char *)encoding, 1);
14508 des_parseroptions(n_options, options, 2);
14509 xmlResetLastError();
14510 if (mem_base != xmlMemBlocks()) {
14511 printf("Leak of %d blocks found in xmlReadFile",
14512 xmlMemBlocks() - mem_base);
14514 printf(" %d", n_filename);
14515 printf(" %d", n_encoding);
14516 printf(" %d", n_options);
14529 test_xmlReadMemory(void) {
14534 char * buffer; /* a pointer to a char array */
14536 int size; /* the size of the array */
14538 const char * URL; /* the base URL to use for the document */
14540 char * encoding; /* the document encoding, or NULL */
14542 int options; /* a combination of xmlParserOption */
14545 for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
14546 for (n_size = 0;n_size < gen_nb_int;n_size++) {
14547 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
14548 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
14549 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
14550 mem_base = xmlMemBlocks();
14551 buffer = gen_const_char_ptr(n_buffer, 0);
14552 size = gen_int(n_size, 1);
14553 URL = gen_filepath(n_URL, 2);
14554 encoding = gen_const_char_ptr(n_encoding, 3);
14555 options = gen_parseroptions(n_options, 4);
14557 ret_val = xmlReadMemory((const char *)buffer, size, URL, (const char *)encoding, options);
14558 desret_xmlDocPtr(ret_val);
14560 des_const_char_ptr(n_buffer, (const char *)buffer, 0);
14561 des_int(n_size, size, 1);
14562 des_filepath(n_URL, URL, 2);
14563 des_const_char_ptr(n_encoding, (const char *)encoding, 3);
14564 des_parseroptions(n_options, options, 4);
14565 xmlResetLastError();
14566 if (mem_base != xmlMemBlocks()) {
14567 printf("Leak of %d blocks found in xmlReadMemory",
14568 xmlMemBlocks() - mem_base);
14570 printf(" %d", n_buffer);
14571 printf(" %d", n_size);
14572 printf(" %d", n_URL);
14573 printf(" %d", n_encoding);
14574 printf(" %d", n_options);
14589 test_xmlRecoverDoc(void) {
14592 #if defined(LIBXML_SAX1_ENABLED)
14593 #ifdef LIBXML_SAX1_ENABLED
14596 xmlChar * cur; /* a pointer to an array of xmlChar */
14599 for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
14600 mem_base = xmlMemBlocks();
14601 cur = gen_const_xmlChar_ptr(n_cur, 0);
14603 ret_val = xmlRecoverDoc((const xmlChar *)cur);
14604 desret_xmlDocPtr(ret_val);
14606 des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
14607 xmlResetLastError();
14608 if (mem_base != xmlMemBlocks()) {
14609 printf("Leak of %d blocks found in xmlRecoverDoc",
14610 xmlMemBlocks() - mem_base);
14612 printf(" %d", n_cur);
14625 test_xmlRecoverFile(void) {
14628 #if defined(LIBXML_SAX1_ENABLED)
14629 #ifdef LIBXML_SAX1_ENABLED
14632 const char * filename; /* the filename */
14635 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14636 mem_base = xmlMemBlocks();
14637 filename = gen_filepath(n_filename, 0);
14639 ret_val = xmlRecoverFile(filename);
14640 desret_xmlDocPtr(ret_val);
14642 des_filepath(n_filename, filename, 0);
14643 xmlResetLastError();
14644 if (mem_base != xmlMemBlocks()) {
14645 printf("Leak of %d blocks found in xmlRecoverFile",
14646 xmlMemBlocks() - mem_base);
14648 printf(" %d", n_filename);
14661 test_xmlRecoverMemory(void) {
14664 #if defined(LIBXML_SAX1_ENABLED)
14665 #ifdef LIBXML_SAX1_ENABLED
14668 char * buffer; /* an pointer to a char array */
14670 int size; /* the size of the array */
14673 for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
14674 for (n_size = 0;n_size < gen_nb_int;n_size++) {
14675 mem_base = xmlMemBlocks();
14676 buffer = gen_const_char_ptr(n_buffer, 0);
14677 size = gen_int(n_size, 1);
14679 ret_val = xmlRecoverMemory((const char *)buffer, size);
14680 desret_xmlDocPtr(ret_val);
14682 des_const_char_ptr(n_buffer, (const char *)buffer, 0);
14683 des_int(n_size, size, 1);
14684 xmlResetLastError();
14685 if (mem_base != xmlMemBlocks()) {
14686 printf("Leak of %d blocks found in xmlRecoverMemory",
14687 xmlMemBlocks() - mem_base);
14689 printf(" %d", n_buffer);
14690 printf(" %d", n_size);
14704 test_xmlSAXParseDTD(void) {
14707 #if defined(LIBXML_VALID_ENABLED)
14708 #ifdef LIBXML_SAX1_ENABLED
14711 xmlSAXHandlerPtr sax; /* the SAX handler block */
14713 xmlChar * ExternalID; /* a NAME* containing the External ID of the DTD */
14715 xmlChar * SystemID; /* a NAME* containing the URL to the DTD */
14718 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14719 for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
14720 for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
14721 mem_base = xmlMemBlocks();
14722 sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14723 ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 1);
14724 SystemID = gen_const_xmlChar_ptr(n_SystemID, 2);
14726 ret_val = xmlSAXParseDTD(sax, (const xmlChar *)ExternalID, (const xmlChar *)SystemID);
14727 desret_xmlDtdPtr(ret_val);
14729 des_xmlSAXHandlerPtr(n_sax, sax, 0);
14730 des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 1);
14731 des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 2);
14732 xmlResetLastError();
14733 if (mem_base != xmlMemBlocks()) {
14734 printf("Leak of %d blocks found in xmlSAXParseDTD",
14735 xmlMemBlocks() - mem_base);
14737 printf(" %d", n_sax);
14738 printf(" %d", n_ExternalID);
14739 printf(" %d", n_SystemID);
14754 test_xmlSAXParseDoc(void) {
14757 #if defined(LIBXML_SAX1_ENABLED)
14758 #ifdef LIBXML_SAX1_ENABLED
14761 xmlSAXHandlerPtr sax; /* the SAX handler block */
14763 xmlChar * cur; /* a pointer to an array of xmlChar */
14765 int recovery; /* work in recovery mode, i.e. tries to read no Well Formed documents */
14768 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14769 for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
14770 for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
14771 mem_base = xmlMemBlocks();
14772 sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14773 cur = gen_const_xmlChar_ptr(n_cur, 1);
14774 recovery = gen_int(n_recovery, 2);
14776 ret_val = xmlSAXParseDoc(sax, (const xmlChar *)cur, recovery);
14777 desret_xmlDocPtr(ret_val);
14779 des_xmlSAXHandlerPtr(n_sax, sax, 0);
14780 des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1);
14781 des_int(n_recovery, recovery, 2);
14782 xmlResetLastError();
14783 if (mem_base != xmlMemBlocks()) {
14784 printf("Leak of %d blocks found in xmlSAXParseDoc",
14785 xmlMemBlocks() - mem_base);
14787 printf(" %d", n_sax);
14788 printf(" %d", n_cur);
14789 printf(" %d", n_recovery);
14804 test_xmlSAXParseEntity(void) {
14807 #if defined(LIBXML_SAX1_ENABLED)
14808 #ifdef LIBXML_SAX1_ENABLED
14811 xmlSAXHandlerPtr sax; /* the SAX handler block */
14813 const char * filename; /* the filename */
14816 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14817 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14818 mem_base = xmlMemBlocks();
14819 sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14820 filename = gen_filepath(n_filename, 1);
14822 ret_val = xmlSAXParseEntity(sax, filename);
14823 desret_xmlDocPtr(ret_val);
14825 des_xmlSAXHandlerPtr(n_sax, sax, 0);
14826 des_filepath(n_filename, filename, 1);
14827 xmlResetLastError();
14828 if (mem_base != xmlMemBlocks()) {
14829 printf("Leak of %d blocks found in xmlSAXParseEntity",
14830 xmlMemBlocks() - mem_base);
14832 printf(" %d", n_sax);
14833 printf(" %d", n_filename);
14847 test_xmlSAXParseFile(void) {
14850 #if defined(LIBXML_SAX1_ENABLED)
14851 #ifdef LIBXML_SAX1_ENABLED
14854 xmlSAXHandlerPtr sax; /* the SAX handler block */
14856 const char * filename; /* the filename */
14858 int recovery; /* work in recovery mode, i.e. tries to read no Well Formed documents */
14861 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14862 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14863 for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
14864 mem_base = xmlMemBlocks();
14865 sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14866 filename = gen_filepath(n_filename, 1);
14867 recovery = gen_int(n_recovery, 2);
14869 ret_val = xmlSAXParseFile(sax, filename, recovery);
14870 desret_xmlDocPtr(ret_val);
14872 des_xmlSAXHandlerPtr(n_sax, sax, 0);
14873 des_filepath(n_filename, filename, 1);
14874 des_int(n_recovery, recovery, 2);
14875 xmlResetLastError();
14876 if (mem_base != xmlMemBlocks()) {
14877 printf("Leak of %d blocks found in xmlSAXParseFile",
14878 xmlMemBlocks() - mem_base);
14880 printf(" %d", n_sax);
14881 printf(" %d", n_filename);
14882 printf(" %d", n_recovery);
14897 test_xmlSAXParseFileWithData(void) {
14900 #if defined(LIBXML_SAX1_ENABLED)
14901 #ifdef LIBXML_SAX1_ENABLED
14904 xmlSAXHandlerPtr sax; /* the SAX handler block */
14906 const char * filename; /* the filename */
14908 int recovery; /* work in recovery mode, i.e. tries to read no Well Formed documents */
14910 void * data; /* the userdata */
14913 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14914 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14915 for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
14916 for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
14917 mem_base = xmlMemBlocks();
14918 sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14919 filename = gen_filepath(n_filename, 1);
14920 recovery = gen_int(n_recovery, 2);
14921 data = gen_userdata(n_data, 3);
14923 ret_val = xmlSAXParseFileWithData(sax, filename, recovery, data);
14924 desret_xmlDocPtr(ret_val);
14926 des_xmlSAXHandlerPtr(n_sax, sax, 0);
14927 des_filepath(n_filename, filename, 1);
14928 des_int(n_recovery, recovery, 2);
14929 des_userdata(n_data, data, 3);
14930 xmlResetLastError();
14931 if (mem_base != xmlMemBlocks()) {
14932 printf("Leak of %d blocks found in xmlSAXParseFileWithData",
14933 xmlMemBlocks() - mem_base);
14935 printf(" %d", n_sax);
14936 printf(" %d", n_filename);
14937 printf(" %d", n_recovery);
14938 printf(" %d", n_data);
14954 test_xmlSAXParseMemory(void) {
14957 #if defined(LIBXML_SAX1_ENABLED)
14958 #ifdef LIBXML_SAX1_ENABLED
14961 xmlSAXHandlerPtr sax; /* the SAX handler block */
14963 char * buffer; /* an pointer to a char array */
14965 int size; /* the size of the array */
14967 int recovery; /* work in recovery mode, i.e. tries to read not Well Formed documents */
14970 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14971 for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
14972 for (n_size = 0;n_size < gen_nb_int;n_size++) {
14973 for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
14974 mem_base = xmlMemBlocks();
14975 sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14976 buffer = gen_const_char_ptr(n_buffer, 1);
14977 size = gen_int(n_size, 2);
14978 recovery = gen_int(n_recovery, 3);
14980 ret_val = xmlSAXParseMemory(sax, (const char *)buffer, size, recovery);
14981 desret_xmlDocPtr(ret_val);
14983 des_xmlSAXHandlerPtr(n_sax, sax, 0);
14984 des_const_char_ptr(n_buffer, (const char *)buffer, 1);
14985 des_int(n_size, size, 2);
14986 des_int(n_recovery, recovery, 3);
14987 xmlResetLastError();
14988 if (mem_base != xmlMemBlocks()) {
14989 printf("Leak of %d blocks found in xmlSAXParseMemory",
14990 xmlMemBlocks() - mem_base);
14992 printf(" %d", n_sax);
14993 printf(" %d", n_buffer);
14994 printf(" %d", n_size);
14995 printf(" %d", n_recovery);
15011 test_xmlSAXParseMemoryWithData(void) {
15014 #if defined(LIBXML_SAX1_ENABLED)
15015 #ifdef LIBXML_SAX1_ENABLED
15018 xmlSAXHandlerPtr sax; /* the SAX handler block */
15020 char * buffer; /* an pointer to a char array */
15022 int size; /* the size of the array */
15024 int recovery; /* work in recovery mode, i.e. tries to read no Well Formed documents */
15026 void * data; /* the userdata */
15029 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
15030 for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
15031 for (n_size = 0;n_size < gen_nb_int;n_size++) {
15032 for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
15033 for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
15034 mem_base = xmlMemBlocks();
15035 sax = gen_xmlSAXHandlerPtr(n_sax, 0);
15036 buffer = gen_const_char_ptr(n_buffer, 1);
15037 size = gen_int(n_size, 2);
15038 recovery = gen_int(n_recovery, 3);
15039 data = gen_userdata(n_data, 4);
15041 ret_val = xmlSAXParseMemoryWithData(sax, (const char *)buffer, size, recovery, data);
15042 desret_xmlDocPtr(ret_val);
15044 des_xmlSAXHandlerPtr(n_sax, sax, 0);
15045 des_const_char_ptr(n_buffer, (const char *)buffer, 1);
15046 des_int(n_size, size, 2);
15047 des_int(n_recovery, recovery, 3);
15048 des_userdata(n_data, data, 4);
15049 xmlResetLastError();
15050 if (mem_base != xmlMemBlocks()) {
15051 printf("Leak of %d blocks found in xmlSAXParseMemoryWithData",
15052 xmlMemBlocks() - mem_base);
15054 printf(" %d", n_sax);
15055 printf(" %d", n_buffer);
15056 printf(" %d", n_size);
15057 printf(" %d", n_recovery);
15058 printf(" %d", n_data);
15075 test_xmlSAXUserParseFile(void) {
15078 #if defined(LIBXML_SAX1_ENABLED)
15079 #ifdef LIBXML_SAX1_ENABLED
15082 xmlSAXHandlerPtr sax; /* a SAX handler */
15084 void * user_data; /* The user data returned on SAX callbacks */
15086 const char * filename; /* a file name */
15089 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
15090 for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
15091 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
15092 mem_base = xmlMemBlocks();
15093 sax = gen_xmlSAXHandlerPtr(n_sax, 0);
15094 user_data = gen_userdata(n_user_data, 1);
15095 filename = gen_filepath(n_filename, 2);
15097 #ifdef LIBXML_SAX1_ENABLED
15098 if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL;
15102 ret_val = xmlSAXUserParseFile(sax, user_data, filename);
15103 desret_int(ret_val);
15105 des_xmlSAXHandlerPtr(n_sax, sax, 0);
15106 des_userdata(n_user_data, user_data, 1);
15107 des_filepath(n_filename, filename, 2);
15108 xmlResetLastError();
15109 if (mem_base != xmlMemBlocks()) {
15110 printf("Leak of %d blocks found in xmlSAXUserParseFile",
15111 xmlMemBlocks() - mem_base);
15113 printf(" %d", n_sax);
15114 printf(" %d", n_user_data);
15115 printf(" %d", n_filename);
15130 test_xmlSAXUserParseMemory(void) {
15133 #if defined(LIBXML_SAX1_ENABLED)
15134 #ifdef LIBXML_SAX1_ENABLED
15137 xmlSAXHandlerPtr sax; /* a SAX handler */
15139 void * user_data; /* The user data returned on SAX callbacks */
15141 char * buffer; /* an in-memory XML document input */
15143 int size; /* the length of the XML document in bytes */
15146 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
15147 for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
15148 for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
15149 for (n_size = 0;n_size < gen_nb_int;n_size++) {
15150 mem_base = xmlMemBlocks();
15151 sax = gen_xmlSAXHandlerPtr(n_sax, 0);
15152 user_data = gen_userdata(n_user_data, 1);
15153 buffer = gen_const_char_ptr(n_buffer, 2);
15154 size = gen_int(n_size, 3);
15156 #ifdef LIBXML_SAX1_ENABLED
15157 if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL;
15161 ret_val = xmlSAXUserParseMemory(sax, user_data, (const char *)buffer, size);
15162 desret_int(ret_val);
15164 des_xmlSAXHandlerPtr(n_sax, sax, 0);
15165 des_userdata(n_user_data, user_data, 1);
15166 des_const_char_ptr(n_buffer, (const char *)buffer, 2);
15167 des_int(n_size, size, 3);
15168 xmlResetLastError();
15169 if (mem_base != xmlMemBlocks()) {
15170 printf("Leak of %d blocks found in xmlSAXUserParseMemory",
15171 xmlMemBlocks() - mem_base);
15173 printf(" %d", n_sax);
15174 printf(" %d", n_user_data);
15175 printf(" %d", n_buffer);
15176 printf(" %d", n_size);
15192 test_xmlSetExternalEntityLoader(void) {
15196 /* missing type support */
15202 test_xmlSetFeature(void) {
15205 #if defined(LIBXML_LEGACY_ENABLED)
15206 #ifdef LIBXML_LEGACY_ENABLED
15209 xmlParserCtxtPtr ctxt; /* an XML/HTML parser context */
15211 char * name; /* the feature name */
15213 void * value; /* pointer to the location of the new value */
15216 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15217 for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
15218 for (n_value = 0;n_value < gen_nb_void_ptr;n_value++) {
15219 mem_base = xmlMemBlocks();
15220 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15221 name = gen_const_char_ptr(n_name, 1);
15222 value = gen_void_ptr(n_value, 2);
15224 ret_val = xmlSetFeature(ctxt, (const char *)name, value);
15225 desret_int(ret_val);
15227 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15228 des_const_char_ptr(n_name, (const char *)name, 1);
15229 des_void_ptr(n_value, value, 2);
15230 xmlResetLastError();
15231 if (mem_base != xmlMemBlocks()) {
15232 printf("Leak of %d blocks found in xmlSetFeature",
15233 xmlMemBlocks() - mem_base);
15235 printf(" %d", n_ctxt);
15236 printf(" %d", n_name);
15237 printf(" %d", n_value);
15252 test_xmlSetupParserForBuffer(void) {
15255 #if defined(LIBXML_SAX1_ENABLED)
15256 #ifdef LIBXML_SAX1_ENABLED
15258 xmlParserCtxtPtr ctxt; /* an XML parser context */
15260 xmlChar * buffer; /* a xmlChar * buffer */
15262 const char * filename; /* a file name */
15265 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15266 for (n_buffer = 0;n_buffer < gen_nb_const_xmlChar_ptr;n_buffer++) {
15267 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
15268 mem_base = xmlMemBlocks();
15269 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15270 buffer = gen_const_xmlChar_ptr(n_buffer, 1);
15271 filename = gen_filepath(n_filename, 2);
15273 xmlSetupParserForBuffer(ctxt, (const xmlChar *)buffer, filename);
15275 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15276 des_const_xmlChar_ptr(n_buffer, (const xmlChar *)buffer, 1);
15277 des_filepath(n_filename, filename, 2);
15278 xmlResetLastError();
15279 if (mem_base != xmlMemBlocks()) {
15280 printf("Leak of %d blocks found in xmlSetupParserForBuffer",
15281 xmlMemBlocks() - mem_base);
15283 printf(" %d", n_ctxt);
15284 printf(" %d", n_buffer);
15285 printf(" %d", n_filename);
15300 test_xmlStopParser(void) {
15303 #ifdef LIBXML_PUSH_ENABLED
15305 xmlParserCtxtPtr ctxt; /* an XML parser context */
15308 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15309 mem_base = xmlMemBlocks();
15310 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15312 xmlStopParser(ctxt);
15314 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15315 xmlResetLastError();
15316 if (mem_base != xmlMemBlocks()) {
15317 printf("Leak of %d blocks found in xmlStopParser",
15318 xmlMemBlocks() - mem_base);
15320 printf(" %d", n_ctxt);
15332 test_xmlSubstituteEntitiesDefault(void) {
15337 int val; /* int 0 or 1 */
15340 for (n_val = 0;n_val < gen_nb_int;n_val++) {
15341 mem_base = xmlMemBlocks();
15342 val = gen_int(n_val, 0);
15344 ret_val = xmlSubstituteEntitiesDefault(val);
15345 desret_int(ret_val);
15347 des_int(n_val, val, 0);
15348 xmlResetLastError();
15349 if (mem_base != xmlMemBlocks()) {
15350 printf("Leak of %d blocks found in xmlSubstituteEntitiesDefault",
15351 xmlMemBlocks() - mem_base);
15353 printf(" %d", n_val);
15363 test_parser(void) {
15366 if (quiet == 0) printf("Testing parser : 61 of 70 functions ...\n");
15367 test_ret += test_xmlByteConsumed();
15368 test_ret += test_xmlClearNodeInfoSeq();
15369 test_ret += test_xmlClearParserCtxt();
15370 test_ret += test_xmlCreateDocParserCtxt();
15371 test_ret += test_xmlCreatePushParserCtxt();
15372 test_ret += test_xmlCtxtReadDoc();
15373 test_ret += test_xmlCtxtReadFile();
15374 test_ret += test_xmlCtxtReadMemory();
15375 test_ret += test_xmlCtxtReset();
15376 test_ret += test_xmlCtxtResetPush();
15377 test_ret += test_xmlCtxtUseOptions();
15378 test_ret += test_xmlGetExternalEntityLoader();
15379 test_ret += test_xmlGetFeature();
15380 test_ret += test_xmlGetFeaturesList();
15381 test_ret += test_xmlHasFeature();
15382 test_ret += test_xmlIOParseDTD();
15383 test_ret += test_xmlInitNodeInfoSeq();
15384 test_ret += test_xmlInitParser();
15385 test_ret += test_xmlInitParserCtxt();
15386 test_ret += test_xmlKeepBlanksDefault();
15387 test_ret += test_xmlLineNumbersDefault();
15388 test_ret += test_xmlLoadExternalEntity();
15389 test_ret += test_xmlNewIOInputStream();
15390 test_ret += test_xmlNewParserCtxt();
15391 test_ret += test_xmlParseBalancedChunkMemory();
15392 test_ret += test_xmlParseBalancedChunkMemoryRecover();
15393 test_ret += test_xmlParseChunk();
15394 test_ret += test_xmlParseCtxtExternalEntity();
15395 test_ret += test_xmlParseDTD();
15396 test_ret += test_xmlParseDoc();
15397 test_ret += test_xmlParseDocument();
15398 test_ret += test_xmlParseEntity();
15399 test_ret += test_xmlParseExtParsedEnt();
15400 test_ret += test_xmlParseExternalEntity();
15401 test_ret += test_xmlParseFile();
15402 test_ret += test_xmlParseInNodeContext();
15403 test_ret += test_xmlParseMemory();
15404 test_ret += test_xmlParserAddNodeInfo();
15405 test_ret += test_xmlParserFindNodeInfo();
15406 test_ret += test_xmlParserFindNodeInfoIndex();
15407 test_ret += test_xmlParserInputGrow();
15408 test_ret += test_xmlParserInputRead();
15409 test_ret += test_xmlPedanticParserDefault();
15410 test_ret += test_xmlReadDoc();
15411 test_ret += test_xmlReadFile();
15412 test_ret += test_xmlReadMemory();
15413 test_ret += test_xmlRecoverDoc();
15414 test_ret += test_xmlRecoverFile();
15415 test_ret += test_xmlRecoverMemory();
15416 test_ret += test_xmlSAXParseDTD();
15417 test_ret += test_xmlSAXParseDoc();
15418 test_ret += test_xmlSAXParseEntity();
15419 test_ret += test_xmlSAXParseFile();
15420 test_ret += test_xmlSAXParseFileWithData();
15421 test_ret += test_xmlSAXParseMemory();
15422 test_ret += test_xmlSAXParseMemoryWithData();
15423 test_ret += test_xmlSAXUserParseFile();
15424 test_ret += test_xmlSAXUserParseMemory();
15425 test_ret += test_xmlSetExternalEntityLoader();
15426 test_ret += test_xmlSetFeature();
15427 test_ret += test_xmlSetupParserForBuffer();
15428 test_ret += test_xmlStopParser();
15429 test_ret += test_xmlSubstituteEntitiesDefault();
15432 printf("Module parser: %d errors\n", test_ret);
15437 test_htmlCreateFileParserCtxt(void) {
15440 #if defined(LIBXML_HTML_ENABLED)
15442 htmlParserCtxtPtr ret_val;
15443 const char * filename; /* the filename */
15445 char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
15448 for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
15449 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
15450 mem_base = xmlMemBlocks();
15451 filename = gen_fileoutput(n_filename, 0);
15452 encoding = gen_const_char_ptr(n_encoding, 1);
15454 ret_val = htmlCreateFileParserCtxt(filename, (const char *)encoding);
15455 desret_htmlParserCtxtPtr(ret_val);
15457 des_fileoutput(n_filename, filename, 0);
15458 des_const_char_ptr(n_encoding, (const char *)encoding, 1);
15459 xmlResetLastError();
15460 if (mem_base != xmlMemBlocks()) {
15461 printf("Leak of %d blocks found in htmlCreateFileParserCtxt",
15462 xmlMemBlocks() - mem_base);
15464 printf(" %d", n_filename);
15465 printf(" %d", n_encoding);
15478 test_htmlInitAutoClose(void) {
15481 #if defined(LIBXML_HTML_ENABLED)
15484 mem_base = xmlMemBlocks();
15486 htmlInitAutoClose();
15488 xmlResetLastError();
15489 if (mem_base != xmlMemBlocks()) {
15490 printf("Leak of %d blocks found in htmlInitAutoClose",
15491 xmlMemBlocks() - mem_base);
15503 test_inputPop(void) {
15507 xmlParserInputPtr ret_val;
15508 xmlParserCtxtPtr ctxt; /* an XML parser context */
15511 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15512 mem_base = xmlMemBlocks();
15513 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15515 ret_val = inputPop(ctxt);
15516 desret_xmlParserInputPtr(ret_val);
15518 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15519 xmlResetLastError();
15520 if (mem_base != xmlMemBlocks()) {
15521 printf("Leak of %d blocks found in inputPop",
15522 xmlMemBlocks() - mem_base);
15524 printf(" %d", n_ctxt);
15535 test_inputPush(void) {
15540 xmlParserCtxtPtr ctxt; /* an XML parser context */
15542 xmlParserInputPtr value; /* the parser input */
15545 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15546 for (n_value = 0;n_value < gen_nb_xmlParserInputPtr;n_value++) {
15547 mem_base = xmlMemBlocks();
15548 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15549 value = gen_xmlParserInputPtr(n_value, 1);
15551 ret_val = inputPush(ctxt, value);
15552 desret_int(ret_val);
15554 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15555 des_xmlParserInputPtr(n_value, value, 1);
15556 xmlResetLastError();
15557 if (mem_base != xmlMemBlocks()) {
15558 printf("Leak of %d blocks found in inputPush",
15559 xmlMemBlocks() - mem_base);
15561 printf(" %d", n_ctxt);
15562 printf(" %d", n_value);
15574 test_namePop(void) {
15578 const xmlChar * ret_val;
15579 xmlParserCtxtPtr ctxt; /* an XML parser context */
15582 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15583 mem_base = xmlMemBlocks();
15584 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15586 ret_val = namePop(ctxt);
15587 desret_const_xmlChar_ptr(ret_val);
15589 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15590 xmlResetLastError();
15591 if (mem_base != xmlMemBlocks()) {
15592 printf("Leak of %d blocks found in namePop",
15593 xmlMemBlocks() - mem_base);
15595 printf(" %d", n_ctxt);
15606 test_namePush(void) {
15611 xmlParserCtxtPtr ctxt; /* an XML parser context */
15613 xmlChar * value; /* the element name */
15616 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15617 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
15618 mem_base = xmlMemBlocks();
15619 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15620 value = gen_const_xmlChar_ptr(n_value, 1);
15622 ret_val = namePush(ctxt, (const xmlChar *)value);
15623 desret_int(ret_val);
15625 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15626 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
15627 xmlResetLastError();
15628 if (mem_base != xmlMemBlocks()) {
15629 printf("Leak of %d blocks found in namePush",
15630 xmlMemBlocks() - mem_base);
15632 printf(" %d", n_ctxt);
15633 printf(" %d", n_value);
15645 test_nodePop(void) {
15649 xmlNodePtr ret_val;
15650 xmlParserCtxtPtr ctxt; /* an XML parser context */
15653 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15654 mem_base = xmlMemBlocks();
15655 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15657 ret_val = nodePop(ctxt);
15658 desret_xmlNodePtr(ret_val);
15660 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15661 xmlResetLastError();
15662 if (mem_base != xmlMemBlocks()) {
15663 printf("Leak of %d blocks found in nodePop",
15664 xmlMemBlocks() - mem_base);
15666 printf(" %d", n_ctxt);
15677 test_nodePush(void) {
15682 xmlParserCtxtPtr ctxt; /* an XML parser context */
15684 xmlNodePtr value; /* the element node */
15687 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15688 for (n_value = 0;n_value < gen_nb_xmlNodePtr;n_value++) {
15689 mem_base = xmlMemBlocks();
15690 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15691 value = gen_xmlNodePtr(n_value, 1);
15693 ret_val = nodePush(ctxt, value);
15694 desret_int(ret_val);
15696 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15697 des_xmlNodePtr(n_value, value, 1);
15698 xmlResetLastError();
15699 if (mem_base != xmlMemBlocks()) {
15700 printf("Leak of %d blocks found in nodePush",
15701 xmlMemBlocks() - mem_base);
15703 printf(" %d", n_ctxt);
15704 printf(" %d", n_value);
15716 test_xmlCheckLanguageID(void) {
15721 xmlChar * lang; /* pointer to the string value */
15724 for (n_lang = 0;n_lang < gen_nb_const_xmlChar_ptr;n_lang++) {
15725 mem_base = xmlMemBlocks();
15726 lang = gen_const_xmlChar_ptr(n_lang, 0);
15728 ret_val = xmlCheckLanguageID((const xmlChar *)lang);
15729 desret_int(ret_val);
15731 des_const_xmlChar_ptr(n_lang, (const xmlChar *)lang, 0);
15732 xmlResetLastError();
15733 if (mem_base != xmlMemBlocks()) {
15734 printf("Leak of %d blocks found in xmlCheckLanguageID",
15735 xmlMemBlocks() - mem_base);
15737 printf(" %d", n_lang);
15748 test_xmlCopyChar(void) {
15753 int len; /* Ignored, compatibility */
15755 xmlChar * out; /* pointer to an array of xmlChar */
15757 int val; /* the char value */
15760 for (n_len = 0;n_len < gen_nb_int;n_len++) {
15761 for (n_out = 0;n_out < gen_nb_xmlChar_ptr;n_out++) {
15762 for (n_val = 0;n_val < gen_nb_int;n_val++) {
15763 mem_base = xmlMemBlocks();
15764 len = gen_int(n_len, 0);
15765 out = gen_xmlChar_ptr(n_out, 1);
15766 val = gen_int(n_val, 2);
15768 ret_val = xmlCopyChar(len, out, val);
15769 desret_int(ret_val);
15771 des_int(n_len, len, 0);
15772 des_xmlChar_ptr(n_out, out, 1);
15773 des_int(n_val, val, 2);
15774 xmlResetLastError();
15775 if (mem_base != xmlMemBlocks()) {
15776 printf("Leak of %d blocks found in xmlCopyChar",
15777 xmlMemBlocks() - mem_base);
15779 printf(" %d", n_len);
15780 printf(" %d", n_out);
15781 printf(" %d", n_val);
15794 test_xmlCopyCharMultiByte(void) {
15799 xmlChar * out; /* pointer to an array of xmlChar */
15801 int val; /* the char value */
15804 for (n_out = 0;n_out < gen_nb_xmlChar_ptr;n_out++) {
15805 for (n_val = 0;n_val < gen_nb_int;n_val++) {
15806 mem_base = xmlMemBlocks();
15807 out = gen_xmlChar_ptr(n_out, 0);
15808 val = gen_int(n_val, 1);
15810 ret_val = xmlCopyCharMultiByte(out, val);
15811 desret_int(ret_val);
15813 des_xmlChar_ptr(n_out, out, 0);
15814 des_int(n_val, val, 1);
15815 xmlResetLastError();
15816 if (mem_base != xmlMemBlocks()) {
15817 printf("Leak of %d blocks found in xmlCopyCharMultiByte",
15818 xmlMemBlocks() - mem_base);
15820 printf(" %d", n_out);
15821 printf(" %d", n_val);
15833 test_xmlCreateEntityParserCtxt(void) {
15837 xmlParserCtxtPtr ret_val;
15838 xmlChar * URL; /* the entity URL */
15840 xmlChar * ID; /* the entity PUBLIC ID */
15842 xmlChar * base; /* a possible base for the target URI */
15845 for (n_URL = 0;n_URL < gen_nb_const_xmlChar_ptr;n_URL++) {
15846 for (n_ID = 0;n_ID < gen_nb_const_xmlChar_ptr;n_ID++) {
15847 for (n_base = 0;n_base < gen_nb_const_xmlChar_ptr;n_base++) {
15848 mem_base = xmlMemBlocks();
15849 URL = gen_const_xmlChar_ptr(n_URL, 0);
15850 ID = gen_const_xmlChar_ptr(n_ID, 1);
15851 base = gen_const_xmlChar_ptr(n_base, 2);
15853 ret_val = xmlCreateEntityParserCtxt((const xmlChar *)URL, (const xmlChar *)ID, (const xmlChar *)base);
15854 desret_xmlParserCtxtPtr(ret_val);
15856 des_const_xmlChar_ptr(n_URL, (const xmlChar *)URL, 0);
15857 des_const_xmlChar_ptr(n_ID, (const xmlChar *)ID, 1);
15858 des_const_xmlChar_ptr(n_base, (const xmlChar *)base, 2);
15859 xmlResetLastError();
15860 if (mem_base != xmlMemBlocks()) {
15861 printf("Leak of %d blocks found in xmlCreateEntityParserCtxt",
15862 xmlMemBlocks() - mem_base);
15864 printf(" %d", n_URL);
15865 printf(" %d", n_ID);
15866 printf(" %d", n_base);
15879 test_xmlCreateFileParserCtxt(void) {
15883 xmlParserCtxtPtr ret_val;
15884 const char * filename; /* the filename */
15887 for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
15888 mem_base = xmlMemBlocks();
15889 filename = gen_fileoutput(n_filename, 0);
15891 ret_val = xmlCreateFileParserCtxt(filename);
15892 desret_xmlParserCtxtPtr(ret_val);
15894 des_fileoutput(n_filename, filename, 0);
15895 xmlResetLastError();
15896 if (mem_base != xmlMemBlocks()) {
15897 printf("Leak of %d blocks found in xmlCreateFileParserCtxt",
15898 xmlMemBlocks() - mem_base);
15900 printf(" %d", n_filename);
15911 test_xmlCreateMemoryParserCtxt(void) {
15915 xmlParserCtxtPtr ret_val;
15916 char * buffer; /* a pointer to a char array */
15918 int size; /* the size of the array */
15921 for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
15922 for (n_size = 0;n_size < gen_nb_int;n_size++) {
15923 mem_base = xmlMemBlocks();
15924 buffer = gen_const_char_ptr(n_buffer, 0);
15925 size = gen_int(n_size, 1);
15927 ret_val = xmlCreateMemoryParserCtxt((const char *)buffer, size);
15928 desret_xmlParserCtxtPtr(ret_val);
15930 des_const_char_ptr(n_buffer, (const char *)buffer, 0);
15931 des_int(n_size, size, 1);
15932 xmlResetLastError();
15933 if (mem_base != xmlMemBlocks()) {
15934 printf("Leak of %d blocks found in xmlCreateMemoryParserCtxt",
15935 xmlMemBlocks() - mem_base);
15937 printf(" %d", n_buffer);
15938 printf(" %d", n_size);
15950 test_xmlCreateURLParserCtxt(void) {
15954 xmlParserCtxtPtr ret_val;
15955 const char * filename; /* the filename or URL */
15957 int options; /* a combination of xmlParserOption */
15960 for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
15961 for (n_options = 0;n_options < gen_nb_int;n_options++) {
15962 mem_base = xmlMemBlocks();
15963 filename = gen_fileoutput(n_filename, 0);
15964 options = gen_int(n_options, 1);
15966 ret_val = xmlCreateURLParserCtxt(filename, options);
15967 desret_xmlParserCtxtPtr(ret_val);
15969 des_fileoutput(n_filename, filename, 0);
15970 des_int(n_options, options, 1);
15971 xmlResetLastError();
15972 if (mem_base != xmlMemBlocks()) {
15973 printf("Leak of %d blocks found in xmlCreateURLParserCtxt",
15974 xmlMemBlocks() - mem_base);
15976 printf(" %d", n_filename);
15977 printf(" %d", n_options);
15989 test_xmlCurrentChar(void) {
15994 xmlParserCtxtPtr ctxt; /* the XML parser context */
15996 int * len; /* pointer to the length of the char read */
15999 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16000 for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
16001 mem_base = xmlMemBlocks();
16002 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16003 len = gen_int_ptr(n_len, 1);
16005 ret_val = xmlCurrentChar(ctxt, len);
16006 desret_int(ret_val);
16008 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16009 des_int_ptr(n_len, len, 1);
16010 xmlResetLastError();
16011 if (mem_base != xmlMemBlocks()) {
16012 printf("Leak of %d blocks found in xmlCurrentChar",
16013 xmlMemBlocks() - mem_base);
16015 printf(" %d", n_ctxt);
16016 printf(" %d", n_len);
16028 test_xmlErrMemory(void) {
16032 xmlParserCtxtPtr ctxt; /* an XML parser context */
16034 char * extra; /* extra informations */
16037 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16038 for (n_extra = 0;n_extra < gen_nb_const_char_ptr;n_extra++) {
16039 mem_base = xmlMemBlocks();
16040 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16041 extra = gen_const_char_ptr(n_extra, 1);
16043 xmlErrMemory(ctxt, (const char *)extra);
16045 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16046 des_const_char_ptr(n_extra, (const char *)extra, 1);
16047 xmlResetLastError();
16048 if (mem_base != xmlMemBlocks()) {
16049 printf("Leak of %d blocks found in xmlErrMemory",
16050 xmlMemBlocks() - mem_base);
16052 printf(" %d", n_ctxt);
16053 printf(" %d", n_extra);
16065 test_xmlIsLetter(void) {
16070 int c; /* an unicode character (int) */
16073 for (n_c = 0;n_c < gen_nb_int;n_c++) {
16074 mem_base = xmlMemBlocks();
16075 c = gen_int(n_c, 0);
16077 ret_val = xmlIsLetter(c);
16078 desret_int(ret_val);
16080 des_int(n_c, c, 0);
16081 xmlResetLastError();
16082 if (mem_base != xmlMemBlocks()) {
16083 printf("Leak of %d blocks found in xmlIsLetter",
16084 xmlMemBlocks() - mem_base);
16086 printf(" %d", n_c);
16097 test_xmlNewEntityInputStream(void) {
16101 xmlParserInputPtr ret_val;
16102 xmlParserCtxtPtr ctxt; /* an XML parser context */
16104 xmlEntityPtr entity; /* an Entity pointer */
16107 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16108 for (n_entity = 0;n_entity < gen_nb_xmlEntityPtr;n_entity++) {
16109 mem_base = xmlMemBlocks();
16110 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16111 entity = gen_xmlEntityPtr(n_entity, 1);
16113 ret_val = xmlNewEntityInputStream(ctxt, entity);
16114 desret_xmlParserInputPtr(ret_val);
16116 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16117 des_xmlEntityPtr(n_entity, entity, 1);
16118 xmlResetLastError();
16119 if (mem_base != xmlMemBlocks()) {
16120 printf("Leak of %d blocks found in xmlNewEntityInputStream",
16121 xmlMemBlocks() - mem_base);
16123 printf(" %d", n_ctxt);
16124 printf(" %d", n_entity);
16136 test_xmlNewInputFromFile(void) {
16140 xmlParserInputPtr ret_val;
16141 xmlParserCtxtPtr ctxt; /* an XML parser context */
16143 const char * filename; /* the filename to use as entity */
16146 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16147 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
16148 mem_base = xmlMemBlocks();
16149 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16150 filename = gen_filepath(n_filename, 1);
16152 ret_val = xmlNewInputFromFile(ctxt, filename);
16153 desret_xmlParserInputPtr(ret_val);
16155 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16156 des_filepath(n_filename, filename, 1);
16157 xmlResetLastError();
16158 if (mem_base != xmlMemBlocks()) {
16159 printf("Leak of %d blocks found in xmlNewInputFromFile",
16160 xmlMemBlocks() - mem_base);
16162 printf(" %d", n_ctxt);
16163 printf(" %d", n_filename);
16175 test_xmlNewInputStream(void) {
16179 xmlParserInputPtr ret_val;
16180 xmlParserCtxtPtr ctxt; /* an XML parser context */
16183 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16184 mem_base = xmlMemBlocks();
16185 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16187 ret_val = xmlNewInputStream(ctxt);
16188 desret_xmlParserInputPtr(ret_val);
16190 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16191 xmlResetLastError();
16192 if (mem_base != xmlMemBlocks()) {
16193 printf("Leak of %d blocks found in xmlNewInputStream",
16194 xmlMemBlocks() - mem_base);
16196 printf(" %d", n_ctxt);
16207 test_xmlNewStringInputStream(void) {
16211 xmlParserInputPtr ret_val;
16212 xmlParserCtxtPtr ctxt; /* an XML parser context */
16214 xmlChar * buffer; /* an memory buffer */
16217 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16218 for (n_buffer = 0;n_buffer < gen_nb_const_xmlChar_ptr;n_buffer++) {
16219 mem_base = xmlMemBlocks();
16220 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16221 buffer = gen_const_xmlChar_ptr(n_buffer, 1);
16223 ret_val = xmlNewStringInputStream(ctxt, (const xmlChar *)buffer);
16224 desret_xmlParserInputPtr(ret_val);
16226 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16227 des_const_xmlChar_ptr(n_buffer, (const xmlChar *)buffer, 1);
16228 xmlResetLastError();
16229 if (mem_base != xmlMemBlocks()) {
16230 printf("Leak of %d blocks found in xmlNewStringInputStream",
16231 xmlMemBlocks() - mem_base);
16233 printf(" %d", n_ctxt);
16234 printf(" %d", n_buffer);
16246 test_xmlNextChar(void) {
16250 xmlParserCtxtPtr ctxt; /* the XML parser context */
16253 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16254 mem_base = xmlMemBlocks();
16255 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16259 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16260 xmlResetLastError();
16261 if (mem_base != xmlMemBlocks()) {
16262 printf("Leak of %d blocks found in xmlNextChar",
16263 xmlMemBlocks() - mem_base);
16265 printf(" %d", n_ctxt);
16276 test_xmlParserInputShrink(void) {
16280 xmlParserInputPtr in; /* an XML parser input */
16283 for (n_in = 0;n_in < gen_nb_xmlParserInputPtr;n_in++) {
16284 mem_base = xmlMemBlocks();
16285 in = gen_xmlParserInputPtr(n_in, 0);
16287 xmlParserInputShrink(in);
16289 des_xmlParserInputPtr(n_in, in, 0);
16290 xmlResetLastError();
16291 if (mem_base != xmlMemBlocks()) {
16292 printf("Leak of %d blocks found in xmlParserInputShrink",
16293 xmlMemBlocks() - mem_base);
16295 printf(" %d", n_in);
16306 test_xmlPopInput(void) {
16311 xmlParserCtxtPtr ctxt; /* an XML parser context */
16314 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16315 mem_base = xmlMemBlocks();
16316 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16318 ret_val = xmlPopInput(ctxt);
16319 desret_xmlChar(ret_val);
16321 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16322 xmlResetLastError();
16323 if (mem_base != xmlMemBlocks()) {
16324 printf("Leak of %d blocks found in xmlPopInput",
16325 xmlMemBlocks() - mem_base);
16327 printf(" %d", n_ctxt);
16338 test_xmlPushInput(void) {
16343 xmlParserCtxtPtr ctxt; /* an XML parser context */
16345 xmlParserInputPtr input; /* an XML parser input fragment (entity, XML fragment ...). */
16348 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16349 for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) {
16350 mem_base = xmlMemBlocks();
16351 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16352 input = gen_xmlParserInputPtr(n_input, 1);
16354 ret_val = xmlPushInput(ctxt, input);
16355 desret_int(ret_val);
16357 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16358 des_xmlParserInputPtr(n_input, input, 1);
16359 xmlResetLastError();
16360 if (mem_base != xmlMemBlocks()) {
16361 printf("Leak of %d blocks found in xmlPushInput",
16362 xmlMemBlocks() - mem_base);
16364 printf(" %d", n_ctxt);
16365 printf(" %d", n_input);
16377 test_xmlSetEntityReferenceFunc(void) {
16381 /* missing type support */
16387 test_xmlSplitQName(void) {
16392 xmlParserCtxtPtr ctxt; /* an XML parser context */
16394 xmlChar * name; /* an XML parser context */
16396 xmlChar ** prefix; /* a xmlChar ** */
16399 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16400 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
16401 for (n_prefix = 0;n_prefix < gen_nb_xmlChar_ptr_ptr;n_prefix++) {
16402 mem_base = xmlMemBlocks();
16403 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16404 name = gen_const_xmlChar_ptr(n_name, 1);
16405 prefix = gen_xmlChar_ptr_ptr(n_prefix, 2);
16407 ret_val = xmlSplitQName(ctxt, (const xmlChar *)name, prefix);
16408 desret_xmlChar_ptr(ret_val);
16410 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16411 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
16412 des_xmlChar_ptr_ptr(n_prefix, prefix, 2);
16413 xmlResetLastError();
16414 if (mem_base != xmlMemBlocks()) {
16415 printf("Leak of %d blocks found in xmlSplitQName",
16416 xmlMemBlocks() - mem_base);
16418 printf(" %d", n_ctxt);
16419 printf(" %d", n_name);
16420 printf(" %d", n_prefix);
16433 test_xmlStringCurrentChar(void) {
16438 xmlParserCtxtPtr ctxt; /* the XML parser context */
16440 xmlChar * cur; /* pointer to the beginning of the char */
16442 int * len; /* pointer to the length of the char read */
16445 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16446 for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
16447 for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
16448 mem_base = xmlMemBlocks();
16449 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16450 cur = gen_const_xmlChar_ptr(n_cur, 1);
16451 len = gen_int_ptr(n_len, 2);
16453 ret_val = xmlStringCurrentChar(ctxt, (const xmlChar *)cur, len);
16454 desret_int(ret_val);
16456 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16457 des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1);
16458 des_int_ptr(n_len, len, 2);
16459 xmlResetLastError();
16460 if (mem_base != xmlMemBlocks()) {
16461 printf("Leak of %d blocks found in xmlStringCurrentChar",
16462 xmlMemBlocks() - mem_base);
16464 printf(" %d", n_ctxt);
16465 printf(" %d", n_cur);
16466 printf(" %d", n_len);
16479 test_xmlStringDecodeEntities(void) {
16484 xmlParserCtxtPtr ctxt; /* the parser context */
16486 xmlChar * str; /* the input string */
16488 int what; /* combination of XML_SUBSTITUTE_REF and XML_SUBSTITUTE_PEREF */
16490 xmlChar end; /* an end marker xmlChar, 0 if none */
16492 xmlChar end2; /* an end marker xmlChar, 0 if none */
16494 xmlChar end3; /* an end marker xmlChar, 0 if none */
16497 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16498 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
16499 for (n_what = 0;n_what < gen_nb_int;n_what++) {
16500 for (n_end = 0;n_end < gen_nb_xmlChar;n_end++) {
16501 for (n_end2 = 0;n_end2 < gen_nb_xmlChar;n_end2++) {
16502 for (n_end3 = 0;n_end3 < gen_nb_xmlChar;n_end3++) {
16503 mem_base = xmlMemBlocks();
16504 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16505 str = gen_const_xmlChar_ptr(n_str, 1);
16506 what = gen_int(n_what, 2);
16507 end = gen_xmlChar(n_end, 3);
16508 end2 = gen_xmlChar(n_end2, 4);
16509 end3 = gen_xmlChar(n_end3, 5);
16511 ret_val = xmlStringDecodeEntities(ctxt, (const xmlChar *)str, what, end, end2, end3);
16512 desret_xmlChar_ptr(ret_val);
16514 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16515 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
16516 des_int(n_what, what, 2);
16517 des_xmlChar(n_end, end, 3);
16518 des_xmlChar(n_end2, end2, 4);
16519 des_xmlChar(n_end3, end3, 5);
16520 xmlResetLastError();
16521 if (mem_base != xmlMemBlocks()) {
16522 printf("Leak of %d blocks found in xmlStringDecodeEntities",
16523 xmlMemBlocks() - mem_base);
16525 printf(" %d", n_ctxt);
16526 printf(" %d", n_str);
16527 printf(" %d", n_what);
16528 printf(" %d", n_end);
16529 printf(" %d", n_end2);
16530 printf(" %d", n_end3);
16546 test_xmlStringLenDecodeEntities(void) {
16551 xmlParserCtxtPtr ctxt; /* the parser context */
16553 xmlChar * str; /* the input string */
16555 int len; /* the string length */
16557 int what; /* combination of XML_SUBSTITUTE_REF and XML_SUBSTITUTE_PEREF */
16559 xmlChar end; /* an end marker xmlChar, 0 if none */
16561 xmlChar end2; /* an end marker xmlChar, 0 if none */
16563 xmlChar end3; /* an end marker xmlChar, 0 if none */
16566 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16567 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
16568 for (n_len = 0;n_len < gen_nb_int;n_len++) {
16569 for (n_what = 0;n_what < gen_nb_int;n_what++) {
16570 for (n_end = 0;n_end < gen_nb_xmlChar;n_end++) {
16571 for (n_end2 = 0;n_end2 < gen_nb_xmlChar;n_end2++) {
16572 for (n_end3 = 0;n_end3 < gen_nb_xmlChar;n_end3++) {
16573 mem_base = xmlMemBlocks();
16574 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16575 str = gen_const_xmlChar_ptr(n_str, 1);
16576 len = gen_int(n_len, 2);
16577 what = gen_int(n_what, 3);
16578 end = gen_xmlChar(n_end, 4);
16579 end2 = gen_xmlChar(n_end2, 5);
16580 end3 = gen_xmlChar(n_end3, 6);
16582 ret_val = xmlStringLenDecodeEntities(ctxt, (const xmlChar *)str, len, what, end, end2, end3);
16583 desret_xmlChar_ptr(ret_val);
16585 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16586 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
16587 des_int(n_len, len, 2);
16588 des_int(n_what, what, 3);
16589 des_xmlChar(n_end, end, 4);
16590 des_xmlChar(n_end2, end2, 5);
16591 des_xmlChar(n_end3, end3, 6);
16592 xmlResetLastError();
16593 if (mem_base != xmlMemBlocks()) {
16594 printf("Leak of %d blocks found in xmlStringLenDecodeEntities",
16595 xmlMemBlocks() - mem_base);
16597 printf(" %d", n_ctxt);
16598 printf(" %d", n_str);
16599 printf(" %d", n_len);
16600 printf(" %d", n_what);
16601 printf(" %d", n_end);
16602 printf(" %d", n_end2);
16603 printf(" %d", n_end3);
16620 test_xmlSwitchEncoding(void) {
16625 xmlParserCtxtPtr ctxt; /* the parser context */
16627 xmlCharEncoding enc; /* the encoding value (number) */
16630 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16631 for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
16632 mem_base = xmlMemBlocks();
16633 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16634 enc = gen_xmlCharEncoding(n_enc, 1);
16636 ret_val = xmlSwitchEncoding(ctxt, enc);
16637 desret_int(ret_val);
16639 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16640 des_xmlCharEncoding(n_enc, enc, 1);
16641 xmlResetLastError();
16642 if (mem_base != xmlMemBlocks()) {
16643 printf("Leak of %d blocks found in xmlSwitchEncoding",
16644 xmlMemBlocks() - mem_base);
16646 printf(" %d", n_ctxt);
16647 printf(" %d", n_enc);
16659 test_xmlSwitchInputEncoding(void) {
16664 xmlParserCtxtPtr ctxt; /* the parser context */
16666 xmlParserInputPtr input; /* the input stream */
16668 xmlCharEncodingHandlerPtr handler; /* the encoding handler */
16671 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16672 for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) {
16673 for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandlerPtr;n_handler++) {
16674 mem_base = xmlMemBlocks();
16675 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16676 input = gen_xmlParserInputPtr(n_input, 1);
16677 handler = gen_xmlCharEncodingHandlerPtr(n_handler, 2);
16679 ret_val = xmlSwitchInputEncoding(ctxt, input, handler);
16680 desret_int(ret_val);
16682 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16683 des_xmlParserInputPtr(n_input, input, 1);
16684 des_xmlCharEncodingHandlerPtr(n_handler, handler, 2);
16685 xmlResetLastError();
16686 if (mem_base != xmlMemBlocks()) {
16687 printf("Leak of %d blocks found in xmlSwitchInputEncoding",
16688 xmlMemBlocks() - mem_base);
16690 printf(" %d", n_ctxt);
16691 printf(" %d", n_input);
16692 printf(" %d", n_handler);
16705 test_xmlSwitchToEncoding(void) {
16710 xmlParserCtxtPtr ctxt; /* the parser context */
16712 xmlCharEncodingHandlerPtr handler; /* the encoding handler */
16715 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16716 for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandlerPtr;n_handler++) {
16717 mem_base = xmlMemBlocks();
16718 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16719 handler = gen_xmlCharEncodingHandlerPtr(n_handler, 1);
16721 ret_val = xmlSwitchToEncoding(ctxt, handler);
16722 desret_int(ret_val);
16724 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16725 des_xmlCharEncodingHandlerPtr(n_handler, handler, 1);
16726 xmlResetLastError();
16727 if (mem_base != xmlMemBlocks()) {
16728 printf("Leak of %d blocks found in xmlSwitchToEncoding",
16729 xmlMemBlocks() - mem_base);
16731 printf(" %d", n_ctxt);
16732 printf(" %d", n_handler);
16743 test_parserInternals(void) {
16746 if (quiet == 0) printf("Testing parserInternals : 33 of 90 functions ...\n");
16747 test_ret += test_htmlCreateFileParserCtxt();
16748 test_ret += test_htmlInitAutoClose();
16749 test_ret += test_inputPop();
16750 test_ret += test_inputPush();
16751 test_ret += test_namePop();
16752 test_ret += test_namePush();
16753 test_ret += test_nodePop();
16754 test_ret += test_nodePush();
16755 test_ret += test_xmlCheckLanguageID();
16756 test_ret += test_xmlCopyChar();
16757 test_ret += test_xmlCopyCharMultiByte();
16758 test_ret += test_xmlCreateEntityParserCtxt();
16759 test_ret += test_xmlCreateFileParserCtxt();
16760 test_ret += test_xmlCreateMemoryParserCtxt();
16761 test_ret += test_xmlCreateURLParserCtxt();
16762 test_ret += test_xmlCurrentChar();
16763 test_ret += test_xmlErrMemory();
16764 test_ret += test_xmlIsLetter();
16765 test_ret += test_xmlNewEntityInputStream();
16766 test_ret += test_xmlNewInputFromFile();
16767 test_ret += test_xmlNewInputStream();
16768 test_ret += test_xmlNewStringInputStream();
16769 test_ret += test_xmlNextChar();
16770 test_ret += test_xmlParserInputShrink();
16771 test_ret += test_xmlPopInput();
16772 test_ret += test_xmlPushInput();
16773 test_ret += test_xmlSetEntityReferenceFunc();
16774 test_ret += test_xmlSplitQName();
16775 test_ret += test_xmlStringCurrentChar();
16776 test_ret += test_xmlStringDecodeEntities();
16777 test_ret += test_xmlStringLenDecodeEntities();
16778 test_ret += test_xmlSwitchEncoding();
16779 test_ret += test_xmlSwitchInputEncoding();
16780 test_ret += test_xmlSwitchToEncoding();
16783 printf("Module parserInternals: %d errors\n", test_ret);
16788 test_xmlPatternFromRoot(void) {
16791 #if defined(LIBXML_PATTERN_ENABLED)
16794 xmlPatternPtr comp; /* the precompiled pattern */
16797 for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
16798 mem_base = xmlMemBlocks();
16799 comp = gen_xmlPatternPtr(n_comp, 0);
16801 ret_val = xmlPatternFromRoot(comp);
16802 desret_int(ret_val);
16804 des_xmlPatternPtr(n_comp, comp, 0);
16805 xmlResetLastError();
16806 if (mem_base != xmlMemBlocks()) {
16807 printf("Leak of %d blocks found in xmlPatternFromRoot",
16808 xmlMemBlocks() - mem_base);
16810 printf(" %d", n_comp);
16822 test_xmlPatternGetStreamCtxt(void) {
16826 /* missing type support */
16832 test_xmlPatternMatch(void) {
16835 #if defined(LIBXML_PATTERN_ENABLED)
16838 xmlPatternPtr comp; /* the precompiled pattern */
16840 xmlNodePtr node; /* a node */
16843 for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
16844 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
16845 mem_base = xmlMemBlocks();
16846 comp = gen_xmlPatternPtr(n_comp, 0);
16847 node = gen_xmlNodePtr(n_node, 1);
16849 ret_val = xmlPatternMatch(comp, node);
16850 desret_int(ret_val);
16852 des_xmlPatternPtr(n_comp, comp, 0);
16853 des_xmlNodePtr(n_node, node, 1);
16854 xmlResetLastError();
16855 if (mem_base != xmlMemBlocks()) {
16856 printf("Leak of %d blocks found in xmlPatternMatch",
16857 xmlMemBlocks() - mem_base);
16859 printf(" %d", n_comp);
16860 printf(" %d", n_node);
16873 test_xmlPatternMaxDepth(void) {
16876 #if defined(LIBXML_PATTERN_ENABLED)
16879 xmlPatternPtr comp; /* the precompiled pattern */
16882 for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
16883 mem_base = xmlMemBlocks();
16884 comp = gen_xmlPatternPtr(n_comp, 0);
16886 ret_val = xmlPatternMaxDepth(comp);
16887 desret_int(ret_val);
16889 des_xmlPatternPtr(n_comp, comp, 0);
16890 xmlResetLastError();
16891 if (mem_base != xmlMemBlocks()) {
16892 printf("Leak of %d blocks found in xmlPatternMaxDepth",
16893 xmlMemBlocks() - mem_base);
16895 printf(" %d", n_comp);
16907 test_xmlPatternMinDepth(void) {
16910 #if defined(LIBXML_PATTERN_ENABLED)
16913 xmlPatternPtr comp; /* the precompiled pattern */
16916 for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
16917 mem_base = xmlMemBlocks();
16918 comp = gen_xmlPatternPtr(n_comp, 0);
16920 ret_val = xmlPatternMinDepth(comp);
16921 desret_int(ret_val);
16923 des_xmlPatternPtr(n_comp, comp, 0);
16924 xmlResetLastError();
16925 if (mem_base != xmlMemBlocks()) {
16926 printf("Leak of %d blocks found in xmlPatternMinDepth",
16927 xmlMemBlocks() - mem_base);
16929 printf(" %d", n_comp);
16941 test_xmlPatternStreamable(void) {
16944 #if defined(LIBXML_PATTERN_ENABLED)
16947 xmlPatternPtr comp; /* the precompiled pattern */
16950 for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
16951 mem_base = xmlMemBlocks();
16952 comp = gen_xmlPatternPtr(n_comp, 0);
16954 ret_val = xmlPatternStreamable(comp);
16955 desret_int(ret_val);
16957 des_xmlPatternPtr(n_comp, comp, 0);
16958 xmlResetLastError();
16959 if (mem_base != xmlMemBlocks()) {
16960 printf("Leak of %d blocks found in xmlPatternStreamable",
16961 xmlMemBlocks() - mem_base);
16963 printf(" %d", n_comp);
16975 test_xmlPatterncompile(void) {
16979 /* missing type support */
16983 #ifdef LIBXML_PATTERN_ENABLED
16985 #define gen_nb_xmlStreamCtxtPtr 1
16986 static xmlStreamCtxtPtr gen_xmlStreamCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
16989 static void des_xmlStreamCtxtPtr(int no ATTRIBUTE_UNUSED, xmlStreamCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
16995 test_xmlStreamPop(void) {
16998 #if defined(LIBXML_PATTERN_ENABLED)
17001 xmlStreamCtxtPtr stream; /* the stream context */
17004 for (n_stream = 0;n_stream < gen_nb_xmlStreamCtxtPtr;n_stream++) {
17005 mem_base = xmlMemBlocks();
17006 stream = gen_xmlStreamCtxtPtr(n_stream, 0);
17008 ret_val = xmlStreamPop(stream);
17009 desret_int(ret_val);
17011 des_xmlStreamCtxtPtr(n_stream, stream, 0);
17012 xmlResetLastError();
17013 if (mem_base != xmlMemBlocks()) {
17014 printf("Leak of %d blocks found in xmlStreamPop",
17015 xmlMemBlocks() - mem_base);
17017 printf(" %d", n_stream);
17029 test_xmlStreamPush(void) {
17032 #if defined(LIBXML_PATTERN_ENABLED)
17035 xmlStreamCtxtPtr stream; /* the stream context */
17037 xmlChar * name; /* the current name */
17039 xmlChar * ns; /* the namespace name */
17042 for (n_stream = 0;n_stream < gen_nb_xmlStreamCtxtPtr;n_stream++) {
17043 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
17044 for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
17045 mem_base = xmlMemBlocks();
17046 stream = gen_xmlStreamCtxtPtr(n_stream, 0);
17047 name = gen_const_xmlChar_ptr(n_name, 1);
17048 ns = gen_const_xmlChar_ptr(n_ns, 2);
17050 ret_val = xmlStreamPush(stream, (const xmlChar *)name, (const xmlChar *)ns);
17051 desret_int(ret_val);
17053 des_xmlStreamCtxtPtr(n_stream, stream, 0);
17054 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
17055 des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 2);
17056 xmlResetLastError();
17057 if (mem_base != xmlMemBlocks()) {
17058 printf("Leak of %d blocks found in xmlStreamPush",
17059 xmlMemBlocks() - mem_base);
17061 printf(" %d", n_stream);
17062 printf(" %d", n_name);
17063 printf(" %d", n_ns);
17077 test_xmlStreamPushAttr(void) {
17080 #if defined(LIBXML_PATTERN_ENABLED)
17083 xmlStreamCtxtPtr stream; /* the stream context */
17085 xmlChar * name; /* the current name */
17087 xmlChar * ns; /* the namespace name */
17090 for (n_stream = 0;n_stream < gen_nb_xmlStreamCtxtPtr;n_stream++) {
17091 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
17092 for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
17093 mem_base = xmlMemBlocks();
17094 stream = gen_xmlStreamCtxtPtr(n_stream, 0);
17095 name = gen_const_xmlChar_ptr(n_name, 1);
17096 ns = gen_const_xmlChar_ptr(n_ns, 2);
17098 ret_val = xmlStreamPushAttr(stream, (const xmlChar *)name, (const xmlChar *)ns);
17099 desret_int(ret_val);
17101 des_xmlStreamCtxtPtr(n_stream, stream, 0);
17102 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
17103 des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 2);
17104 xmlResetLastError();
17105 if (mem_base != xmlMemBlocks()) {
17106 printf("Leak of %d blocks found in xmlStreamPushAttr",
17107 xmlMemBlocks() - mem_base);
17109 printf(" %d", n_stream);
17110 printf(" %d", n_name);
17111 printf(" %d", n_ns);
17125 test_xmlStreamPushNode(void) {
17128 #if defined(LIBXML_PATTERN_ENABLED)
17131 xmlStreamCtxtPtr stream; /* the stream context */
17133 xmlChar * name; /* the current name */
17135 xmlChar * ns; /* the namespace name */
17137 int nodeType; /* the type of the node being pushed */
17140 for (n_stream = 0;n_stream < gen_nb_xmlStreamCtxtPtr;n_stream++) {
17141 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
17142 for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
17143 for (n_nodeType = 0;n_nodeType < gen_nb_int;n_nodeType++) {
17144 mem_base = xmlMemBlocks();
17145 stream = gen_xmlStreamCtxtPtr(n_stream, 0);
17146 name = gen_const_xmlChar_ptr(n_name, 1);
17147 ns = gen_const_xmlChar_ptr(n_ns, 2);
17148 nodeType = gen_int(n_nodeType, 3);
17150 ret_val = xmlStreamPushNode(stream, (const xmlChar *)name, (const xmlChar *)ns, nodeType);
17151 desret_int(ret_val);
17153 des_xmlStreamCtxtPtr(n_stream, stream, 0);
17154 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
17155 des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 2);
17156 des_int(n_nodeType, nodeType, 3);
17157 xmlResetLastError();
17158 if (mem_base != xmlMemBlocks()) {
17159 printf("Leak of %d blocks found in xmlStreamPushNode",
17160 xmlMemBlocks() - mem_base);
17162 printf(" %d", n_stream);
17163 printf(" %d", n_name);
17164 printf(" %d", n_ns);
17165 printf(" %d", n_nodeType);
17180 test_xmlStreamWantsAnyNode(void) {
17183 #if defined(LIBXML_PATTERN_ENABLED)
17186 xmlStreamCtxtPtr streamCtxt; /* the stream context */
17189 for (n_streamCtxt = 0;n_streamCtxt < gen_nb_xmlStreamCtxtPtr;n_streamCtxt++) {
17190 mem_base = xmlMemBlocks();
17191 streamCtxt = gen_xmlStreamCtxtPtr(n_streamCtxt, 0);
17193 ret_val = xmlStreamWantsAnyNode(streamCtxt);
17194 desret_int(ret_val);
17196 des_xmlStreamCtxtPtr(n_streamCtxt, streamCtxt, 0);
17197 xmlResetLastError();
17198 if (mem_base != xmlMemBlocks()) {
17199 printf("Leak of %d blocks found in xmlStreamWantsAnyNode",
17200 xmlMemBlocks() - mem_base);
17202 printf(" %d", n_streamCtxt);
17213 test_pattern(void) {
17216 if (quiet == 0) printf("Testing pattern : 10 of 15 functions ...\n");
17217 test_ret += test_xmlPatternFromRoot();
17218 test_ret += test_xmlPatternGetStreamCtxt();
17219 test_ret += test_xmlPatternMatch();
17220 test_ret += test_xmlPatternMaxDepth();
17221 test_ret += test_xmlPatternMinDepth();
17222 test_ret += test_xmlPatternStreamable();
17223 test_ret += test_xmlPatterncompile();
17224 test_ret += test_xmlStreamPop();
17225 test_ret += test_xmlStreamPush();
17226 test_ret += test_xmlStreamPushAttr();
17227 test_ret += test_xmlStreamPushNode();
17228 test_ret += test_xmlStreamWantsAnyNode();
17231 printf("Module pattern: %d errors\n", test_ret);
17234 #ifdef LIBXML_SCHEMAS_ENABLED
17236 #define gen_nb_xmlRelaxNGPtr 1
17237 static xmlRelaxNGPtr gen_xmlRelaxNGPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17240 static void des_xmlRelaxNGPtr(int no ATTRIBUTE_UNUSED, xmlRelaxNGPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17246 test_xmlRelaxNGDump(void) {
17249 #if defined(LIBXML_SCHEMAS_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
17251 FILE * output; /* the file output */
17253 xmlRelaxNGPtr schema; /* a schema structure */
17256 for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
17257 for (n_schema = 0;n_schema < gen_nb_xmlRelaxNGPtr;n_schema++) {
17258 mem_base = xmlMemBlocks();
17259 output = gen_FILE_ptr(n_output, 0);
17260 schema = gen_xmlRelaxNGPtr(n_schema, 1);
17262 xmlRelaxNGDump(output, schema);
17264 des_FILE_ptr(n_output, output, 0);
17265 des_xmlRelaxNGPtr(n_schema, schema, 1);
17266 xmlResetLastError();
17267 if (mem_base != xmlMemBlocks()) {
17268 printf("Leak of %d blocks found in xmlRelaxNGDump",
17269 xmlMemBlocks() - mem_base);
17271 printf(" %d", n_output);
17272 printf(" %d", n_schema);
17285 test_xmlRelaxNGDumpTree(void) {
17288 #if defined(LIBXML_SCHEMAS_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
17290 FILE * output; /* the file output */
17292 xmlRelaxNGPtr schema; /* a schema structure */
17295 for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
17296 for (n_schema = 0;n_schema < gen_nb_xmlRelaxNGPtr;n_schema++) {
17297 mem_base = xmlMemBlocks();
17298 output = gen_FILE_ptr(n_output, 0);
17299 schema = gen_xmlRelaxNGPtr(n_schema, 1);
17301 xmlRelaxNGDumpTree(output, schema);
17303 des_FILE_ptr(n_output, output, 0);
17304 des_xmlRelaxNGPtr(n_schema, schema, 1);
17305 xmlResetLastError();
17306 if (mem_base != xmlMemBlocks()) {
17307 printf("Leak of %d blocks found in xmlRelaxNGDumpTree",
17308 xmlMemBlocks() - mem_base);
17310 printf(" %d", n_output);
17311 printf(" %d", n_schema);
17322 #ifdef LIBXML_SCHEMAS_ENABLED
17324 #define gen_nb_xmlRelaxNGParserCtxtPtr 1
17325 static xmlRelaxNGParserCtxtPtr gen_xmlRelaxNGParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17328 static void des_xmlRelaxNGParserCtxtPtr(int no ATTRIBUTE_UNUSED, xmlRelaxNGParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17332 #ifdef LIBXML_SCHEMAS_ENABLED
17334 #define gen_nb_xmlRelaxNGValidityErrorFunc_ptr 1
17335 static xmlRelaxNGValidityErrorFunc * gen_xmlRelaxNGValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17338 static void des_xmlRelaxNGValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED, xmlRelaxNGValidityErrorFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17342 #ifdef LIBXML_SCHEMAS_ENABLED
17344 #define gen_nb_xmlRelaxNGValidityWarningFunc_ptr 1
17345 static xmlRelaxNGValidityWarningFunc * gen_xmlRelaxNGValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17348 static void des_xmlRelaxNGValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED, xmlRelaxNGValidityWarningFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17354 test_xmlRelaxNGGetParserErrors(void) {
17357 #if defined(LIBXML_SCHEMAS_ENABLED)
17360 xmlRelaxNGParserCtxtPtr ctxt; /* a Relax-NG validation context */
17362 xmlRelaxNGValidityErrorFunc * err; /* the error callback result */
17364 xmlRelaxNGValidityWarningFunc * warn; /* the warning callback result */
17366 void ** ctx; /* contextual data for the callbacks result */
17369 for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGParserCtxtPtr;n_ctxt++) {
17370 for (n_err = 0;n_err < gen_nb_xmlRelaxNGValidityErrorFunc_ptr;n_err++) {
17371 for (n_warn = 0;n_warn < gen_nb_xmlRelaxNGValidityWarningFunc_ptr;n_warn++) {
17372 for (n_ctx = 0;n_ctx < gen_nb_void_ptr_ptr;n_ctx++) {
17373 mem_base = xmlMemBlocks();
17374 ctxt = gen_xmlRelaxNGParserCtxtPtr(n_ctxt, 0);
17375 err = gen_xmlRelaxNGValidityErrorFunc_ptr(n_err, 1);
17376 warn = gen_xmlRelaxNGValidityWarningFunc_ptr(n_warn, 2);
17377 ctx = gen_void_ptr_ptr(n_ctx, 3);
17379 ret_val = xmlRelaxNGGetParserErrors(ctxt, err, warn, ctx);
17380 desret_int(ret_val);
17382 des_xmlRelaxNGParserCtxtPtr(n_ctxt, ctxt, 0);
17383 des_xmlRelaxNGValidityErrorFunc_ptr(n_err, err, 1);
17384 des_xmlRelaxNGValidityWarningFunc_ptr(n_warn, warn, 2);
17385 des_void_ptr_ptr(n_ctx, ctx, 3);
17386 xmlResetLastError();
17387 if (mem_base != xmlMemBlocks()) {
17388 printf("Leak of %d blocks found in xmlRelaxNGGetParserErrors",
17389 xmlMemBlocks() - mem_base);
17391 printf(" %d", n_ctxt);
17392 printf(" %d", n_err);
17393 printf(" %d", n_warn);
17394 printf(" %d", n_ctx);
17407 #ifdef LIBXML_SCHEMAS_ENABLED
17409 #define gen_nb_xmlRelaxNGValidCtxtPtr 1
17410 static xmlRelaxNGValidCtxtPtr gen_xmlRelaxNGValidCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17413 static void des_xmlRelaxNGValidCtxtPtr(int no ATTRIBUTE_UNUSED, xmlRelaxNGValidCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17419 test_xmlRelaxNGGetValidErrors(void) {
17422 #if defined(LIBXML_SCHEMAS_ENABLED)
17425 xmlRelaxNGValidCtxtPtr ctxt; /* a Relax-NG validation context */
17427 xmlRelaxNGValidityErrorFunc * err; /* the error function result */
17429 xmlRelaxNGValidityWarningFunc * warn; /* the warning function result */
17431 void ** ctx; /* the functions context result */
17434 for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17435 for (n_err = 0;n_err < gen_nb_xmlRelaxNGValidityErrorFunc_ptr;n_err++) {
17436 for (n_warn = 0;n_warn < gen_nb_xmlRelaxNGValidityWarningFunc_ptr;n_warn++) {
17437 for (n_ctx = 0;n_ctx < gen_nb_void_ptr_ptr;n_ctx++) {
17438 mem_base = xmlMemBlocks();
17439 ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17440 err = gen_xmlRelaxNGValidityErrorFunc_ptr(n_err, 1);
17441 warn = gen_xmlRelaxNGValidityWarningFunc_ptr(n_warn, 2);
17442 ctx = gen_void_ptr_ptr(n_ctx, 3);
17444 ret_val = xmlRelaxNGGetValidErrors(ctxt, err, warn, ctx);
17445 desret_int(ret_val);
17447 des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17448 des_xmlRelaxNGValidityErrorFunc_ptr(n_err, err, 1);
17449 des_xmlRelaxNGValidityWarningFunc_ptr(n_warn, warn, 2);
17450 des_void_ptr_ptr(n_ctx, ctx, 3);
17451 xmlResetLastError();
17452 if (mem_base != xmlMemBlocks()) {
17453 printf("Leak of %d blocks found in xmlRelaxNGGetValidErrors",
17454 xmlMemBlocks() - mem_base);
17456 printf(" %d", n_ctxt);
17457 printf(" %d", n_err);
17458 printf(" %d", n_warn);
17459 printf(" %d", n_ctx);
17474 test_xmlRelaxNGInitTypes(void) {
17477 #if defined(LIBXML_SCHEMAS_ENABLED)
17481 mem_base = xmlMemBlocks();
17483 ret_val = xmlRelaxNGInitTypes();
17484 desret_int(ret_val);
17486 xmlResetLastError();
17487 if (mem_base != xmlMemBlocks()) {
17488 printf("Leak of %d blocks found in xmlRelaxNGInitTypes",
17489 xmlMemBlocks() - mem_base);
17501 test_xmlRelaxNGNewDocParserCtxt(void) {
17504 #if defined(LIBXML_SCHEMAS_ENABLED)
17506 xmlRelaxNGParserCtxtPtr ret_val;
17507 xmlDocPtr doc; /* a preparsed document tree */
17510 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17511 mem_base = xmlMemBlocks();
17512 doc = gen_xmlDocPtr(n_doc, 0);
17514 ret_val = xmlRelaxNGNewDocParserCtxt(doc);
17515 desret_xmlRelaxNGParserCtxtPtr(ret_val);
17517 des_xmlDocPtr(n_doc, doc, 0);
17518 xmlResetLastError();
17519 if (mem_base != xmlMemBlocks()) {
17520 printf("Leak of %d blocks found in xmlRelaxNGNewDocParserCtxt",
17521 xmlMemBlocks() - mem_base);
17523 printf(" %d", n_doc);
17535 test_xmlRelaxNGNewMemParserCtxt(void) {
17538 #if defined(LIBXML_SCHEMAS_ENABLED)
17540 xmlRelaxNGParserCtxtPtr ret_val;
17541 char * buffer; /* a pointer to a char array containing the schemas */
17543 int size; /* the size of the array */
17546 for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
17547 for (n_size = 0;n_size < gen_nb_int;n_size++) {
17548 mem_base = xmlMemBlocks();
17549 buffer = gen_const_char_ptr(n_buffer, 0);
17550 size = gen_int(n_size, 1);
17552 ret_val = xmlRelaxNGNewMemParserCtxt((const char *)buffer, size);
17553 desret_xmlRelaxNGParserCtxtPtr(ret_val);
17555 des_const_char_ptr(n_buffer, (const char *)buffer, 0);
17556 des_int(n_size, size, 1);
17557 xmlResetLastError();
17558 if (mem_base != xmlMemBlocks()) {
17559 printf("Leak of %d blocks found in xmlRelaxNGNewMemParserCtxt",
17560 xmlMemBlocks() - mem_base);
17562 printf(" %d", n_buffer);
17563 printf(" %d", n_size);
17576 test_xmlRelaxNGNewParserCtxt(void) {
17579 #if defined(LIBXML_SCHEMAS_ENABLED)
17581 xmlRelaxNGParserCtxtPtr ret_val;
17582 char * URL; /* the location of the schema */
17585 for (n_URL = 0;n_URL < gen_nb_const_char_ptr;n_URL++) {
17586 mem_base = xmlMemBlocks();
17587 URL = gen_const_char_ptr(n_URL, 0);
17589 ret_val = xmlRelaxNGNewParserCtxt((const char *)URL);
17590 desret_xmlRelaxNGParserCtxtPtr(ret_val);
17592 des_const_char_ptr(n_URL, (const char *)URL, 0);
17593 xmlResetLastError();
17594 if (mem_base != xmlMemBlocks()) {
17595 printf("Leak of %d blocks found in xmlRelaxNGNewParserCtxt",
17596 xmlMemBlocks() - mem_base);
17598 printf(" %d", n_URL);
17610 test_xmlRelaxNGNewValidCtxt(void) {
17614 /* missing type support */
17620 test_xmlRelaxNGParse(void) {
17624 /* missing type support */
17630 test_xmlRelaxNGSetParserErrors(void) {
17634 /* missing type support */
17640 test_xmlRelaxNGSetParserStructuredErrors(void) {
17644 /* missing type support */
17650 test_xmlRelaxNGSetValidErrors(void) {
17654 /* missing type support */
17660 test_xmlRelaxNGSetValidStructuredErrors(void) {
17664 /* missing type support */
17670 test_xmlRelaxNGValidateDoc(void) {
17673 #if defined(LIBXML_SCHEMAS_ENABLED)
17676 xmlRelaxNGValidCtxtPtr ctxt; /* a Relax-NG validation context */
17678 xmlDocPtr doc; /* a parsed document tree */
17681 for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17682 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17683 mem_base = xmlMemBlocks();
17684 ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17685 doc = gen_xmlDocPtr(n_doc, 1);
17687 ret_val = xmlRelaxNGValidateDoc(ctxt, doc);
17688 desret_int(ret_val);
17690 des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17691 des_xmlDocPtr(n_doc, doc, 1);
17692 xmlResetLastError();
17693 if (mem_base != xmlMemBlocks()) {
17694 printf("Leak of %d blocks found in xmlRelaxNGValidateDoc",
17695 xmlMemBlocks() - mem_base);
17697 printf(" %d", n_ctxt);
17698 printf(" %d", n_doc);
17711 test_xmlRelaxNGValidateFullElement(void) {
17714 #if defined(LIBXML_SCHEMAS_ENABLED)
17717 xmlRelaxNGValidCtxtPtr ctxt; /* the validation context */
17719 xmlDocPtr doc; /* a document instance */
17721 xmlNodePtr elem; /* an element instance */
17724 for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17725 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17726 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
17727 mem_base = xmlMemBlocks();
17728 ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17729 doc = gen_xmlDocPtr(n_doc, 1);
17730 elem = gen_xmlNodePtr(n_elem, 2);
17732 ret_val = xmlRelaxNGValidateFullElement(ctxt, doc, elem);
17733 desret_int(ret_val);
17735 des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17736 des_xmlDocPtr(n_doc, doc, 1);
17737 des_xmlNodePtr(n_elem, elem, 2);
17738 xmlResetLastError();
17739 if (mem_base != xmlMemBlocks()) {
17740 printf("Leak of %d blocks found in xmlRelaxNGValidateFullElement",
17741 xmlMemBlocks() - mem_base);
17743 printf(" %d", n_ctxt);
17744 printf(" %d", n_doc);
17745 printf(" %d", n_elem);
17759 test_xmlRelaxNGValidatePopElement(void) {
17762 #if defined(LIBXML_SCHEMAS_ENABLED)
17765 xmlRelaxNGValidCtxtPtr ctxt; /* the RelaxNG validation context */
17767 xmlDocPtr doc; /* a document instance */
17769 xmlNodePtr elem; /* an element instance */
17772 for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17773 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17774 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
17775 mem_base = xmlMemBlocks();
17776 ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17777 doc = gen_xmlDocPtr(n_doc, 1);
17778 elem = gen_xmlNodePtr(n_elem, 2);
17780 ret_val = xmlRelaxNGValidatePopElement(ctxt, doc, elem);
17781 desret_int(ret_val);
17783 des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17784 des_xmlDocPtr(n_doc, doc, 1);
17785 des_xmlNodePtr(n_elem, elem, 2);
17786 xmlResetLastError();
17787 if (mem_base != xmlMemBlocks()) {
17788 printf("Leak of %d blocks found in xmlRelaxNGValidatePopElement",
17789 xmlMemBlocks() - mem_base);
17791 printf(" %d", n_ctxt);
17792 printf(" %d", n_doc);
17793 printf(" %d", n_elem);
17807 test_xmlRelaxNGValidatePushCData(void) {
17810 #if defined(LIBXML_SCHEMAS_ENABLED)
17813 xmlRelaxNGValidCtxtPtr ctxt; /* the RelaxNG validation context */
17815 xmlChar * data; /* some character data read */
17817 int len; /* the lenght of the data */
17820 for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17821 for (n_data = 0;n_data < gen_nb_const_xmlChar_ptr;n_data++) {
17822 for (n_len = 0;n_len < gen_nb_int;n_len++) {
17823 mem_base = xmlMemBlocks();
17824 ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17825 data = gen_const_xmlChar_ptr(n_data, 1);
17826 len = gen_int(n_len, 2);
17828 ret_val = xmlRelaxNGValidatePushCData(ctxt, (const xmlChar *)data, len);
17829 desret_int(ret_val);
17831 des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17832 des_const_xmlChar_ptr(n_data, (const xmlChar *)data, 1);
17833 des_int(n_len, len, 2);
17834 xmlResetLastError();
17835 if (mem_base != xmlMemBlocks()) {
17836 printf("Leak of %d blocks found in xmlRelaxNGValidatePushCData",
17837 xmlMemBlocks() - mem_base);
17839 printf(" %d", n_ctxt);
17840 printf(" %d", n_data);
17841 printf(" %d", n_len);
17855 test_xmlRelaxNGValidatePushElement(void) {
17858 #if defined(LIBXML_SCHEMAS_ENABLED)
17861 xmlRelaxNGValidCtxtPtr ctxt; /* the validation context */
17863 xmlDocPtr doc; /* a document instance */
17865 xmlNodePtr elem; /* an element instance */
17868 for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17869 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17870 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
17871 mem_base = xmlMemBlocks();
17872 ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17873 doc = gen_xmlDocPtr(n_doc, 1);
17874 elem = gen_xmlNodePtr(n_elem, 2);
17876 ret_val = xmlRelaxNGValidatePushElement(ctxt, doc, elem);
17877 desret_int(ret_val);
17879 des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17880 des_xmlDocPtr(n_doc, doc, 1);
17881 des_xmlNodePtr(n_elem, elem, 2);
17882 xmlResetLastError();
17883 if (mem_base != xmlMemBlocks()) {
17884 printf("Leak of %d blocks found in xmlRelaxNGValidatePushElement",
17885 xmlMemBlocks() - mem_base);
17887 printf(" %d", n_ctxt);
17888 printf(" %d", n_doc);
17889 printf(" %d", n_elem);
17903 test_xmlRelaxParserSetFlag(void) {
17906 #if defined(LIBXML_SCHEMAS_ENABLED)
17909 xmlRelaxNGParserCtxtPtr ctxt; /* a RelaxNG parser context */
17911 int flags; /* a set of flags values */
17914 for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGParserCtxtPtr;n_ctxt++) {
17915 for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
17916 mem_base = xmlMemBlocks();
17917 ctxt = gen_xmlRelaxNGParserCtxtPtr(n_ctxt, 0);
17918 flags = gen_int(n_flags, 1);
17920 ret_val = xmlRelaxParserSetFlag(ctxt, flags);
17921 desret_int(ret_val);
17923 des_xmlRelaxNGParserCtxtPtr(n_ctxt, ctxt, 0);
17924 des_int(n_flags, flags, 1);
17925 xmlResetLastError();
17926 if (mem_base != xmlMemBlocks()) {
17927 printf("Leak of %d blocks found in xmlRelaxParserSetFlag",
17928 xmlMemBlocks() - mem_base);
17930 printf(" %d", n_ctxt);
17931 printf(" %d", n_flags);
17943 test_relaxng(void) {
17946 if (quiet == 0) printf("Testing relaxng : 14 of 24 functions ...\n");
17947 test_ret += test_xmlRelaxNGDump();
17948 test_ret += test_xmlRelaxNGDumpTree();
17949 test_ret += test_xmlRelaxNGGetParserErrors();
17950 test_ret += test_xmlRelaxNGGetValidErrors();
17951 test_ret += test_xmlRelaxNGInitTypes();
17952 test_ret += test_xmlRelaxNGNewDocParserCtxt();
17953 test_ret += test_xmlRelaxNGNewMemParserCtxt();
17954 test_ret += test_xmlRelaxNGNewParserCtxt();
17955 test_ret += test_xmlRelaxNGNewValidCtxt();
17956 test_ret += test_xmlRelaxNGParse();
17957 test_ret += test_xmlRelaxNGSetParserErrors();
17958 test_ret += test_xmlRelaxNGSetParserStructuredErrors();
17959 test_ret += test_xmlRelaxNGSetValidErrors();
17960 test_ret += test_xmlRelaxNGSetValidStructuredErrors();
17961 test_ret += test_xmlRelaxNGValidateDoc();
17962 test_ret += test_xmlRelaxNGValidateFullElement();
17963 test_ret += test_xmlRelaxNGValidatePopElement();
17964 test_ret += test_xmlRelaxNGValidatePushCData();
17965 test_ret += test_xmlRelaxNGValidatePushElement();
17966 test_ret += test_xmlRelaxParserSetFlag();
17969 printf("Module relaxng: %d errors\n", test_ret);
17973 test_schemasInternals(void) {
17976 if (quiet == 0) printf("Testing schemasInternals : 0 of 2 functions ...\n");
17979 printf("Module schemasInternals: %d errors\n", test_ret);
17984 test_xmlSchematronNewDocParserCtxt(void) {
17988 /* missing type support */
17994 test_xmlSchematronNewMemParserCtxt(void) {
17998 /* missing type support */
18004 test_xmlSchematronNewParserCtxt(void) {
18008 /* missing type support */
18012 #ifdef LIBXML_SCHEMATRON_ENABLED
18014 #define gen_nb_xmlSchematronPtr 1
18015 static xmlSchematronPtr gen_xmlSchematronPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18018 static void des_xmlSchematronPtr(int no ATTRIBUTE_UNUSED, xmlSchematronPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18024 test_xmlSchematronNewValidCtxt(void) {
18028 /* missing type support */
18032 #ifdef LIBXML_SCHEMATRON_ENABLED
18034 #define gen_nb_xmlSchematronParserCtxtPtr 1
18035 static xmlSchematronParserCtxtPtr gen_xmlSchematronParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18038 static void des_xmlSchematronParserCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSchematronParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18044 test_xmlSchematronParse(void) {
18048 /* missing type support */
18052 #ifdef LIBXML_SCHEMATRON_ENABLED
18054 #define gen_nb_xmlSchematronValidCtxtPtr 1
18055 static xmlSchematronValidCtxtPtr gen_xmlSchematronValidCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18058 static void des_xmlSchematronValidCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSchematronValidCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18064 test_xmlSchematronSetValidStructuredErrors(void) {
18068 /* missing type support */
18074 test_xmlSchematronValidateDoc(void) {
18077 #if defined(LIBXML_SCHEMATRON_ENABLED)
18080 xmlSchematronValidCtxtPtr ctxt; /* the schema validation context */
18082 xmlDocPtr instance; /* the document instace tree */
18085 for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchematronValidCtxtPtr;n_ctxt++) {
18086 for (n_instance = 0;n_instance < gen_nb_xmlDocPtr;n_instance++) {
18087 mem_base = xmlMemBlocks();
18088 ctxt = gen_xmlSchematronValidCtxtPtr(n_ctxt, 0);
18089 instance = gen_xmlDocPtr(n_instance, 1);
18091 ret_val = xmlSchematronValidateDoc(ctxt, instance);
18092 desret_int(ret_val);
18094 des_xmlSchematronValidCtxtPtr(n_ctxt, ctxt, 0);
18095 des_xmlDocPtr(n_instance, instance, 1);
18096 xmlResetLastError();
18097 if (mem_base != xmlMemBlocks()) {
18098 printf("Leak of %d blocks found in xmlSchematronValidateDoc",
18099 xmlMemBlocks() - mem_base);
18101 printf(" %d", n_ctxt);
18102 printf(" %d", n_instance);
18114 test_schematron(void) {
18117 if (quiet == 0) printf("Testing schematron : 1 of 10 functions ...\n");
18118 test_ret += test_xmlSchematronNewDocParserCtxt();
18119 test_ret += test_xmlSchematronNewMemParserCtxt();
18120 test_ret += test_xmlSchematronNewParserCtxt();
18121 test_ret += test_xmlSchematronNewValidCtxt();
18122 test_ret += test_xmlSchematronParse();
18123 test_ret += test_xmlSchematronSetValidStructuredErrors();
18124 test_ret += test_xmlSchematronValidateDoc();
18127 printf("Module schematron: %d errors\n", test_ret);
18132 test_xmlAddChild(void) {
18136 xmlNodePtr ret_val;
18137 xmlNodePtr parent; /* the parent node */
18139 xmlNodePtr cur; /* the child node */
18142 for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
18143 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr_in;n_cur++) {
18144 mem_base = xmlMemBlocks();
18145 parent = gen_xmlNodePtr(n_parent, 0);
18146 cur = gen_xmlNodePtr_in(n_cur, 1);
18148 ret_val = xmlAddChild(parent, cur);
18149 if (ret_val == NULL) { xmlFreeNode(cur) ; cur = NULL ; }
18150 desret_xmlNodePtr(ret_val);
18152 des_xmlNodePtr(n_parent, parent, 0);
18153 des_xmlNodePtr_in(n_cur, cur, 1);
18154 xmlResetLastError();
18155 if (mem_base != xmlMemBlocks()) {
18156 printf("Leak of %d blocks found in xmlAddChild",
18157 xmlMemBlocks() - mem_base);
18159 printf(" %d", n_parent);
18160 printf(" %d", n_cur);
18172 test_xmlAddChildList(void) {
18176 xmlNodePtr ret_val;
18177 xmlNodePtr parent; /* the parent node */
18179 xmlNodePtr cur; /* the first node in the list */
18182 for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
18183 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr_in;n_cur++) {
18184 mem_base = xmlMemBlocks();
18185 parent = gen_xmlNodePtr(n_parent, 0);
18186 cur = gen_xmlNodePtr_in(n_cur, 1);
18188 ret_val = xmlAddChildList(parent, cur);
18189 if (ret_val == NULL) { xmlFreeNodeList(cur) ; cur = NULL ; }
18190 desret_xmlNodePtr(ret_val);
18192 des_xmlNodePtr(n_parent, parent, 0);
18193 des_xmlNodePtr_in(n_cur, cur, 1);
18194 xmlResetLastError();
18195 if (mem_base != xmlMemBlocks()) {
18196 printf("Leak of %d blocks found in xmlAddChildList",
18197 xmlMemBlocks() - mem_base);
18199 printf(" %d", n_parent);
18200 printf(" %d", n_cur);
18212 test_xmlAddNextSibling(void) {
18216 xmlNodePtr ret_val;
18217 xmlNodePtr cur; /* the child node */
18219 xmlNodePtr elem; /* the new node */
18222 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
18223 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr_in;n_elem++) {
18224 mem_base = xmlMemBlocks();
18225 cur = gen_xmlNodePtr(n_cur, 0);
18226 elem = gen_xmlNodePtr_in(n_elem, 1);
18228 ret_val = xmlAddNextSibling(cur, elem);
18229 if (ret_val == NULL) { xmlFreeNode(elem) ; elem = NULL ; }
18230 desret_xmlNodePtr(ret_val);
18232 des_xmlNodePtr(n_cur, cur, 0);
18233 des_xmlNodePtr_in(n_elem, elem, 1);
18234 xmlResetLastError();
18235 if (mem_base != xmlMemBlocks()) {
18236 printf("Leak of %d blocks found in xmlAddNextSibling",
18237 xmlMemBlocks() - mem_base);
18239 printf(" %d", n_cur);
18240 printf(" %d", n_elem);
18252 test_xmlAddPrevSibling(void) {
18255 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
18257 xmlNodePtr ret_val;
18258 xmlNodePtr cur; /* the child node */
18260 xmlNodePtr elem; /* the new node */
18263 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
18264 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr_in;n_elem++) {
18265 mem_base = xmlMemBlocks();
18266 cur = gen_xmlNodePtr(n_cur, 0);
18267 elem = gen_xmlNodePtr_in(n_elem, 1);
18269 ret_val = xmlAddPrevSibling(cur, elem);
18270 if (ret_val == NULL) { xmlFreeNode(elem) ; elem = NULL ; }
18271 desret_xmlNodePtr(ret_val);
18273 des_xmlNodePtr(n_cur, cur, 0);
18274 des_xmlNodePtr_in(n_elem, elem, 1);
18275 xmlResetLastError();
18276 if (mem_base != xmlMemBlocks()) {
18277 printf("Leak of %d blocks found in xmlAddPrevSibling",
18278 xmlMemBlocks() - mem_base);
18280 printf(" %d", n_cur);
18281 printf(" %d", n_elem);
18294 test_xmlAddSibling(void) {
18298 xmlNodePtr ret_val;
18299 xmlNodePtr cur; /* the child node */
18301 xmlNodePtr elem; /* the new node */
18304 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
18305 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr_in;n_elem++) {
18306 mem_base = xmlMemBlocks();
18307 cur = gen_xmlNodePtr(n_cur, 0);
18308 elem = gen_xmlNodePtr_in(n_elem, 1);
18310 ret_val = xmlAddSibling(cur, elem);
18311 if (ret_val == NULL) { xmlFreeNode(elem) ; elem = NULL ; }
18312 desret_xmlNodePtr(ret_val);
18314 des_xmlNodePtr(n_cur, cur, 0);
18315 des_xmlNodePtr_in(n_elem, elem, 1);
18316 xmlResetLastError();
18317 if (mem_base != xmlMemBlocks()) {
18318 printf("Leak of %d blocks found in xmlAddSibling",
18319 xmlMemBlocks() - mem_base);
18321 printf(" %d", n_cur);
18322 printf(" %d", n_elem);
18334 test_xmlAttrSerializeTxtContent(void) {
18337 #if defined(LIBXML_OUTPUT_ENABLED)
18338 #ifdef LIBXML_OUTPUT_ENABLED
18340 xmlBufferPtr buf; /* the XML buffer output */
18342 xmlDocPtr doc; /* the document */
18344 xmlAttrPtr attr; /* the attribute node */
18346 xmlChar * string; /* the text content */
18349 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18350 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
18351 for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
18352 for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
18353 mem_base = xmlMemBlocks();
18354 buf = gen_xmlBufferPtr(n_buf, 0);
18355 doc = gen_xmlDocPtr(n_doc, 1);
18356 attr = gen_xmlAttrPtr(n_attr, 2);
18357 string = gen_const_xmlChar_ptr(n_string, 3);
18359 xmlAttrSerializeTxtContent(buf, doc, attr, (const xmlChar *)string);
18361 des_xmlBufferPtr(n_buf, buf, 0);
18362 des_xmlDocPtr(n_doc, doc, 1);
18363 des_xmlAttrPtr(n_attr, attr, 2);
18364 des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 3);
18365 xmlResetLastError();
18366 if (mem_base != xmlMemBlocks()) {
18367 printf("Leak of %d blocks found in xmlAttrSerializeTxtContent",
18368 xmlMemBlocks() - mem_base);
18370 printf(" %d", n_buf);
18371 printf(" %d", n_doc);
18372 printf(" %d", n_attr);
18373 printf(" %d", n_string);
18389 test_xmlBufferAdd(void) {
18394 xmlBufferPtr buf; /* the buffer to dump */
18396 xmlChar * str; /* the #xmlChar string */
18398 int len; /* the number of #xmlChar to add */
18401 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18402 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
18403 for (n_len = 0;n_len < gen_nb_int;n_len++) {
18404 mem_base = xmlMemBlocks();
18405 buf = gen_xmlBufferPtr(n_buf, 0);
18406 str = gen_const_xmlChar_ptr(n_str, 1);
18407 len = gen_int(n_len, 2);
18409 ret_val = xmlBufferAdd(buf, (const xmlChar *)str, len);
18410 desret_int(ret_val);
18412 des_xmlBufferPtr(n_buf, buf, 0);
18413 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
18414 des_int(n_len, len, 2);
18415 xmlResetLastError();
18416 if (mem_base != xmlMemBlocks()) {
18417 printf("Leak of %d blocks found in xmlBufferAdd",
18418 xmlMemBlocks() - mem_base);
18420 printf(" %d", n_buf);
18421 printf(" %d", n_str);
18422 printf(" %d", n_len);
18435 test_xmlBufferAddHead(void) {
18440 xmlBufferPtr buf; /* the buffer */
18442 xmlChar * str; /* the #xmlChar string */
18444 int len; /* the number of #xmlChar to add */
18447 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18448 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
18449 for (n_len = 0;n_len < gen_nb_int;n_len++) {
18450 mem_base = xmlMemBlocks();
18451 buf = gen_xmlBufferPtr(n_buf, 0);
18452 str = gen_const_xmlChar_ptr(n_str, 1);
18453 len = gen_int(n_len, 2);
18455 ret_val = xmlBufferAddHead(buf, (const xmlChar *)str, len);
18456 desret_int(ret_val);
18458 des_xmlBufferPtr(n_buf, buf, 0);
18459 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
18460 des_int(n_len, len, 2);
18461 xmlResetLastError();
18462 if (mem_base != xmlMemBlocks()) {
18463 printf("Leak of %d blocks found in xmlBufferAddHead",
18464 xmlMemBlocks() - mem_base);
18466 printf(" %d", n_buf);
18467 printf(" %d", n_str);
18468 printf(" %d", n_len);
18481 test_xmlBufferCCat(void) {
18486 xmlBufferPtr buf; /* the buffer to dump */
18488 char * str; /* the C char string */
18491 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18492 for (n_str = 0;n_str < gen_nb_const_char_ptr;n_str++) {
18493 mem_base = xmlMemBlocks();
18494 buf = gen_xmlBufferPtr(n_buf, 0);
18495 str = gen_const_char_ptr(n_str, 1);
18497 ret_val = xmlBufferCCat(buf, (const char *)str);
18498 desret_int(ret_val);
18500 des_xmlBufferPtr(n_buf, buf, 0);
18501 des_const_char_ptr(n_str, (const char *)str, 1);
18502 xmlResetLastError();
18503 if (mem_base != xmlMemBlocks()) {
18504 printf("Leak of %d blocks found in xmlBufferCCat",
18505 xmlMemBlocks() - mem_base);
18507 printf(" %d", n_buf);
18508 printf(" %d", n_str);
18520 test_xmlBufferCat(void) {
18525 xmlBufferPtr buf; /* the buffer to add to */
18527 xmlChar * str; /* the #xmlChar string */
18530 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18531 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
18532 mem_base = xmlMemBlocks();
18533 buf = gen_xmlBufferPtr(n_buf, 0);
18534 str = gen_const_xmlChar_ptr(n_str, 1);
18536 ret_val = xmlBufferCat(buf, (const xmlChar *)str);
18537 desret_int(ret_val);
18539 des_xmlBufferPtr(n_buf, buf, 0);
18540 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
18541 xmlResetLastError();
18542 if (mem_base != xmlMemBlocks()) {
18543 printf("Leak of %d blocks found in xmlBufferCat",
18544 xmlMemBlocks() - mem_base);
18546 printf(" %d", n_buf);
18547 printf(" %d", n_str);
18558 #define gen_nb_const_xmlBufferPtr 1
18559 static xmlBufferPtr gen_const_xmlBufferPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18562 static void des_const_xmlBufferPtr(int no ATTRIBUTE_UNUSED, const xmlBufferPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18566 test_xmlBufferContent(void) {
18570 const xmlChar * ret_val;
18571 xmlBufferPtr buf; /* the buffer */
18574 for (n_buf = 0;n_buf < gen_nb_const_xmlBufferPtr;n_buf++) {
18575 mem_base = xmlMemBlocks();
18576 buf = gen_const_xmlBufferPtr(n_buf, 0);
18578 ret_val = xmlBufferContent((const xmlBufferPtr)buf);
18579 desret_const_xmlChar_ptr(ret_val);
18581 des_const_xmlBufferPtr(n_buf, (const xmlBufferPtr)buf, 0);
18582 xmlResetLastError();
18583 if (mem_base != xmlMemBlocks()) {
18584 printf("Leak of %d blocks found in xmlBufferContent",
18585 xmlMemBlocks() - mem_base);
18587 printf(" %d", n_buf);
18598 test_xmlBufferCreate(void) {
18602 xmlBufferPtr ret_val;
18604 mem_base = xmlMemBlocks();
18606 ret_val = xmlBufferCreate();
18607 desret_xmlBufferPtr(ret_val);
18609 xmlResetLastError();
18610 if (mem_base != xmlMemBlocks()) {
18611 printf("Leak of %d blocks found in xmlBufferCreate",
18612 xmlMemBlocks() - mem_base);
18623 test_xmlBufferCreateSize(void) {
18627 /* missing type support */
18633 test_xmlBufferCreateStatic(void) {
18637 /* missing type support */
18643 test_xmlBufferDetach(void) {
18648 xmlBufferPtr buf; /* the buffer */
18651 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18652 mem_base = xmlMemBlocks();
18653 buf = gen_xmlBufferPtr(n_buf, 0);
18655 ret_val = xmlBufferDetach(buf);
18656 desret_xmlChar_ptr(ret_val);
18658 des_xmlBufferPtr(n_buf, buf, 0);
18659 xmlResetLastError();
18660 if (mem_base != xmlMemBlocks()) {
18661 printf("Leak of %d blocks found in xmlBufferDetach",
18662 xmlMemBlocks() - mem_base);
18664 printf(" %d", n_buf);
18675 test_xmlBufferEmpty(void) {
18679 xmlBufferPtr buf; /* the buffer */
18682 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18683 mem_base = xmlMemBlocks();
18684 buf = gen_xmlBufferPtr(n_buf, 0);
18686 xmlBufferEmpty(buf);
18688 des_xmlBufferPtr(n_buf, buf, 0);
18689 xmlResetLastError();
18690 if (mem_base != xmlMemBlocks()) {
18691 printf("Leak of %d blocks found in xmlBufferEmpty",
18692 xmlMemBlocks() - mem_base);
18694 printf(" %d", n_buf);
18705 test_xmlBufferGrow(void) {
18710 xmlBufferPtr buf; /* the buffer */
18712 unsigned int len; /* the minimum free size to allocate */
18715 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18716 for (n_len = 0;n_len < gen_nb_unsigned_int;n_len++) {
18717 mem_base = xmlMemBlocks();
18718 buf = gen_xmlBufferPtr(n_buf, 0);
18719 len = gen_unsigned_int(n_len, 1);
18721 ret_val = xmlBufferGrow(buf, len);
18722 desret_int(ret_val);
18724 des_xmlBufferPtr(n_buf, buf, 0);
18725 des_unsigned_int(n_len, len, 1);
18726 xmlResetLastError();
18727 if (mem_base != xmlMemBlocks()) {
18728 printf("Leak of %d blocks found in xmlBufferGrow",
18729 xmlMemBlocks() - mem_base);
18731 printf(" %d", n_buf);
18732 printf(" %d", n_len);
18744 test_xmlBufferLength(void) {
18749 xmlBufferPtr buf; /* the buffer */
18752 for (n_buf = 0;n_buf < gen_nb_const_xmlBufferPtr;n_buf++) {
18753 mem_base = xmlMemBlocks();
18754 buf = gen_const_xmlBufferPtr(n_buf, 0);
18756 ret_val = xmlBufferLength((const xmlBufferPtr)buf);
18757 desret_int(ret_val);
18759 des_const_xmlBufferPtr(n_buf, (const xmlBufferPtr)buf, 0);
18760 xmlResetLastError();
18761 if (mem_base != xmlMemBlocks()) {
18762 printf("Leak of %d blocks found in xmlBufferLength",
18763 xmlMemBlocks() - mem_base);
18765 printf(" %d", n_buf);
18776 test_xmlBufferResize(void) {
18781 xmlBufferPtr buf; /* the buffer to resize */
18783 unsigned int size; /* the desired size */
18786 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18787 for (n_size = 0;n_size < gen_nb_unsigned_int;n_size++) {
18788 mem_base = xmlMemBlocks();
18789 buf = gen_xmlBufferPtr(n_buf, 0);
18790 size = gen_unsigned_int(n_size, 1);
18792 ret_val = xmlBufferResize(buf, size);
18793 desret_int(ret_val);
18795 des_xmlBufferPtr(n_buf, buf, 0);
18796 des_unsigned_int(n_size, size, 1);
18797 xmlResetLastError();
18798 if (mem_base != xmlMemBlocks()) {
18799 printf("Leak of %d blocks found in xmlBufferResize",
18800 xmlMemBlocks() - mem_base);
18802 printf(" %d", n_buf);
18803 printf(" %d", n_size);
18815 test_xmlBufferSetAllocationScheme(void) {
18819 xmlBufferPtr buf; /* the buffer to tune */
18821 xmlBufferAllocationScheme scheme; /* allocation scheme to use */
18824 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18825 for (n_scheme = 0;n_scheme < gen_nb_xmlBufferAllocationScheme;n_scheme++) {
18826 mem_base = xmlMemBlocks();
18827 buf = gen_xmlBufferPtr(n_buf, 0);
18828 scheme = gen_xmlBufferAllocationScheme(n_scheme, 1);
18830 xmlBufferSetAllocationScheme(buf, scheme);
18831 if ((buf != NULL) && (scheme == XML_BUFFER_ALLOC_IMMUTABLE) && (buf->content != NULL) && (buf->content != static_buf_content)) { xmlFree(buf->content); buf->content = NULL;}
18833 des_xmlBufferPtr(n_buf, buf, 0);
18834 des_xmlBufferAllocationScheme(n_scheme, scheme, 1);
18835 xmlResetLastError();
18836 if (mem_base != xmlMemBlocks()) {
18837 printf("Leak of %d blocks found in xmlBufferSetAllocationScheme",
18838 xmlMemBlocks() - mem_base);
18840 printf(" %d", n_buf);
18841 printf(" %d", n_scheme);
18853 test_xmlBufferShrink(void) {
18858 xmlBufferPtr buf; /* the buffer to dump */
18860 unsigned int len; /* the number of xmlChar to remove */
18863 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18864 for (n_len = 0;n_len < gen_nb_unsigned_int;n_len++) {
18865 mem_base = xmlMemBlocks();
18866 buf = gen_xmlBufferPtr(n_buf, 0);
18867 len = gen_unsigned_int(n_len, 1);
18869 ret_val = xmlBufferShrink(buf, len);
18870 desret_int(ret_val);
18872 des_xmlBufferPtr(n_buf, buf, 0);
18873 des_unsigned_int(n_len, len, 1);
18874 xmlResetLastError();
18875 if (mem_base != xmlMemBlocks()) {
18876 printf("Leak of %d blocks found in xmlBufferShrink",
18877 xmlMemBlocks() - mem_base);
18879 printf(" %d", n_buf);
18880 printf(" %d", n_len);
18892 test_xmlBufferWriteCHAR(void) {
18896 xmlBufferPtr buf; /* the XML buffer */
18898 xmlChar * string; /* the string to add */
18901 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18902 for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
18903 mem_base = xmlMemBlocks();
18904 buf = gen_xmlBufferPtr(n_buf, 0);
18905 string = gen_const_xmlChar_ptr(n_string, 1);
18907 xmlBufferWriteCHAR(buf, (const xmlChar *)string);
18909 des_xmlBufferPtr(n_buf, buf, 0);
18910 des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 1);
18911 xmlResetLastError();
18912 if (mem_base != xmlMemBlocks()) {
18913 printf("Leak of %d blocks found in xmlBufferWriteCHAR",
18914 xmlMemBlocks() - mem_base);
18916 printf(" %d", n_buf);
18917 printf(" %d", n_string);
18929 test_xmlBufferWriteChar(void) {
18933 xmlBufferPtr buf; /* the XML buffer output */
18935 char * string; /* the string to add */
18938 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18939 for (n_string = 0;n_string < gen_nb_const_char_ptr;n_string++) {
18940 mem_base = xmlMemBlocks();
18941 buf = gen_xmlBufferPtr(n_buf, 0);
18942 string = gen_const_char_ptr(n_string, 1);
18944 xmlBufferWriteChar(buf, (const char *)string);
18946 des_xmlBufferPtr(n_buf, buf, 0);
18947 des_const_char_ptr(n_string, (const char *)string, 1);
18948 xmlResetLastError();
18949 if (mem_base != xmlMemBlocks()) {
18950 printf("Leak of %d blocks found in xmlBufferWriteChar",
18951 xmlMemBlocks() - mem_base);
18953 printf(" %d", n_buf);
18954 printf(" %d", n_string);
18966 test_xmlBufferWriteQuotedString(void) {
18970 xmlBufferPtr buf; /* the XML buffer output */
18972 xmlChar * string; /* the string to add */
18975 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18976 for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
18977 mem_base = xmlMemBlocks();
18978 buf = gen_xmlBufferPtr(n_buf, 0);
18979 string = gen_const_xmlChar_ptr(n_string, 1);
18981 xmlBufferWriteQuotedString(buf, (const xmlChar *)string);
18983 des_xmlBufferPtr(n_buf, buf, 0);
18984 des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 1);
18985 xmlResetLastError();
18986 if (mem_base != xmlMemBlocks()) {
18987 printf("Leak of %d blocks found in xmlBufferWriteQuotedString",
18988 xmlMemBlocks() - mem_base);
18990 printf(" %d", n_buf);
18991 printf(" %d", n_string);
19003 test_xmlBuildQName(void) {
19008 xmlChar * ncname; /* the Name */
19010 xmlChar * prefix; /* the prefix */
19012 xmlChar * memory; /* preallocated memory */
19014 int len; /* preallocated memory length */
19017 for (n_ncname = 0;n_ncname < gen_nb_const_xmlChar_ptr;n_ncname++) {
19018 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
19019 for (n_memory = 0;n_memory < gen_nb_xmlChar_ptr;n_memory++) {
19020 for (n_len = 0;n_len < gen_nb_int;n_len++) {
19021 mem_base = xmlMemBlocks();
19022 ncname = gen_const_xmlChar_ptr(n_ncname, 0);
19023 prefix = gen_const_xmlChar_ptr(n_prefix, 1);
19024 memory = gen_xmlChar_ptr(n_memory, 2);
19025 len = gen_int(n_len, 3);
19027 ret_val = xmlBuildQName((const xmlChar *)ncname, (const xmlChar *)prefix, memory, len);
19028 if ((ret_val != NULL) && (ret_val != ncname) &&
19029 (ret_val != prefix) && (ret_val != memory))
19032 desret_xmlChar_ptr(ret_val);
19034 des_const_xmlChar_ptr(n_ncname, (const xmlChar *)ncname, 0);
19035 des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
19036 des_xmlChar_ptr(n_memory, memory, 2);
19037 des_int(n_len, len, 3);
19038 xmlResetLastError();
19039 if (mem_base != xmlMemBlocks()) {
19040 printf("Leak of %d blocks found in xmlBuildQName",
19041 xmlMemBlocks() - mem_base);
19043 printf(" %d", n_ncname);
19044 printf(" %d", n_prefix);
19045 printf(" %d", n_memory);
19046 printf(" %d", n_len);
19060 test_xmlChildElementCount(void) {
19063 #if defined(LIBXML_TREE_ENABLED)
19065 unsigned long ret_val;
19066 xmlNodePtr parent; /* the parent node */
19069 for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
19070 mem_base = xmlMemBlocks();
19071 parent = gen_xmlNodePtr(n_parent, 0);
19073 ret_val = xmlChildElementCount(parent);
19074 desret_unsigned_long(ret_val);
19076 des_xmlNodePtr(n_parent, parent, 0);
19077 xmlResetLastError();
19078 if (mem_base != xmlMemBlocks()) {
19079 printf("Leak of %d blocks found in xmlChildElementCount",
19080 xmlMemBlocks() - mem_base);
19082 printf(" %d", n_parent);
19094 test_xmlCopyDoc(void) {
19097 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
19100 xmlDocPtr doc; /* the document */
19102 int recursive; /* if not zero do a recursive copy. */
19105 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19106 for (n_recursive = 0;n_recursive < gen_nb_int;n_recursive++) {
19107 mem_base = xmlMemBlocks();
19108 doc = gen_xmlDocPtr(n_doc, 0);
19109 recursive = gen_int(n_recursive, 1);
19111 ret_val = xmlCopyDoc(doc, recursive);
19112 desret_xmlDocPtr(ret_val);
19114 des_xmlDocPtr(n_doc, doc, 0);
19115 des_int(n_recursive, recursive, 1);
19116 xmlResetLastError();
19117 if (mem_base != xmlMemBlocks()) {
19118 printf("Leak of %d blocks found in xmlCopyDoc",
19119 xmlMemBlocks() - mem_base);
19121 printf(" %d", n_doc);
19122 printf(" %d", n_recursive);
19135 test_xmlCopyDtd(void) {
19138 #if defined(LIBXML_TREE_ENABLED)
19141 xmlDtdPtr dtd; /* the dtd */
19144 for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
19145 mem_base = xmlMemBlocks();
19146 dtd = gen_xmlDtdPtr(n_dtd, 0);
19148 ret_val = xmlCopyDtd(dtd);
19149 desret_xmlDtdPtr(ret_val);
19151 des_xmlDtdPtr(n_dtd, dtd, 0);
19152 xmlResetLastError();
19153 if (mem_base != xmlMemBlocks()) {
19154 printf("Leak of %d blocks found in xmlCopyDtd",
19155 xmlMemBlocks() - mem_base);
19157 printf(" %d", n_dtd);
19169 test_xmlCopyNamespace(void) {
19174 xmlNsPtr cur; /* the namespace */
19177 for (n_cur = 0;n_cur < gen_nb_xmlNsPtr;n_cur++) {
19178 mem_base = xmlMemBlocks();
19179 cur = gen_xmlNsPtr(n_cur, 0);
19181 ret_val = xmlCopyNamespace(cur);
19182 if (ret_val != NULL) xmlFreeNs(ret_val);
19183 desret_xmlNsPtr(ret_val);
19185 des_xmlNsPtr(n_cur, cur, 0);
19186 xmlResetLastError();
19187 if (mem_base != xmlMemBlocks()) {
19188 printf("Leak of %d blocks found in xmlCopyNamespace",
19189 xmlMemBlocks() - mem_base);
19191 printf(" %d", n_cur);
19202 test_xmlCopyNamespaceList(void) {
19207 xmlNsPtr cur; /* the first namespace */
19210 for (n_cur = 0;n_cur < gen_nb_xmlNsPtr;n_cur++) {
19211 mem_base = xmlMemBlocks();
19212 cur = gen_xmlNsPtr(n_cur, 0);
19214 ret_val = xmlCopyNamespaceList(cur);
19215 if (ret_val != NULL) xmlFreeNsList(ret_val);
19216 desret_xmlNsPtr(ret_val);
19218 des_xmlNsPtr(n_cur, cur, 0);
19219 xmlResetLastError();
19220 if (mem_base != xmlMemBlocks()) {
19221 printf("Leak of %d blocks found in xmlCopyNamespaceList",
19222 xmlMemBlocks() - mem_base);
19224 printf(" %d", n_cur);
19235 test_xmlCopyNode(void) {
19239 xmlNodePtr ret_val;
19240 xmlNodePtr node; /* the node */
19242 int extended; /* if 1 do a recursive copy (properties, namespaces and children when applicable) if 2 copy properties and namespaces (when applicable) */
19245 for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
19246 for (n_extended = 0;n_extended < gen_nb_int;n_extended++) {
19247 mem_base = xmlMemBlocks();
19248 node = gen_const_xmlNodePtr(n_node, 0);
19249 extended = gen_int(n_extended, 1);
19251 ret_val = xmlCopyNode((const xmlNodePtr)node, extended);
19252 desret_xmlNodePtr(ret_val);
19254 des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 0);
19255 des_int(n_extended, extended, 1);
19256 xmlResetLastError();
19257 if (mem_base != xmlMemBlocks()) {
19258 printf("Leak of %d blocks found in xmlCopyNode",
19259 xmlMemBlocks() - mem_base);
19261 printf(" %d", n_node);
19262 printf(" %d", n_extended);
19274 test_xmlCopyNodeList(void) {
19278 xmlNodePtr ret_val;
19279 xmlNodePtr node; /* the first node in the list. */
19282 for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
19283 mem_base = xmlMemBlocks();
19284 node = gen_const_xmlNodePtr(n_node, 0);
19286 ret_val = xmlCopyNodeList((const xmlNodePtr)node);
19287 desret_xmlNodePtr(ret_val);
19289 des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 0);
19290 xmlResetLastError();
19291 if (mem_base != xmlMemBlocks()) {
19292 printf("Leak of %d blocks found in xmlCopyNodeList",
19293 xmlMemBlocks() - mem_base);
19295 printf(" %d", n_node);
19306 test_xmlCopyProp(void) {
19310 xmlAttrPtr ret_val;
19311 xmlNodePtr target; /* the element where the attribute will be grafted */
19313 xmlAttrPtr cur; /* the attribute */
19316 for (n_target = 0;n_target < gen_nb_xmlNodePtr;n_target++) {
19317 for (n_cur = 0;n_cur < gen_nb_xmlAttrPtr;n_cur++) {
19318 mem_base = xmlMemBlocks();
19319 target = gen_xmlNodePtr(n_target, 0);
19320 cur = gen_xmlAttrPtr(n_cur, 1);
19322 ret_val = xmlCopyProp(target, cur);
19323 desret_xmlAttrPtr(ret_val);
19325 des_xmlNodePtr(n_target, target, 0);
19326 des_xmlAttrPtr(n_cur, cur, 1);
19327 xmlResetLastError();
19328 if (mem_base != xmlMemBlocks()) {
19329 printf("Leak of %d blocks found in xmlCopyProp",
19330 xmlMemBlocks() - mem_base);
19332 printf(" %d", n_target);
19333 printf(" %d", n_cur);
19345 test_xmlCopyPropList(void) {
19349 xmlAttrPtr ret_val;
19350 xmlNodePtr target; /* the element where the attributes will be grafted */
19352 xmlAttrPtr cur; /* the first attribute */
19355 for (n_target = 0;n_target < gen_nb_xmlNodePtr;n_target++) {
19356 for (n_cur = 0;n_cur < gen_nb_xmlAttrPtr;n_cur++) {
19357 mem_base = xmlMemBlocks();
19358 target = gen_xmlNodePtr(n_target, 0);
19359 cur = gen_xmlAttrPtr(n_cur, 1);
19361 ret_val = xmlCopyPropList(target, cur);
19362 desret_xmlAttrPtr(ret_val);
19364 des_xmlNodePtr(n_target, target, 0);
19365 des_xmlAttrPtr(n_cur, cur, 1);
19366 xmlResetLastError();
19367 if (mem_base != xmlMemBlocks()) {
19368 printf("Leak of %d blocks found in xmlCopyPropList",
19369 xmlMemBlocks() - mem_base);
19371 printf(" %d", n_target);
19372 printf(" %d", n_cur);
19384 test_xmlCreateIntSubset(void) {
19389 xmlDocPtr doc; /* the document pointer */
19391 xmlChar * name; /* the DTD name */
19393 xmlChar * ExternalID; /* the external (PUBLIC) ID */
19395 xmlChar * SystemID; /* the system ID */
19398 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19399 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
19400 for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
19401 for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
19402 mem_base = xmlMemBlocks();
19403 doc = gen_xmlDocPtr(n_doc, 0);
19404 name = gen_const_xmlChar_ptr(n_name, 1);
19405 ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 2);
19406 SystemID = gen_const_xmlChar_ptr(n_SystemID, 3);
19408 ret_val = xmlCreateIntSubset(doc, (const xmlChar *)name, (const xmlChar *)ExternalID, (const xmlChar *)SystemID);
19409 desret_xmlDtdPtr(ret_val);
19411 des_xmlDocPtr(n_doc, doc, 0);
19412 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
19413 des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 2);
19414 des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 3);
19415 xmlResetLastError();
19416 if (mem_base != xmlMemBlocks()) {
19417 printf("Leak of %d blocks found in xmlCreateIntSubset",
19418 xmlMemBlocks() - mem_base);
19420 printf(" %d", n_doc);
19421 printf(" %d", n_name);
19422 printf(" %d", n_ExternalID);
19423 printf(" %d", n_SystemID);
19436 #define gen_nb_xmlDOMWrapCtxtPtr 1
19437 static xmlDOMWrapCtxtPtr gen_xmlDOMWrapCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
19440 static void des_xmlDOMWrapCtxtPtr(int no ATTRIBUTE_UNUSED, xmlDOMWrapCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
19444 test_xmlDOMWrapAdoptNode(void) {
19449 xmlDOMWrapCtxtPtr ctxt; /* the optional context for custom processing */
19451 xmlDocPtr sourceDoc; /* the optional sourceDoc */
19453 xmlNodePtr node; /* the node to start with */
19455 xmlDocPtr destDoc; /* the destination doc */
19457 xmlNodePtr destParent; /* the optional new parent of @node in @destDoc */
19459 int options; /* option flags */
19462 for (n_ctxt = 0;n_ctxt < gen_nb_xmlDOMWrapCtxtPtr;n_ctxt++) {
19463 for (n_sourceDoc = 0;n_sourceDoc < gen_nb_xmlDocPtr;n_sourceDoc++) {
19464 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
19465 for (n_destDoc = 0;n_destDoc < gen_nb_xmlDocPtr;n_destDoc++) {
19466 for (n_destParent = 0;n_destParent < gen_nb_xmlNodePtr;n_destParent++) {
19467 for (n_options = 0;n_options < gen_nb_int;n_options++) {
19468 mem_base = xmlMemBlocks();
19469 ctxt = gen_xmlDOMWrapCtxtPtr(n_ctxt, 0);
19470 sourceDoc = gen_xmlDocPtr(n_sourceDoc, 1);
19471 node = gen_xmlNodePtr(n_node, 2);
19472 destDoc = gen_xmlDocPtr(n_destDoc, 3);
19473 destParent = gen_xmlNodePtr(n_destParent, 4);
19474 options = gen_int(n_options, 5);
19476 ret_val = xmlDOMWrapAdoptNode(ctxt, sourceDoc, node, destDoc, destParent, options);
19477 if ((node != NULL) && (node->parent == NULL)) {xmlUnlinkNode(node);xmlFreeNode(node);node = NULL;}
19478 desret_int(ret_val);
19480 des_xmlDOMWrapCtxtPtr(n_ctxt, ctxt, 0);
19481 des_xmlDocPtr(n_sourceDoc, sourceDoc, 1);
19482 des_xmlNodePtr(n_node, node, 2);
19483 des_xmlDocPtr(n_destDoc, destDoc, 3);
19484 des_xmlNodePtr(n_destParent, destParent, 4);
19485 des_int(n_options, options, 5);
19486 xmlResetLastError();
19487 if (mem_base != xmlMemBlocks()) {
19488 printf("Leak of %d blocks found in xmlDOMWrapAdoptNode",
19489 xmlMemBlocks() - mem_base);
19491 printf(" %d", n_ctxt);
19492 printf(" %d", n_sourceDoc);
19493 printf(" %d", n_node);
19494 printf(" %d", n_destDoc);
19495 printf(" %d", n_destParent);
19496 printf(" %d", n_options);
19512 test_xmlDOMWrapCloneNode(void) {
19517 xmlDOMWrapCtxtPtr ctxt; /* the optional context for custom processing */
19519 xmlDocPtr sourceDoc; /* the optional sourceDoc */
19521 xmlNodePtr node; /* the node to start with */
19523 xmlNodePtr * resNode; /* the clone of the given @node */
19525 xmlDocPtr destDoc; /* the destination doc */
19527 xmlNodePtr destParent; /* the optional new parent of @node in @destDoc */
19529 int deep; /* descend into child if set */
19531 int options; /* option flags */
19534 for (n_ctxt = 0;n_ctxt < gen_nb_xmlDOMWrapCtxtPtr;n_ctxt++) {
19535 for (n_sourceDoc = 0;n_sourceDoc < gen_nb_xmlDocPtr;n_sourceDoc++) {
19536 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
19537 for (n_resNode = 0;n_resNode < gen_nb_xmlNodePtr_ptr;n_resNode++) {
19538 for (n_destDoc = 0;n_destDoc < gen_nb_xmlDocPtr;n_destDoc++) {
19539 for (n_destParent = 0;n_destParent < gen_nb_xmlNodePtr;n_destParent++) {
19540 for (n_deep = 0;n_deep < gen_nb_int;n_deep++) {
19541 for (n_options = 0;n_options < gen_nb_int;n_options++) {
19542 mem_base = xmlMemBlocks();
19543 ctxt = gen_xmlDOMWrapCtxtPtr(n_ctxt, 0);
19544 sourceDoc = gen_xmlDocPtr(n_sourceDoc, 1);
19545 node = gen_xmlNodePtr(n_node, 2);
19546 resNode = gen_xmlNodePtr_ptr(n_resNode, 3);
19547 destDoc = gen_xmlDocPtr(n_destDoc, 4);
19548 destParent = gen_xmlNodePtr(n_destParent, 5);
19549 deep = gen_int(n_deep, 6);
19550 options = gen_int(n_options, 7);
19552 ret_val = xmlDOMWrapCloneNode(ctxt, sourceDoc, node, resNode, destDoc, destParent, deep, options);
19553 desret_int(ret_val);
19555 des_xmlDOMWrapCtxtPtr(n_ctxt, ctxt, 0);
19556 des_xmlDocPtr(n_sourceDoc, sourceDoc, 1);
19557 des_xmlNodePtr(n_node, node, 2);
19558 des_xmlNodePtr_ptr(n_resNode, resNode, 3);
19559 des_xmlDocPtr(n_destDoc, destDoc, 4);
19560 des_xmlNodePtr(n_destParent, destParent, 5);
19561 des_int(n_deep, deep, 6);
19562 des_int(n_options, options, 7);
19563 xmlResetLastError();
19564 if (mem_base != xmlMemBlocks()) {
19565 printf("Leak of %d blocks found in xmlDOMWrapCloneNode",
19566 xmlMemBlocks() - mem_base);
19568 printf(" %d", n_ctxt);
19569 printf(" %d", n_sourceDoc);
19570 printf(" %d", n_node);
19571 printf(" %d", n_resNode);
19572 printf(" %d", n_destDoc);
19573 printf(" %d", n_destParent);
19574 printf(" %d", n_deep);
19575 printf(" %d", n_options);
19593 test_xmlDOMWrapNewCtxt(void) {
19597 /* missing type support */
19603 test_xmlDOMWrapReconcileNamespaces(void) {
19608 xmlDOMWrapCtxtPtr ctxt; /* DOM wrapper context, unused at the moment */
19610 xmlNodePtr elem; /* the element-node */
19612 int options; /* option flags */
19615 for (n_ctxt = 0;n_ctxt < gen_nb_xmlDOMWrapCtxtPtr;n_ctxt++) {
19616 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
19617 for (n_options = 0;n_options < gen_nb_int;n_options++) {
19618 mem_base = xmlMemBlocks();
19619 ctxt = gen_xmlDOMWrapCtxtPtr(n_ctxt, 0);
19620 elem = gen_xmlNodePtr(n_elem, 1);
19621 options = gen_int(n_options, 2);
19623 ret_val = xmlDOMWrapReconcileNamespaces(ctxt, elem, options);
19624 desret_int(ret_val);
19626 des_xmlDOMWrapCtxtPtr(n_ctxt, ctxt, 0);
19627 des_xmlNodePtr(n_elem, elem, 1);
19628 des_int(n_options, options, 2);
19629 xmlResetLastError();
19630 if (mem_base != xmlMemBlocks()) {
19631 printf("Leak of %d blocks found in xmlDOMWrapReconcileNamespaces",
19632 xmlMemBlocks() - mem_base);
19634 printf(" %d", n_ctxt);
19635 printf(" %d", n_elem);
19636 printf(" %d", n_options);
19649 test_xmlDOMWrapRemoveNode(void) {
19654 xmlDOMWrapCtxtPtr ctxt; /* a DOM wrapper context */
19656 xmlDocPtr doc; /* the doc */
19658 xmlNodePtr node; /* the node to be removed. */
19660 int options; /* set of options, unused at the moment */
19663 for (n_ctxt = 0;n_ctxt < gen_nb_xmlDOMWrapCtxtPtr;n_ctxt++) {
19664 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19665 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
19666 for (n_options = 0;n_options < gen_nb_int;n_options++) {
19667 mem_base = xmlMemBlocks();
19668 ctxt = gen_xmlDOMWrapCtxtPtr(n_ctxt, 0);
19669 doc = gen_xmlDocPtr(n_doc, 1);
19670 node = gen_xmlNodePtr(n_node, 2);
19671 options = gen_int(n_options, 3);
19673 ret_val = xmlDOMWrapRemoveNode(ctxt, doc, node, options);
19674 desret_int(ret_val);
19676 des_xmlDOMWrapCtxtPtr(n_ctxt, ctxt, 0);
19677 des_xmlDocPtr(n_doc, doc, 1);
19678 des_xmlNodePtr(n_node, node, 2);
19679 des_int(n_options, options, 3);
19680 xmlResetLastError();
19681 if (mem_base != xmlMemBlocks()) {
19682 printf("Leak of %d blocks found in xmlDOMWrapRemoveNode",
19683 xmlMemBlocks() - mem_base);
19685 printf(" %d", n_ctxt);
19686 printf(" %d", n_doc);
19687 printf(" %d", n_node);
19688 printf(" %d", n_options);
19702 test_xmlDocCopyNode(void) {
19706 xmlNodePtr ret_val;
19707 xmlNodePtr node; /* the node */
19709 xmlDocPtr doc; /* the document */
19711 int extended; /* if 1 do a recursive copy (properties, namespaces and children when applicable) if 2 copy properties and namespaces (when applicable) */
19714 for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
19715 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19716 for (n_extended = 0;n_extended < gen_nb_int;n_extended++) {
19717 mem_base = xmlMemBlocks();
19718 node = gen_const_xmlNodePtr(n_node, 0);
19719 doc = gen_xmlDocPtr(n_doc, 1);
19720 extended = gen_int(n_extended, 2);
19722 ret_val = xmlDocCopyNode((const xmlNodePtr)node, doc, extended);
19723 desret_xmlNodePtr(ret_val);
19725 des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 0);
19726 des_xmlDocPtr(n_doc, doc, 1);
19727 des_int(n_extended, extended, 2);
19728 xmlResetLastError();
19729 if (mem_base != xmlMemBlocks()) {
19730 printf("Leak of %d blocks found in xmlDocCopyNode",
19731 xmlMemBlocks() - mem_base);
19733 printf(" %d", n_node);
19734 printf(" %d", n_doc);
19735 printf(" %d", n_extended);
19748 test_xmlDocCopyNodeList(void) {
19752 xmlNodePtr ret_val;
19753 xmlDocPtr doc; /* the target document */
19755 xmlNodePtr node; /* the first node in the list. */
19758 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19759 for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
19760 mem_base = xmlMemBlocks();
19761 doc = gen_xmlDocPtr(n_doc, 0);
19762 node = gen_const_xmlNodePtr(n_node, 1);
19764 ret_val = xmlDocCopyNodeList(doc, (const xmlNodePtr)node);
19765 desret_xmlNodePtr(ret_val);
19767 des_xmlDocPtr(n_doc, doc, 0);
19768 des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 1);
19769 xmlResetLastError();
19770 if (mem_base != xmlMemBlocks()) {
19771 printf("Leak of %d blocks found in xmlDocCopyNodeList",
19772 xmlMemBlocks() - mem_base);
19774 printf(" %d", n_doc);
19775 printf(" %d", n_node);
19787 test_xmlDocDump(void) {
19790 #if defined(LIBXML_OUTPUT_ENABLED)
19793 FILE * f; /* the FILE* */
19795 xmlDocPtr cur; /* the document */
19798 for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) {
19799 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
19800 mem_base = xmlMemBlocks();
19801 f = gen_FILE_ptr(n_f, 0);
19802 cur = gen_xmlDocPtr(n_cur, 1);
19804 ret_val = xmlDocDump(f, cur);
19805 desret_int(ret_val);
19807 des_FILE_ptr(n_f, f, 0);
19808 des_xmlDocPtr(n_cur, cur, 1);
19809 xmlResetLastError();
19810 if (mem_base != xmlMemBlocks()) {
19811 printf("Leak of %d blocks found in xmlDocDump",
19812 xmlMemBlocks() - mem_base);
19814 printf(" %d", n_f);
19815 printf(" %d", n_cur);
19828 test_xmlDocDumpFormatMemory(void) {
19831 #if defined(LIBXML_OUTPUT_ENABLED)
19833 xmlDocPtr cur; /* the document */
19835 xmlChar ** mem; /* OUT: the memory pointer */
19837 int * size; /* OUT: the memory length */
19839 int format; /* should formatting spaces been added */
19842 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
19843 for (n_mem = 0;n_mem < gen_nb_xmlChar_ptr_ptr;n_mem++) {
19844 for (n_size = 0;n_size < gen_nb_int_ptr;n_size++) {
19845 for (n_format = 0;n_format < gen_nb_int;n_format++) {
19846 mem_base = xmlMemBlocks();
19847 cur = gen_xmlDocPtr(n_cur, 0);
19848 mem = gen_xmlChar_ptr_ptr(n_mem, 1);
19849 size = gen_int_ptr(n_size, 2);
19850 format = gen_int(n_format, 3);
19852 xmlDocDumpFormatMemory(cur, mem, size, format);
19854 des_xmlDocPtr(n_cur, cur, 0);
19855 des_xmlChar_ptr_ptr(n_mem, mem, 1);
19856 des_int_ptr(n_size, size, 2);
19857 des_int(n_format, format, 3);
19858 xmlResetLastError();
19859 if (mem_base != xmlMemBlocks()) {
19860 printf("Leak of %d blocks found in xmlDocDumpFormatMemory",
19861 xmlMemBlocks() - mem_base);
19863 printf(" %d", n_cur);
19864 printf(" %d", n_mem);
19865 printf(" %d", n_size);
19866 printf(" %d", n_format);
19881 test_xmlDocDumpFormatMemoryEnc(void) {
19884 #if defined(LIBXML_OUTPUT_ENABLED)
19886 xmlDocPtr out_doc; /* Document to generate XML text from */
19888 xmlChar ** doc_txt_ptr; /* Memory pointer for allocated XML text */
19890 int * doc_txt_len; /* Length of the generated XML text */
19892 char * txt_encoding; /* Character encoding to use when generating XML text */
19893 int n_txt_encoding;
19894 int format; /* should formatting spaces been added */
19897 for (n_out_doc = 0;n_out_doc < gen_nb_xmlDocPtr;n_out_doc++) {
19898 for (n_doc_txt_ptr = 0;n_doc_txt_ptr < gen_nb_xmlChar_ptr_ptr;n_doc_txt_ptr++) {
19899 for (n_doc_txt_len = 0;n_doc_txt_len < gen_nb_int_ptr;n_doc_txt_len++) {
19900 for (n_txt_encoding = 0;n_txt_encoding < gen_nb_const_char_ptr;n_txt_encoding++) {
19901 for (n_format = 0;n_format < gen_nb_int;n_format++) {
19902 mem_base = xmlMemBlocks();
19903 out_doc = gen_xmlDocPtr(n_out_doc, 0);
19904 doc_txt_ptr = gen_xmlChar_ptr_ptr(n_doc_txt_ptr, 1);
19905 doc_txt_len = gen_int_ptr(n_doc_txt_len, 2);
19906 txt_encoding = gen_const_char_ptr(n_txt_encoding, 3);
19907 format = gen_int(n_format, 4);
19909 xmlDocDumpFormatMemoryEnc(out_doc, doc_txt_ptr, doc_txt_len, (const char *)txt_encoding, format);
19911 des_xmlDocPtr(n_out_doc, out_doc, 0);
19912 des_xmlChar_ptr_ptr(n_doc_txt_ptr, doc_txt_ptr, 1);
19913 des_int_ptr(n_doc_txt_len, doc_txt_len, 2);
19914 des_const_char_ptr(n_txt_encoding, (const char *)txt_encoding, 3);
19915 des_int(n_format, format, 4);
19916 xmlResetLastError();
19917 if (mem_base != xmlMemBlocks()) {
19918 printf("Leak of %d blocks found in xmlDocDumpFormatMemoryEnc",
19919 xmlMemBlocks() - mem_base);
19921 printf(" %d", n_out_doc);
19922 printf(" %d", n_doc_txt_ptr);
19923 printf(" %d", n_doc_txt_len);
19924 printf(" %d", n_txt_encoding);
19925 printf(" %d", n_format);
19941 test_xmlDocDumpMemory(void) {
19944 #if defined(LIBXML_OUTPUT_ENABLED)
19946 xmlDocPtr cur; /* the document */
19948 xmlChar ** mem; /* OUT: the memory pointer */
19950 int * size; /* OUT: the memory length */
19953 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
19954 for (n_mem = 0;n_mem < gen_nb_xmlChar_ptr_ptr;n_mem++) {
19955 for (n_size = 0;n_size < gen_nb_int_ptr;n_size++) {
19956 mem_base = xmlMemBlocks();
19957 cur = gen_xmlDocPtr(n_cur, 0);
19958 mem = gen_xmlChar_ptr_ptr(n_mem, 1);
19959 size = gen_int_ptr(n_size, 2);
19961 xmlDocDumpMemory(cur, mem, size);
19963 des_xmlDocPtr(n_cur, cur, 0);
19964 des_xmlChar_ptr_ptr(n_mem, mem, 1);
19965 des_int_ptr(n_size, size, 2);
19966 xmlResetLastError();
19967 if (mem_base != xmlMemBlocks()) {
19968 printf("Leak of %d blocks found in xmlDocDumpMemory",
19969 xmlMemBlocks() - mem_base);
19971 printf(" %d", n_cur);
19972 printf(" %d", n_mem);
19973 printf(" %d", n_size);
19987 test_xmlDocDumpMemoryEnc(void) {
19990 #if defined(LIBXML_OUTPUT_ENABLED)
19992 xmlDocPtr out_doc; /* Document to generate XML text from */
19994 xmlChar ** doc_txt_ptr; /* Memory pointer for allocated XML text */
19996 int * doc_txt_len; /* Length of the generated XML text */
19998 char * txt_encoding; /* Character encoding to use when generating XML text */
19999 int n_txt_encoding;
20001 for (n_out_doc = 0;n_out_doc < gen_nb_xmlDocPtr;n_out_doc++) {
20002 for (n_doc_txt_ptr = 0;n_doc_txt_ptr < gen_nb_xmlChar_ptr_ptr;n_doc_txt_ptr++) {
20003 for (n_doc_txt_len = 0;n_doc_txt_len < gen_nb_int_ptr;n_doc_txt_len++) {
20004 for (n_txt_encoding = 0;n_txt_encoding < gen_nb_const_char_ptr;n_txt_encoding++) {
20005 mem_base = xmlMemBlocks();
20006 out_doc = gen_xmlDocPtr(n_out_doc, 0);
20007 doc_txt_ptr = gen_xmlChar_ptr_ptr(n_doc_txt_ptr, 1);
20008 doc_txt_len = gen_int_ptr(n_doc_txt_len, 2);
20009 txt_encoding = gen_const_char_ptr(n_txt_encoding, 3);
20011 xmlDocDumpMemoryEnc(out_doc, doc_txt_ptr, doc_txt_len, (const char *)txt_encoding);
20013 des_xmlDocPtr(n_out_doc, out_doc, 0);
20014 des_xmlChar_ptr_ptr(n_doc_txt_ptr, doc_txt_ptr, 1);
20015 des_int_ptr(n_doc_txt_len, doc_txt_len, 2);
20016 des_const_char_ptr(n_txt_encoding, (const char *)txt_encoding, 3);
20017 xmlResetLastError();
20018 if (mem_base != xmlMemBlocks()) {
20019 printf("Leak of %d blocks found in xmlDocDumpMemoryEnc",
20020 xmlMemBlocks() - mem_base);
20022 printf(" %d", n_out_doc);
20023 printf(" %d", n_doc_txt_ptr);
20024 printf(" %d", n_doc_txt_len);
20025 printf(" %d", n_txt_encoding);
20040 test_xmlDocFormatDump(void) {
20043 #if defined(LIBXML_OUTPUT_ENABLED)
20046 FILE * f; /* the FILE* */
20048 xmlDocPtr cur; /* the document */
20050 int format; /* should formatting spaces been added */
20053 for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) {
20054 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
20055 for (n_format = 0;n_format < gen_nb_int;n_format++) {
20056 mem_base = xmlMemBlocks();
20057 f = gen_FILE_ptr(n_f, 0);
20058 cur = gen_xmlDocPtr(n_cur, 1);
20059 format = gen_int(n_format, 2);
20061 ret_val = xmlDocFormatDump(f, cur, format);
20062 desret_int(ret_val);
20064 des_FILE_ptr(n_f, f, 0);
20065 des_xmlDocPtr(n_cur, cur, 1);
20066 des_int(n_format, format, 2);
20067 xmlResetLastError();
20068 if (mem_base != xmlMemBlocks()) {
20069 printf("Leak of %d blocks found in xmlDocFormatDump",
20070 xmlMemBlocks() - mem_base);
20072 printf(" %d", n_f);
20073 printf(" %d", n_cur);
20074 printf(" %d", n_format);
20088 test_xmlDocGetRootElement(void) {
20092 xmlNodePtr ret_val;
20093 xmlDocPtr doc; /* the document */
20096 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20097 mem_base = xmlMemBlocks();
20098 doc = gen_xmlDocPtr(n_doc, 0);
20100 ret_val = xmlDocGetRootElement(doc);
20101 desret_xmlNodePtr(ret_val);
20103 des_xmlDocPtr(n_doc, doc, 0);
20104 xmlResetLastError();
20105 if (mem_base != xmlMemBlocks()) {
20106 printf("Leak of %d blocks found in xmlDocGetRootElement",
20107 xmlMemBlocks() - mem_base);
20109 printf(" %d", n_doc);
20120 test_xmlDocSetRootElement(void) {
20123 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED)
20125 xmlNodePtr ret_val;
20126 xmlDocPtr doc; /* the document */
20128 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. */
20131 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20132 for (n_root = 0;n_root < gen_nb_xmlNodePtr_in;n_root++) {
20133 mem_base = xmlMemBlocks();
20134 doc = gen_xmlDocPtr(n_doc, 0);
20135 root = gen_xmlNodePtr_in(n_root, 1);
20137 ret_val = xmlDocSetRootElement(doc, root);
20138 if (doc == NULL) { xmlFreeNode(root) ; root = NULL ; }
20139 desret_xmlNodePtr(ret_val);
20141 des_xmlDocPtr(n_doc, doc, 0);
20142 des_xmlNodePtr_in(n_root, root, 1);
20143 xmlResetLastError();
20144 if (mem_base != xmlMemBlocks()) {
20145 printf("Leak of %d blocks found in xmlDocSetRootElement",
20146 xmlMemBlocks() - mem_base);
20148 printf(" %d", n_doc);
20149 printf(" %d", n_root);
20162 test_xmlElemDump(void) {
20165 #if defined(LIBXML_OUTPUT_ENABLED)
20167 FILE * f; /* the FILE * for the output */
20169 xmlDocPtr doc; /* the document */
20171 xmlNodePtr cur; /* the current node */
20174 for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) {
20175 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20176 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
20177 mem_base = xmlMemBlocks();
20178 f = gen_FILE_ptr(n_f, 0);
20179 doc = gen_xmlDocPtr(n_doc, 1);
20180 cur = gen_xmlNodePtr(n_cur, 2);
20182 xmlElemDump(f, doc, cur);
20184 des_FILE_ptr(n_f, f, 0);
20185 des_xmlDocPtr(n_doc, doc, 1);
20186 des_xmlNodePtr(n_cur, cur, 2);
20187 xmlResetLastError();
20188 if (mem_base != xmlMemBlocks()) {
20189 printf("Leak of %d blocks found in xmlElemDump",
20190 xmlMemBlocks() - mem_base);
20192 printf(" %d", n_f);
20193 printf(" %d", n_doc);
20194 printf(" %d", n_cur);
20208 test_xmlFirstElementChild(void) {
20211 #if defined(LIBXML_TREE_ENABLED)
20213 xmlNodePtr ret_val;
20214 xmlNodePtr parent; /* the parent node */
20217 for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
20218 mem_base = xmlMemBlocks();
20219 parent = gen_xmlNodePtr(n_parent, 0);
20221 ret_val = xmlFirstElementChild(parent);
20222 desret_xmlNodePtr(ret_val);
20224 des_xmlNodePtr(n_parent, parent, 0);
20225 xmlResetLastError();
20226 if (mem_base != xmlMemBlocks()) {
20227 printf("Leak of %d blocks found in xmlFirstElementChild",
20228 xmlMemBlocks() - mem_base);
20230 printf(" %d", n_parent);
20242 test_xmlGetBufferAllocationScheme(void) {
20246 xmlBufferAllocationScheme ret_val;
20248 mem_base = xmlMemBlocks();
20250 ret_val = xmlGetBufferAllocationScheme();
20251 desret_xmlBufferAllocationScheme(ret_val);
20253 xmlResetLastError();
20254 if (mem_base != xmlMemBlocks()) {
20255 printf("Leak of %d blocks found in xmlGetBufferAllocationScheme",
20256 xmlMemBlocks() - mem_base);
20267 test_xmlGetCompressMode(void) {
20273 mem_base = xmlMemBlocks();
20275 ret_val = xmlGetCompressMode();
20276 desret_int(ret_val);
20278 xmlResetLastError();
20279 if (mem_base != xmlMemBlocks()) {
20280 printf("Leak of %d blocks found in xmlGetCompressMode",
20281 xmlMemBlocks() - mem_base);
20292 test_xmlGetDocCompressMode(void) {
20297 xmlDocPtr doc; /* the document */
20300 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20301 mem_base = xmlMemBlocks();
20302 doc = gen_xmlDocPtr(n_doc, 0);
20304 ret_val = xmlGetDocCompressMode(doc);
20305 desret_int(ret_val);
20307 des_xmlDocPtr(n_doc, doc, 0);
20308 xmlResetLastError();
20309 if (mem_base != xmlMemBlocks()) {
20310 printf("Leak of %d blocks found in xmlGetDocCompressMode",
20311 xmlMemBlocks() - mem_base);
20313 printf(" %d", n_doc);
20324 test_xmlGetIntSubset(void) {
20329 xmlDocPtr doc; /* the document pointer */
20332 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20333 mem_base = xmlMemBlocks();
20334 doc = gen_xmlDocPtr(n_doc, 0);
20336 ret_val = xmlGetIntSubset(doc);
20337 desret_xmlDtdPtr(ret_val);
20339 des_xmlDocPtr(n_doc, doc, 0);
20340 xmlResetLastError();
20341 if (mem_base != xmlMemBlocks()) {
20342 printf("Leak of %d blocks found in xmlGetIntSubset",
20343 xmlMemBlocks() - mem_base);
20345 printf(" %d", n_doc);
20356 test_xmlGetLastChild(void) {
20360 xmlNodePtr ret_val;
20361 xmlNodePtr parent; /* the parent node */
20364 for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
20365 mem_base = xmlMemBlocks();
20366 parent = gen_xmlNodePtr(n_parent, 0);
20368 ret_val = xmlGetLastChild(parent);
20369 desret_xmlNodePtr(ret_val);
20371 des_xmlNodePtr(n_parent, parent, 0);
20372 xmlResetLastError();
20373 if (mem_base != xmlMemBlocks()) {
20374 printf("Leak of %d blocks found in xmlGetLastChild",
20375 xmlMemBlocks() - mem_base);
20377 printf(" %d", n_parent);
20388 test_xmlGetLineNo(void) {
20393 xmlNodePtr node; /* valid node */
20396 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20397 mem_base = xmlMemBlocks();
20398 node = gen_xmlNodePtr(n_node, 0);
20400 ret_val = xmlGetLineNo(node);
20401 desret_long(ret_val);
20403 des_xmlNodePtr(n_node, node, 0);
20404 xmlResetLastError();
20405 if (mem_base != xmlMemBlocks()) {
20406 printf("Leak of %d blocks found in xmlGetLineNo",
20407 xmlMemBlocks() - mem_base);
20409 printf(" %d", n_node);
20420 test_xmlGetNoNsProp(void) {
20425 xmlNodePtr node; /* the node */
20427 xmlChar * name; /* the attribute name */
20430 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20431 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20432 mem_base = xmlMemBlocks();
20433 node = gen_xmlNodePtr(n_node, 0);
20434 name = gen_const_xmlChar_ptr(n_name, 1);
20436 ret_val = xmlGetNoNsProp(node, (const xmlChar *)name);
20437 desret_xmlChar_ptr(ret_val);
20439 des_xmlNodePtr(n_node, node, 0);
20440 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20441 xmlResetLastError();
20442 if (mem_base != xmlMemBlocks()) {
20443 printf("Leak of %d blocks found in xmlGetNoNsProp",
20444 xmlMemBlocks() - mem_base);
20446 printf(" %d", n_node);
20447 printf(" %d", n_name);
20459 test_xmlGetNodePath(void) {
20462 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_DEBUG_ENABLED)
20465 xmlNodePtr node; /* a node */
20468 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20469 mem_base = xmlMemBlocks();
20470 node = gen_xmlNodePtr(n_node, 0);
20472 ret_val = xmlGetNodePath(node);
20473 desret_xmlChar_ptr(ret_val);
20475 des_xmlNodePtr(n_node, node, 0);
20476 xmlResetLastError();
20477 if (mem_base != xmlMemBlocks()) {
20478 printf("Leak of %d blocks found in xmlGetNodePath",
20479 xmlMemBlocks() - mem_base);
20481 printf(" %d", n_node);
20493 test_xmlGetNsList(void) {
20497 /* missing type support */
20503 test_xmlGetNsProp(void) {
20508 xmlNodePtr node; /* the node */
20510 xmlChar * name; /* the attribute name */
20512 xmlChar * nameSpace; /* the URI of the namespace */
20515 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20516 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20517 for (n_nameSpace = 0;n_nameSpace < gen_nb_const_xmlChar_ptr;n_nameSpace++) {
20518 mem_base = xmlMemBlocks();
20519 node = gen_xmlNodePtr(n_node, 0);
20520 name = gen_const_xmlChar_ptr(n_name, 1);
20521 nameSpace = gen_const_xmlChar_ptr(n_nameSpace, 2);
20523 ret_val = xmlGetNsProp(node, (const xmlChar *)name, (const xmlChar *)nameSpace);
20524 desret_xmlChar_ptr(ret_val);
20526 des_xmlNodePtr(n_node, node, 0);
20527 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20528 des_const_xmlChar_ptr(n_nameSpace, (const xmlChar *)nameSpace, 2);
20529 xmlResetLastError();
20530 if (mem_base != xmlMemBlocks()) {
20531 printf("Leak of %d blocks found in xmlGetNsProp",
20532 xmlMemBlocks() - mem_base);
20534 printf(" %d", n_node);
20535 printf(" %d", n_name);
20536 printf(" %d", n_nameSpace);
20549 test_xmlGetProp(void) {
20554 xmlNodePtr node; /* the node */
20556 xmlChar * name; /* the attribute name */
20559 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20560 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20561 mem_base = xmlMemBlocks();
20562 node = gen_xmlNodePtr(n_node, 0);
20563 name = gen_const_xmlChar_ptr(n_name, 1);
20565 ret_val = xmlGetProp(node, (const xmlChar *)name);
20566 desret_xmlChar_ptr(ret_val);
20568 des_xmlNodePtr(n_node, node, 0);
20569 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20570 xmlResetLastError();
20571 if (mem_base != xmlMemBlocks()) {
20572 printf("Leak of %d blocks found in xmlGetProp",
20573 xmlMemBlocks() - mem_base);
20575 printf(" %d", n_node);
20576 printf(" %d", n_name);
20588 test_xmlHasNsProp(void) {
20592 xmlAttrPtr ret_val;
20593 xmlNodePtr node; /* the node */
20595 xmlChar * name; /* the attribute name */
20597 xmlChar * nameSpace; /* the URI of the namespace */
20600 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20601 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20602 for (n_nameSpace = 0;n_nameSpace < gen_nb_const_xmlChar_ptr;n_nameSpace++) {
20603 mem_base = xmlMemBlocks();
20604 node = gen_xmlNodePtr(n_node, 0);
20605 name = gen_const_xmlChar_ptr(n_name, 1);
20606 nameSpace = gen_const_xmlChar_ptr(n_nameSpace, 2);
20608 ret_val = xmlHasNsProp(node, (const xmlChar *)name, (const xmlChar *)nameSpace);
20609 desret_xmlAttrPtr(ret_val);
20611 des_xmlNodePtr(n_node, node, 0);
20612 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20613 des_const_xmlChar_ptr(n_nameSpace, (const xmlChar *)nameSpace, 2);
20614 xmlResetLastError();
20615 if (mem_base != xmlMemBlocks()) {
20616 printf("Leak of %d blocks found in xmlHasNsProp",
20617 xmlMemBlocks() - mem_base);
20619 printf(" %d", n_node);
20620 printf(" %d", n_name);
20621 printf(" %d", n_nameSpace);
20634 test_xmlHasProp(void) {
20638 xmlAttrPtr ret_val;
20639 xmlNodePtr node; /* the node */
20641 xmlChar * name; /* the attribute name */
20644 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20645 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20646 mem_base = xmlMemBlocks();
20647 node = gen_xmlNodePtr(n_node, 0);
20648 name = gen_const_xmlChar_ptr(n_name, 1);
20650 ret_val = xmlHasProp(node, (const xmlChar *)name);
20651 desret_xmlAttrPtr(ret_val);
20653 des_xmlNodePtr(n_node, node, 0);
20654 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20655 xmlResetLastError();
20656 if (mem_base != xmlMemBlocks()) {
20657 printf("Leak of %d blocks found in xmlHasProp",
20658 xmlMemBlocks() - mem_base);
20660 printf(" %d", n_node);
20661 printf(" %d", n_name);
20673 test_xmlIsBlankNode(void) {
20678 xmlNodePtr node; /* the node */
20681 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20682 mem_base = xmlMemBlocks();
20683 node = gen_xmlNodePtr(n_node, 0);
20685 ret_val = xmlIsBlankNode(node);
20686 desret_int(ret_val);
20688 des_xmlNodePtr(n_node, node, 0);
20689 xmlResetLastError();
20690 if (mem_base != xmlMemBlocks()) {
20691 printf("Leak of %d blocks found in xmlIsBlankNode",
20692 xmlMemBlocks() - mem_base);
20694 printf(" %d", n_node);
20705 test_xmlIsXHTML(void) {
20710 xmlChar * systemID; /* the system identifier */
20712 xmlChar * publicID; /* the public identifier */
20715 for (n_systemID = 0;n_systemID < gen_nb_const_xmlChar_ptr;n_systemID++) {
20716 for (n_publicID = 0;n_publicID < gen_nb_const_xmlChar_ptr;n_publicID++) {
20717 mem_base = xmlMemBlocks();
20718 systemID = gen_const_xmlChar_ptr(n_systemID, 0);
20719 publicID = gen_const_xmlChar_ptr(n_publicID, 1);
20721 ret_val = xmlIsXHTML((const xmlChar *)systemID, (const xmlChar *)publicID);
20722 desret_int(ret_val);
20724 des_const_xmlChar_ptr(n_systemID, (const xmlChar *)systemID, 0);
20725 des_const_xmlChar_ptr(n_publicID, (const xmlChar *)publicID, 1);
20726 xmlResetLastError();
20727 if (mem_base != xmlMemBlocks()) {
20728 printf("Leak of %d blocks found in xmlIsXHTML",
20729 xmlMemBlocks() - mem_base);
20731 printf(" %d", n_systemID);
20732 printf(" %d", n_publicID);
20744 test_xmlLastElementChild(void) {
20747 #if defined(LIBXML_TREE_ENABLED)
20749 xmlNodePtr ret_val;
20750 xmlNodePtr parent; /* the parent node */
20753 for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
20754 mem_base = xmlMemBlocks();
20755 parent = gen_xmlNodePtr(n_parent, 0);
20757 ret_val = xmlLastElementChild(parent);
20758 desret_xmlNodePtr(ret_val);
20760 des_xmlNodePtr(n_parent, parent, 0);
20761 xmlResetLastError();
20762 if (mem_base != xmlMemBlocks()) {
20763 printf("Leak of %d blocks found in xmlLastElementChild",
20764 xmlMemBlocks() - mem_base);
20766 printf(" %d", n_parent);
20778 test_xmlNewCDataBlock(void) {
20782 xmlNodePtr ret_val;
20783 xmlDocPtr doc; /* the document */
20785 xmlChar * content; /* the CDATA block content content */
20787 int len; /* the length of the block */
20790 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20791 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20792 for (n_len = 0;n_len < gen_nb_int;n_len++) {
20793 mem_base = xmlMemBlocks();
20794 doc = gen_xmlDocPtr(n_doc, 0);
20795 content = gen_const_xmlChar_ptr(n_content, 1);
20796 len = gen_int(n_len, 2);
20798 ret_val = xmlNewCDataBlock(doc, (const xmlChar *)content, len);
20799 desret_xmlNodePtr(ret_val);
20801 des_xmlDocPtr(n_doc, doc, 0);
20802 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
20803 des_int(n_len, len, 2);
20804 xmlResetLastError();
20805 if (mem_base != xmlMemBlocks()) {
20806 printf("Leak of %d blocks found in xmlNewCDataBlock",
20807 xmlMemBlocks() - mem_base);
20809 printf(" %d", n_doc);
20810 printf(" %d", n_content);
20811 printf(" %d", n_len);
20824 test_xmlNewCharRef(void) {
20828 xmlNodePtr ret_val;
20829 xmlDocPtr doc; /* the document */
20831 xmlChar * name; /* the char ref string, starting with # or "&# ... ;" */
20834 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20835 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20836 mem_base = xmlMemBlocks();
20837 doc = gen_xmlDocPtr(n_doc, 0);
20838 name = gen_const_xmlChar_ptr(n_name, 1);
20840 ret_val = xmlNewCharRef(doc, (const xmlChar *)name);
20841 desret_xmlNodePtr(ret_val);
20843 des_xmlDocPtr(n_doc, doc, 0);
20844 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20845 xmlResetLastError();
20846 if (mem_base != xmlMemBlocks()) {
20847 printf("Leak of %d blocks found in xmlNewCharRef",
20848 xmlMemBlocks() - mem_base);
20850 printf(" %d", n_doc);
20851 printf(" %d", n_name);
20863 test_xmlNewChild(void) {
20866 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
20867 #ifdef LIBXML_TREE_ENABLED
20869 xmlNodePtr ret_val;
20870 xmlNodePtr parent; /* the parent node */
20872 xmlNsPtr ns; /* a namespace if any */
20874 xmlChar * name; /* the name of the child */
20876 xmlChar * content; /* the XML content of the child if any. */
20879 for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
20880 for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
20881 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20882 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20883 mem_base = xmlMemBlocks();
20884 parent = gen_xmlNodePtr(n_parent, 0);
20885 ns = gen_xmlNsPtr(n_ns, 1);
20886 name = gen_const_xmlChar_ptr(n_name, 2);
20887 content = gen_const_xmlChar_ptr(n_content, 3);
20889 ret_val = xmlNewChild(parent, ns, (const xmlChar *)name, (const xmlChar *)content);
20890 desret_xmlNodePtr(ret_val);
20892 des_xmlNodePtr(n_parent, parent, 0);
20893 des_xmlNsPtr(n_ns, ns, 1);
20894 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
20895 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
20896 xmlResetLastError();
20897 if (mem_base != xmlMemBlocks()) {
20898 printf("Leak of %d blocks found in xmlNewChild",
20899 xmlMemBlocks() - mem_base);
20901 printf(" %d", n_parent);
20902 printf(" %d", n_ns);
20903 printf(" %d", n_name);
20904 printf(" %d", n_content);
20920 test_xmlNewComment(void) {
20924 xmlNodePtr ret_val;
20925 xmlChar * content; /* the comment content */
20928 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20929 mem_base = xmlMemBlocks();
20930 content = gen_const_xmlChar_ptr(n_content, 0);
20932 ret_val = xmlNewComment((const xmlChar *)content);
20933 desret_xmlNodePtr(ret_val);
20935 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 0);
20936 xmlResetLastError();
20937 if (mem_base != xmlMemBlocks()) {
20938 printf("Leak of %d blocks found in xmlNewComment",
20939 xmlMemBlocks() - mem_base);
20941 printf(" %d", n_content);
20952 test_xmlNewDoc(void) {
20957 xmlChar * version; /* xmlChar string giving the version of XML "1.0" */
20960 for (n_version = 0;n_version < gen_nb_const_xmlChar_ptr;n_version++) {
20961 mem_base = xmlMemBlocks();
20962 version = gen_const_xmlChar_ptr(n_version, 0);
20964 ret_val = xmlNewDoc((const xmlChar *)version);
20965 desret_xmlDocPtr(ret_val);
20967 des_const_xmlChar_ptr(n_version, (const xmlChar *)version, 0);
20968 xmlResetLastError();
20969 if (mem_base != xmlMemBlocks()) {
20970 printf("Leak of %d blocks found in xmlNewDoc",
20971 xmlMemBlocks() - mem_base);
20973 printf(" %d", n_version);
20984 test_xmlNewDocComment(void) {
20988 xmlNodePtr ret_val;
20989 xmlDocPtr doc; /* the document */
20991 xmlChar * content; /* the comment content */
20994 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20995 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20996 mem_base = xmlMemBlocks();
20997 doc = gen_xmlDocPtr(n_doc, 0);
20998 content = gen_const_xmlChar_ptr(n_content, 1);
21000 ret_val = xmlNewDocComment(doc, (const xmlChar *)content);
21001 desret_xmlNodePtr(ret_val);
21003 des_xmlDocPtr(n_doc, doc, 0);
21004 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
21005 xmlResetLastError();
21006 if (mem_base != xmlMemBlocks()) {
21007 printf("Leak of %d blocks found in xmlNewDocComment",
21008 xmlMemBlocks() - mem_base);
21010 printf(" %d", n_doc);
21011 printf(" %d", n_content);
21023 test_xmlNewDocFragment(void) {
21026 #if defined(LIBXML_TREE_ENABLED)
21028 xmlNodePtr ret_val;
21029 xmlDocPtr doc; /* the document owning the fragment */
21032 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21033 mem_base = xmlMemBlocks();
21034 doc = gen_xmlDocPtr(n_doc, 0);
21036 ret_val = xmlNewDocFragment(doc);
21037 desret_xmlNodePtr(ret_val);
21039 des_xmlDocPtr(n_doc, doc, 0);
21040 xmlResetLastError();
21041 if (mem_base != xmlMemBlocks()) {
21042 printf("Leak of %d blocks found in xmlNewDocFragment",
21043 xmlMemBlocks() - mem_base);
21045 printf(" %d", n_doc);
21057 test_xmlNewDocNode(void) {
21061 xmlNodePtr ret_val;
21062 xmlDocPtr doc; /* the document */
21064 xmlNsPtr ns; /* namespace if any */
21066 xmlChar * name; /* the node name */
21068 xmlChar * content; /* the XML text content if any */
21071 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21072 for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21073 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21074 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21075 mem_base = xmlMemBlocks();
21076 doc = gen_xmlDocPtr(n_doc, 0);
21077 ns = gen_xmlNsPtr(n_ns, 1);
21078 name = gen_const_xmlChar_ptr(n_name, 2);
21079 content = gen_const_xmlChar_ptr(n_content, 3);
21081 ret_val = xmlNewDocNode(doc, ns, (const xmlChar *)name, (const xmlChar *)content);
21082 desret_xmlNodePtr(ret_val);
21084 des_xmlDocPtr(n_doc, doc, 0);
21085 des_xmlNsPtr(n_ns, ns, 1);
21086 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
21087 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
21088 xmlResetLastError();
21089 if (mem_base != xmlMemBlocks()) {
21090 printf("Leak of %d blocks found in xmlNewDocNode",
21091 xmlMemBlocks() - mem_base);
21093 printf(" %d", n_doc);
21094 printf(" %d", n_ns);
21095 printf(" %d", n_name);
21096 printf(" %d", n_content);
21110 test_xmlNewDocNodeEatName(void) {
21114 xmlNodePtr ret_val;
21115 xmlDocPtr doc; /* the document */
21117 xmlNsPtr ns; /* namespace if any */
21119 xmlChar * name; /* the node name */
21121 xmlChar * content; /* the XML text content if any */
21124 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21125 for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21126 for (n_name = 0;n_name < gen_nb_eaten_name;n_name++) {
21127 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21128 mem_base = xmlMemBlocks();
21129 doc = gen_xmlDocPtr(n_doc, 0);
21130 ns = gen_xmlNsPtr(n_ns, 1);
21131 name = gen_eaten_name(n_name, 2);
21132 content = gen_const_xmlChar_ptr(n_content, 3);
21134 ret_val = xmlNewDocNodeEatName(doc, ns, name, (const xmlChar *)content);
21135 desret_xmlNodePtr(ret_val);
21137 des_xmlDocPtr(n_doc, doc, 0);
21138 des_xmlNsPtr(n_ns, ns, 1);
21139 des_eaten_name(n_name, name, 2);
21140 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
21141 xmlResetLastError();
21142 if (mem_base != xmlMemBlocks()) {
21143 printf("Leak of %d blocks found in xmlNewDocNodeEatName",
21144 xmlMemBlocks() - mem_base);
21146 printf(" %d", n_doc);
21147 printf(" %d", n_ns);
21148 printf(" %d", n_name);
21149 printf(" %d", n_content);
21163 test_xmlNewDocPI(void) {
21167 xmlNodePtr ret_val;
21168 xmlDocPtr doc; /* the target document */
21170 xmlChar * name; /* the processing instruction name */
21172 xmlChar * content; /* the PI content */
21175 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21176 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21177 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21178 mem_base = xmlMemBlocks();
21179 doc = gen_xmlDocPtr(n_doc, 0);
21180 name = gen_const_xmlChar_ptr(n_name, 1);
21181 content = gen_const_xmlChar_ptr(n_content, 2);
21183 ret_val = xmlNewDocPI(doc, (const xmlChar *)name, (const xmlChar *)content);
21184 desret_xmlNodePtr(ret_val);
21186 des_xmlDocPtr(n_doc, doc, 0);
21187 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21188 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
21189 xmlResetLastError();
21190 if (mem_base != xmlMemBlocks()) {
21191 printf("Leak of %d blocks found in xmlNewDocPI",
21192 xmlMemBlocks() - mem_base);
21194 printf(" %d", n_doc);
21195 printf(" %d", n_name);
21196 printf(" %d", n_content);
21209 test_xmlNewDocProp(void) {
21213 xmlAttrPtr ret_val;
21214 xmlDocPtr doc; /* the document */
21216 xmlChar * name; /* the name of the attribute */
21218 xmlChar * value; /* the value of the attribute */
21221 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21222 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21223 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
21224 mem_base = xmlMemBlocks();
21225 doc = gen_xmlDocPtr(n_doc, 0);
21226 name = gen_const_xmlChar_ptr(n_name, 1);
21227 value = gen_const_xmlChar_ptr(n_value, 2);
21229 ret_val = xmlNewDocProp(doc, (const xmlChar *)name, (const xmlChar *)value);
21230 desret_xmlAttrPtr(ret_val);
21232 des_xmlDocPtr(n_doc, doc, 0);
21233 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21234 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
21235 xmlResetLastError();
21236 if (mem_base != xmlMemBlocks()) {
21237 printf("Leak of %d blocks found in xmlNewDocProp",
21238 xmlMemBlocks() - mem_base);
21240 printf(" %d", n_doc);
21241 printf(" %d", n_name);
21242 printf(" %d", n_value);
21255 test_xmlNewDocRawNode(void) {
21258 #if defined(LIBXML_TREE_ENABLED)
21259 #ifdef LIBXML_TREE_ENABLED
21261 xmlNodePtr ret_val;
21262 xmlDocPtr doc; /* the document */
21264 xmlNsPtr ns; /* namespace if any */
21266 xmlChar * name; /* the node name */
21268 xmlChar * content; /* the text content if any */
21271 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21272 for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21273 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21274 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21275 mem_base = xmlMemBlocks();
21276 doc = gen_xmlDocPtr(n_doc, 0);
21277 ns = gen_xmlNsPtr(n_ns, 1);
21278 name = gen_const_xmlChar_ptr(n_name, 2);
21279 content = gen_const_xmlChar_ptr(n_content, 3);
21281 ret_val = xmlNewDocRawNode(doc, ns, (const xmlChar *)name, (const xmlChar *)content);
21282 desret_xmlNodePtr(ret_val);
21284 des_xmlDocPtr(n_doc, doc, 0);
21285 des_xmlNsPtr(n_ns, ns, 1);
21286 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
21287 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
21288 xmlResetLastError();
21289 if (mem_base != xmlMemBlocks()) {
21290 printf("Leak of %d blocks found in xmlNewDocRawNode",
21291 xmlMemBlocks() - mem_base);
21293 printf(" %d", n_doc);
21294 printf(" %d", n_ns);
21295 printf(" %d", n_name);
21296 printf(" %d", n_content);
21312 test_xmlNewDocText(void) {
21316 xmlNodePtr ret_val;
21317 xmlDocPtr doc; /* the document */
21319 xmlChar * content; /* the text content */
21322 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21323 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21324 mem_base = xmlMemBlocks();
21325 doc = gen_xmlDocPtr(n_doc, 0);
21326 content = gen_const_xmlChar_ptr(n_content, 1);
21328 ret_val = xmlNewDocText(doc, (const xmlChar *)content);
21329 desret_xmlNodePtr(ret_val);
21331 des_xmlDocPtr(n_doc, doc, 0);
21332 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
21333 xmlResetLastError();
21334 if (mem_base != xmlMemBlocks()) {
21335 printf("Leak of %d blocks found in xmlNewDocText",
21336 xmlMemBlocks() - mem_base);
21338 printf(" %d", n_doc);
21339 printf(" %d", n_content);
21351 test_xmlNewDocTextLen(void) {
21355 xmlNodePtr ret_val;
21356 xmlDocPtr doc; /* the document */
21358 xmlChar * content; /* the text content */
21360 int len; /* the text len. */
21363 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21364 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21365 for (n_len = 0;n_len < gen_nb_int;n_len++) {
21366 mem_base = xmlMemBlocks();
21367 doc = gen_xmlDocPtr(n_doc, 0);
21368 content = gen_const_xmlChar_ptr(n_content, 1);
21369 len = gen_int(n_len, 2);
21371 ret_val = xmlNewDocTextLen(doc, (const xmlChar *)content, len);
21372 desret_xmlNodePtr(ret_val);
21374 des_xmlDocPtr(n_doc, doc, 0);
21375 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
21376 des_int(n_len, len, 2);
21377 xmlResetLastError();
21378 if (mem_base != xmlMemBlocks()) {
21379 printf("Leak of %d blocks found in xmlNewDocTextLen",
21380 xmlMemBlocks() - mem_base);
21382 printf(" %d", n_doc);
21383 printf(" %d", n_content);
21384 printf(" %d", n_len);
21397 test_xmlNewDtd(void) {
21402 xmlDocPtr doc; /* the document pointer */
21404 xmlChar * name; /* the DTD name */
21406 xmlChar * ExternalID; /* the external ID */
21408 xmlChar * SystemID; /* the system ID */
21411 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21412 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21413 for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
21414 for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
21415 mem_base = xmlMemBlocks();
21416 doc = gen_xmlDocPtr(n_doc, 0);
21417 name = gen_const_xmlChar_ptr(n_name, 1);
21418 ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 2);
21419 SystemID = gen_const_xmlChar_ptr(n_SystemID, 3);
21421 ret_val = xmlNewDtd(doc, (const xmlChar *)name, (const xmlChar *)ExternalID, (const xmlChar *)SystemID);
21422 desret_xmlDtdPtr(ret_val);
21424 des_xmlDocPtr(n_doc, doc, 0);
21425 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21426 des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 2);
21427 des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 3);
21428 xmlResetLastError();
21429 if (mem_base != xmlMemBlocks()) {
21430 printf("Leak of %d blocks found in xmlNewDtd",
21431 xmlMemBlocks() - mem_base);
21433 printf(" %d", n_doc);
21434 printf(" %d", n_name);
21435 printf(" %d", n_ExternalID);
21436 printf(" %d", n_SystemID);
21450 test_xmlNewNode(void) {
21454 xmlNodePtr ret_val;
21455 xmlNsPtr ns; /* namespace if any */
21457 xmlChar * name; /* the node name */
21460 for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21461 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21462 mem_base = xmlMemBlocks();
21463 ns = gen_xmlNsPtr(n_ns, 0);
21464 name = gen_const_xmlChar_ptr(n_name, 1);
21466 ret_val = xmlNewNode(ns, (const xmlChar *)name);
21467 desret_xmlNodePtr(ret_val);
21469 des_xmlNsPtr(n_ns, ns, 0);
21470 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21471 xmlResetLastError();
21472 if (mem_base != xmlMemBlocks()) {
21473 printf("Leak of %d blocks found in xmlNewNode",
21474 xmlMemBlocks() - mem_base);
21476 printf(" %d", n_ns);
21477 printf(" %d", n_name);
21489 test_xmlNewNodeEatName(void) {
21493 xmlNodePtr ret_val;
21494 xmlNsPtr ns; /* namespace if any */
21496 xmlChar * name; /* the node name */
21499 for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21500 for (n_name = 0;n_name < gen_nb_eaten_name;n_name++) {
21501 mem_base = xmlMemBlocks();
21502 ns = gen_xmlNsPtr(n_ns, 0);
21503 name = gen_eaten_name(n_name, 1);
21505 ret_val = xmlNewNodeEatName(ns, name);
21506 desret_xmlNodePtr(ret_val);
21508 des_xmlNsPtr(n_ns, ns, 0);
21509 des_eaten_name(n_name, name, 1);
21510 xmlResetLastError();
21511 if (mem_base != xmlMemBlocks()) {
21512 printf("Leak of %d blocks found in xmlNewNodeEatName",
21513 xmlMemBlocks() - mem_base);
21515 printf(" %d", n_ns);
21516 printf(" %d", n_name);
21528 test_xmlNewNs(void) {
21533 xmlNodePtr node; /* the element carrying the namespace */
21535 xmlChar * href; /* the URI associated */
21537 xmlChar * prefix; /* the prefix for the namespace */
21540 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
21541 for (n_href = 0;n_href < gen_nb_const_xmlChar_ptr;n_href++) {
21542 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
21543 mem_base = xmlMemBlocks();
21544 node = gen_xmlNodePtr(n_node, 0);
21545 href = gen_const_xmlChar_ptr(n_href, 1);
21546 prefix = gen_const_xmlChar_ptr(n_prefix, 2);
21548 ret_val = xmlNewNs(node, (const xmlChar *)href, (const xmlChar *)prefix);
21549 if ((node == NULL) && (ret_val != NULL)) xmlFreeNs(ret_val);
21550 desret_xmlNsPtr(ret_val);
21552 des_xmlNodePtr(n_node, node, 0);
21553 des_const_xmlChar_ptr(n_href, (const xmlChar *)href, 1);
21554 des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 2);
21555 xmlResetLastError();
21556 if (mem_base != xmlMemBlocks()) {
21557 printf("Leak of %d blocks found in xmlNewNs",
21558 xmlMemBlocks() - mem_base);
21560 printf(" %d", n_node);
21561 printf(" %d", n_href);
21562 printf(" %d", n_prefix);
21575 test_xmlNewNsProp(void) {
21579 xmlAttrPtr ret_val;
21580 xmlNodePtr node; /* the holding node */
21582 xmlNsPtr ns; /* the namespace */
21584 xmlChar * name; /* the name of the attribute */
21586 xmlChar * value; /* the value of the attribute */
21589 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
21590 for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21591 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21592 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
21593 mem_base = xmlMemBlocks();
21594 node = gen_xmlNodePtr(n_node, 0);
21595 ns = gen_xmlNsPtr(n_ns, 1);
21596 name = gen_const_xmlChar_ptr(n_name, 2);
21597 value = gen_const_xmlChar_ptr(n_value, 3);
21599 ret_val = xmlNewNsProp(node, ns, (const xmlChar *)name, (const xmlChar *)value);
21600 desret_xmlAttrPtr(ret_val);
21602 des_xmlNodePtr(n_node, node, 0);
21603 des_xmlNsPtr(n_ns, ns, 1);
21604 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
21605 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
21606 xmlResetLastError();
21607 if (mem_base != xmlMemBlocks()) {
21608 printf("Leak of %d blocks found in xmlNewNsProp",
21609 xmlMemBlocks() - mem_base);
21611 printf(" %d", n_node);
21612 printf(" %d", n_ns);
21613 printf(" %d", n_name);
21614 printf(" %d", n_value);
21628 test_xmlNewNsPropEatName(void) {
21632 xmlAttrPtr ret_val;
21633 xmlNodePtr node; /* the holding node */
21635 xmlNsPtr ns; /* the namespace */
21637 xmlChar * name; /* the name of the attribute */
21639 xmlChar * value; /* the value of the attribute */
21642 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
21643 for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21644 for (n_name = 0;n_name < gen_nb_eaten_name;n_name++) {
21645 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
21646 mem_base = xmlMemBlocks();
21647 node = gen_xmlNodePtr(n_node, 0);
21648 ns = gen_xmlNsPtr(n_ns, 1);
21649 name = gen_eaten_name(n_name, 2);
21650 value = gen_const_xmlChar_ptr(n_value, 3);
21652 ret_val = xmlNewNsPropEatName(node, ns, name, (const xmlChar *)value);
21653 desret_xmlAttrPtr(ret_val);
21655 des_xmlNodePtr(n_node, node, 0);
21656 des_xmlNsPtr(n_ns, ns, 1);
21657 des_eaten_name(n_name, name, 2);
21658 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
21659 xmlResetLastError();
21660 if (mem_base != xmlMemBlocks()) {
21661 printf("Leak of %d blocks found in xmlNewNsPropEatName",
21662 xmlMemBlocks() - mem_base);
21664 printf(" %d", n_node);
21665 printf(" %d", n_ns);
21666 printf(" %d", n_name);
21667 printf(" %d", n_value);
21681 test_xmlNewPI(void) {
21685 xmlNodePtr ret_val;
21686 xmlChar * name; /* the processing instruction name */
21688 xmlChar * content; /* the PI content */
21691 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21692 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21693 mem_base = xmlMemBlocks();
21694 name = gen_const_xmlChar_ptr(n_name, 0);
21695 content = gen_const_xmlChar_ptr(n_content, 1);
21697 ret_val = xmlNewPI((const xmlChar *)name, (const xmlChar *)content);
21698 desret_xmlNodePtr(ret_val);
21700 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
21701 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
21702 xmlResetLastError();
21703 if (mem_base != xmlMemBlocks()) {
21704 printf("Leak of %d blocks found in xmlNewPI",
21705 xmlMemBlocks() - mem_base);
21707 printf(" %d", n_name);
21708 printf(" %d", n_content);
21720 test_xmlNewProp(void) {
21723 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
21724 #ifdef LIBXML_TREE_ENABLED
21726 xmlAttrPtr ret_val;
21727 xmlNodePtr node; /* the holding node */
21729 xmlChar * name; /* the name of the attribute */
21731 xmlChar * value; /* the value of the attribute */
21734 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
21735 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21736 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
21737 mem_base = xmlMemBlocks();
21738 node = gen_xmlNodePtr(n_node, 0);
21739 name = gen_const_xmlChar_ptr(n_name, 1);
21740 value = gen_const_xmlChar_ptr(n_value, 2);
21742 ret_val = xmlNewProp(node, (const xmlChar *)name, (const xmlChar *)value);
21743 desret_xmlAttrPtr(ret_val);
21745 des_xmlNodePtr(n_node, node, 0);
21746 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21747 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
21748 xmlResetLastError();
21749 if (mem_base != xmlMemBlocks()) {
21750 printf("Leak of %d blocks found in xmlNewProp",
21751 xmlMemBlocks() - mem_base);
21753 printf(" %d", n_node);
21754 printf(" %d", n_name);
21755 printf(" %d", n_value);
21770 test_xmlNewReference(void) {
21774 xmlNodePtr ret_val;
21775 xmlDocPtr doc; /* the document */
21777 xmlChar * name; /* the reference name, or the reference string with & and ; */
21780 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21781 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21782 mem_base = xmlMemBlocks();
21783 doc = gen_xmlDocPtr(n_doc, 0);
21784 name = gen_const_xmlChar_ptr(n_name, 1);
21786 ret_val = xmlNewReference(doc, (const xmlChar *)name);
21787 desret_xmlNodePtr(ret_val);
21789 des_xmlDocPtr(n_doc, doc, 0);
21790 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21791 xmlResetLastError();
21792 if (mem_base != xmlMemBlocks()) {
21793 printf("Leak of %d blocks found in xmlNewReference",
21794 xmlMemBlocks() - mem_base);
21796 printf(" %d", n_doc);
21797 printf(" %d", n_name);
21809 test_xmlNewText(void) {
21813 xmlNodePtr ret_val;
21814 xmlChar * content; /* the text content */
21817 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21818 mem_base = xmlMemBlocks();
21819 content = gen_const_xmlChar_ptr(n_content, 0);
21821 ret_val = xmlNewText((const xmlChar *)content);
21822 desret_xmlNodePtr(ret_val);
21824 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 0);
21825 xmlResetLastError();
21826 if (mem_base != xmlMemBlocks()) {
21827 printf("Leak of %d blocks found in xmlNewText",
21828 xmlMemBlocks() - mem_base);
21830 printf(" %d", n_content);
21841 test_xmlNewTextChild(void) {
21844 #if defined(LIBXML_TREE_ENABLED)
21845 #ifdef LIBXML_TREE_ENABLED
21847 xmlNodePtr ret_val;
21848 xmlNodePtr parent; /* the parent node */
21850 xmlNsPtr ns; /* a namespace if any */
21852 xmlChar * name; /* the name of the child */
21854 xmlChar * content; /* the text content of the child if any. */
21857 for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
21858 for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21859 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21860 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21861 mem_base = xmlMemBlocks();
21862 parent = gen_xmlNodePtr(n_parent, 0);
21863 ns = gen_xmlNsPtr(n_ns, 1);
21864 name = gen_const_xmlChar_ptr(n_name, 2);
21865 content = gen_const_xmlChar_ptr(n_content, 3);
21867 ret_val = xmlNewTextChild(parent, ns, (const xmlChar *)name, (const xmlChar *)content);
21868 desret_xmlNodePtr(ret_val);
21870 des_xmlNodePtr(n_parent, parent, 0);
21871 des_xmlNsPtr(n_ns, ns, 1);
21872 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
21873 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
21874 xmlResetLastError();
21875 if (mem_base != xmlMemBlocks()) {
21876 printf("Leak of %d blocks found in xmlNewTextChild",
21877 xmlMemBlocks() - mem_base);
21879 printf(" %d", n_parent);
21880 printf(" %d", n_ns);
21881 printf(" %d", n_name);
21882 printf(" %d", n_content);
21898 test_xmlNewTextLen(void) {
21902 xmlNodePtr ret_val;
21903 xmlChar * content; /* the text content */
21905 int len; /* the text len. */
21908 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21909 for (n_len = 0;n_len < gen_nb_int;n_len++) {
21910 mem_base = xmlMemBlocks();
21911 content = gen_const_xmlChar_ptr(n_content, 0);
21912 len = gen_int(n_len, 1);
21914 ret_val = xmlNewTextLen((const xmlChar *)content, len);
21915 desret_xmlNodePtr(ret_val);
21917 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 0);
21918 des_int(n_len, len, 1);
21919 xmlResetLastError();
21920 if (mem_base != xmlMemBlocks()) {
21921 printf("Leak of %d blocks found in xmlNewTextLen",
21922 xmlMemBlocks() - mem_base);
21924 printf(" %d", n_content);
21925 printf(" %d", n_len);
21937 test_xmlNextElementSibling(void) {
21940 #if defined(LIBXML_TREE_ENABLED)
21942 xmlNodePtr ret_val;
21943 xmlNodePtr node; /* the current node */
21946 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
21947 mem_base = xmlMemBlocks();
21948 node = gen_xmlNodePtr(n_node, 0);
21950 ret_val = xmlNextElementSibling(node);
21951 desret_xmlNodePtr(ret_val);
21953 des_xmlNodePtr(n_node, node, 0);
21954 xmlResetLastError();
21955 if (mem_base != xmlMemBlocks()) {
21956 printf("Leak of %d blocks found in xmlNextElementSibling",
21957 xmlMemBlocks() - mem_base);
21959 printf(" %d", n_node);
21971 test_xmlNodeAddContent(void) {
21975 xmlNodePtr cur; /* the node being modified */
21977 xmlChar * content; /* extra content */
21980 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
21981 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21982 mem_base = xmlMemBlocks();
21983 cur = gen_xmlNodePtr(n_cur, 0);
21984 content = gen_const_xmlChar_ptr(n_content, 1);
21986 xmlNodeAddContent(cur, (const xmlChar *)content);
21988 des_xmlNodePtr(n_cur, cur, 0);
21989 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
21990 xmlResetLastError();
21991 if (mem_base != xmlMemBlocks()) {
21992 printf("Leak of %d blocks found in xmlNodeAddContent",
21993 xmlMemBlocks() - mem_base);
21995 printf(" %d", n_cur);
21996 printf(" %d", n_content);
22008 test_xmlNodeAddContentLen(void) {
22012 xmlNodePtr cur; /* the node being modified */
22014 xmlChar * content; /* extra content */
22016 int len; /* the size of @content */
22019 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22020 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
22021 for (n_len = 0;n_len < gen_nb_int;n_len++) {
22022 mem_base = xmlMemBlocks();
22023 cur = gen_xmlNodePtr(n_cur, 0);
22024 content = gen_const_xmlChar_ptr(n_content, 1);
22025 len = gen_int(n_len, 2);
22027 xmlNodeAddContentLen(cur, (const xmlChar *)content, len);
22029 des_xmlNodePtr(n_cur, cur, 0);
22030 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
22031 des_int(n_len, len, 2);
22032 xmlResetLastError();
22033 if (mem_base != xmlMemBlocks()) {
22034 printf("Leak of %d blocks found in xmlNodeAddContentLen",
22035 xmlMemBlocks() - mem_base);
22037 printf(" %d", n_cur);
22038 printf(" %d", n_content);
22039 printf(" %d", n_len);
22052 test_xmlNodeBufGetContent(void) {
22057 xmlBufferPtr buffer; /* a buffer */
22059 xmlNodePtr cur; /* the node being read */
22062 for (n_buffer = 0;n_buffer < gen_nb_xmlBufferPtr;n_buffer++) {
22063 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22064 mem_base = xmlMemBlocks();
22065 buffer = gen_xmlBufferPtr(n_buffer, 0);
22066 cur = gen_xmlNodePtr(n_cur, 1);
22068 ret_val = xmlNodeBufGetContent(buffer, cur);
22069 desret_int(ret_val);
22071 des_xmlBufferPtr(n_buffer, buffer, 0);
22072 des_xmlNodePtr(n_cur, cur, 1);
22073 xmlResetLastError();
22074 if (mem_base != xmlMemBlocks()) {
22075 printf("Leak of %d blocks found in xmlNodeBufGetContent",
22076 xmlMemBlocks() - mem_base);
22078 printf(" %d", n_buffer);
22079 printf(" %d", n_cur);
22091 test_xmlNodeDump(void) {
22094 #if defined(LIBXML_OUTPUT_ENABLED)
22097 xmlBufferPtr buf; /* the XML buffer output */
22099 xmlDocPtr doc; /* the document */
22101 xmlNodePtr cur; /* the current node */
22103 int level; /* the imbrication level for indenting */
22105 int format; /* is formatting allowed */
22108 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
22109 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22110 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22111 for (n_level = 0;n_level < gen_nb_int;n_level++) {
22112 for (n_format = 0;n_format < gen_nb_int;n_format++) {
22113 mem_base = xmlMemBlocks();
22114 buf = gen_xmlBufferPtr(n_buf, 0);
22115 doc = gen_xmlDocPtr(n_doc, 1);
22116 cur = gen_xmlNodePtr(n_cur, 2);
22117 level = gen_int(n_level, 3);
22118 format = gen_int(n_format, 4);
22120 ret_val = xmlNodeDump(buf, doc, cur, level, format);
22121 desret_int(ret_val);
22123 des_xmlBufferPtr(n_buf, buf, 0);
22124 des_xmlDocPtr(n_doc, doc, 1);
22125 des_xmlNodePtr(n_cur, cur, 2);
22126 des_int(n_level, level, 3);
22127 des_int(n_format, format, 4);
22128 xmlResetLastError();
22129 if (mem_base != xmlMemBlocks()) {
22130 printf("Leak of %d blocks found in xmlNodeDump",
22131 xmlMemBlocks() - mem_base);
22133 printf(" %d", n_buf);
22134 printf(" %d", n_doc);
22135 printf(" %d", n_cur);
22136 printf(" %d", n_level);
22137 printf(" %d", n_format);
22153 test_xmlNodeDumpOutput(void) {
22156 #if defined(LIBXML_OUTPUT_ENABLED)
22158 xmlOutputBufferPtr buf; /* the XML buffer output */
22160 xmlDocPtr doc; /* the document */
22162 xmlNodePtr cur; /* the current node */
22164 int level; /* the imbrication level for indenting */
22166 int format; /* is formatting allowed */
22168 char * encoding; /* an optional encoding string */
22171 for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
22172 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22173 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22174 for (n_level = 0;n_level < gen_nb_int;n_level++) {
22175 for (n_format = 0;n_format < gen_nb_int;n_format++) {
22176 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
22177 mem_base = xmlMemBlocks();
22178 buf = gen_xmlOutputBufferPtr(n_buf, 0);
22179 doc = gen_xmlDocPtr(n_doc, 1);
22180 cur = gen_xmlNodePtr(n_cur, 2);
22181 level = gen_int(n_level, 3);
22182 format = gen_int(n_format, 4);
22183 encoding = gen_const_char_ptr(n_encoding, 5);
22185 xmlNodeDumpOutput(buf, doc, cur, level, format, (const char *)encoding);
22187 des_xmlOutputBufferPtr(n_buf, buf, 0);
22188 des_xmlDocPtr(n_doc, doc, 1);
22189 des_xmlNodePtr(n_cur, cur, 2);
22190 des_int(n_level, level, 3);
22191 des_int(n_format, format, 4);
22192 des_const_char_ptr(n_encoding, (const char *)encoding, 5);
22193 xmlResetLastError();
22194 if (mem_base != xmlMemBlocks()) {
22195 printf("Leak of %d blocks found in xmlNodeDumpOutput",
22196 xmlMemBlocks() - mem_base);
22198 printf(" %d", n_buf);
22199 printf(" %d", n_doc);
22200 printf(" %d", n_cur);
22201 printf(" %d", n_level);
22202 printf(" %d", n_format);
22203 printf(" %d", n_encoding);
22220 test_xmlNodeGetBase(void) {
22225 xmlDocPtr doc; /* the document the node pertains to */
22227 xmlNodePtr cur; /* the node being checked */
22230 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22231 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22232 mem_base = xmlMemBlocks();
22233 doc = gen_xmlDocPtr(n_doc, 0);
22234 cur = gen_xmlNodePtr(n_cur, 1);
22236 ret_val = xmlNodeGetBase(doc, cur);
22237 desret_xmlChar_ptr(ret_val);
22239 des_xmlDocPtr(n_doc, doc, 0);
22240 des_xmlNodePtr(n_cur, cur, 1);
22241 xmlResetLastError();
22242 if (mem_base != xmlMemBlocks()) {
22243 printf("Leak of %d blocks found in xmlNodeGetBase",
22244 xmlMemBlocks() - mem_base);
22246 printf(" %d", n_doc);
22247 printf(" %d", n_cur);
22259 test_xmlNodeGetContent(void) {
22264 xmlNodePtr cur; /* the node being read */
22267 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22268 mem_base = xmlMemBlocks();
22269 cur = gen_xmlNodePtr(n_cur, 0);
22271 ret_val = xmlNodeGetContent(cur);
22272 desret_xmlChar_ptr(ret_val);
22274 des_xmlNodePtr(n_cur, cur, 0);
22275 xmlResetLastError();
22276 if (mem_base != xmlMemBlocks()) {
22277 printf("Leak of %d blocks found in xmlNodeGetContent",
22278 xmlMemBlocks() - mem_base);
22280 printf(" %d", n_cur);
22291 test_xmlNodeGetLang(void) {
22296 xmlNodePtr cur; /* the node being checked */
22299 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22300 mem_base = xmlMemBlocks();
22301 cur = gen_xmlNodePtr(n_cur, 0);
22303 ret_val = xmlNodeGetLang(cur);
22304 desret_xmlChar_ptr(ret_val);
22306 des_xmlNodePtr(n_cur, cur, 0);
22307 xmlResetLastError();
22308 if (mem_base != xmlMemBlocks()) {
22309 printf("Leak of %d blocks found in xmlNodeGetLang",
22310 xmlMemBlocks() - mem_base);
22312 printf(" %d", n_cur);
22323 test_xmlNodeGetSpacePreserve(void) {
22328 xmlNodePtr cur; /* the node being checked */
22331 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22332 mem_base = xmlMemBlocks();
22333 cur = gen_xmlNodePtr(n_cur, 0);
22335 ret_val = xmlNodeGetSpacePreserve(cur);
22336 desret_int(ret_val);
22338 des_xmlNodePtr(n_cur, cur, 0);
22339 xmlResetLastError();
22340 if (mem_base != xmlMemBlocks()) {
22341 printf("Leak of %d blocks found in xmlNodeGetSpacePreserve",
22342 xmlMemBlocks() - mem_base);
22344 printf(" %d", n_cur);
22355 test_xmlNodeIsText(void) {
22360 xmlNodePtr node; /* the node */
22363 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
22364 mem_base = xmlMemBlocks();
22365 node = gen_xmlNodePtr(n_node, 0);
22367 ret_val = xmlNodeIsText(node);
22368 desret_int(ret_val);
22370 des_xmlNodePtr(n_node, node, 0);
22371 xmlResetLastError();
22372 if (mem_base != xmlMemBlocks()) {
22373 printf("Leak of %d blocks found in xmlNodeIsText",
22374 xmlMemBlocks() - mem_base);
22376 printf(" %d", n_node);
22387 test_xmlNodeListGetRawString(void) {
22390 #if defined(LIBXML_TREE_ENABLED)
22393 xmlDocPtr doc; /* the document */
22395 xmlNodePtr list; /* a Node list */
22397 int inLine; /* should we replace entity contents or show their external form */
22400 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22401 for (n_list = 0;n_list < gen_nb_xmlNodePtr;n_list++) {
22402 for (n_inLine = 0;n_inLine < gen_nb_int;n_inLine++) {
22403 mem_base = xmlMemBlocks();
22404 doc = gen_xmlDocPtr(n_doc, 0);
22405 list = gen_xmlNodePtr(n_list, 1);
22406 inLine = gen_int(n_inLine, 2);
22408 ret_val = xmlNodeListGetRawString(doc, list, inLine);
22409 desret_xmlChar_ptr(ret_val);
22411 des_xmlDocPtr(n_doc, doc, 0);
22412 des_xmlNodePtr(n_list, list, 1);
22413 des_int(n_inLine, inLine, 2);
22414 xmlResetLastError();
22415 if (mem_base != xmlMemBlocks()) {
22416 printf("Leak of %d blocks found in xmlNodeListGetRawString",
22417 xmlMemBlocks() - mem_base);
22419 printf(" %d", n_doc);
22420 printf(" %d", n_list);
22421 printf(" %d", n_inLine);
22435 test_xmlNodeListGetString(void) {
22440 xmlDocPtr doc; /* the document */
22442 xmlNodePtr list; /* a Node list */
22444 int inLine; /* should we replace entity contents or show their external form */
22447 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22448 for (n_list = 0;n_list < gen_nb_xmlNodePtr;n_list++) {
22449 for (n_inLine = 0;n_inLine < gen_nb_int;n_inLine++) {
22450 mem_base = xmlMemBlocks();
22451 doc = gen_xmlDocPtr(n_doc, 0);
22452 list = gen_xmlNodePtr(n_list, 1);
22453 inLine = gen_int(n_inLine, 2);
22455 ret_val = xmlNodeListGetString(doc, list, inLine);
22456 desret_xmlChar_ptr(ret_val);
22458 des_xmlDocPtr(n_doc, doc, 0);
22459 des_xmlNodePtr(n_list, list, 1);
22460 des_int(n_inLine, inLine, 2);
22461 xmlResetLastError();
22462 if (mem_base != xmlMemBlocks()) {
22463 printf("Leak of %d blocks found in xmlNodeListGetString",
22464 xmlMemBlocks() - mem_base);
22466 printf(" %d", n_doc);
22467 printf(" %d", n_list);
22468 printf(" %d", n_inLine);
22481 test_xmlNodeSetBase(void) {
22484 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED)
22486 xmlNodePtr cur; /* the node being changed */
22488 xmlChar * uri; /* the new base URI */
22491 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22492 for (n_uri = 0;n_uri < gen_nb_const_xmlChar_ptr;n_uri++) {
22493 mem_base = xmlMemBlocks();
22494 cur = gen_xmlNodePtr(n_cur, 0);
22495 uri = gen_const_xmlChar_ptr(n_uri, 1);
22497 xmlNodeSetBase(cur, (const xmlChar *)uri);
22499 des_xmlNodePtr(n_cur, cur, 0);
22500 des_const_xmlChar_ptr(n_uri, (const xmlChar *)uri, 1);
22501 xmlResetLastError();
22502 if (mem_base != xmlMemBlocks()) {
22503 printf("Leak of %d blocks found in xmlNodeSetBase",
22504 xmlMemBlocks() - mem_base);
22506 printf(" %d", n_cur);
22507 printf(" %d", n_uri);
22520 test_xmlNodeSetContent(void) {
22524 xmlNodePtr cur; /* the node being modified */
22526 xmlChar * content; /* the new value of the content */
22529 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22530 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
22531 mem_base = xmlMemBlocks();
22532 cur = gen_xmlNodePtr(n_cur, 0);
22533 content = gen_const_xmlChar_ptr(n_content, 1);
22535 xmlNodeSetContent(cur, (const xmlChar *)content);
22537 des_xmlNodePtr(n_cur, cur, 0);
22538 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
22539 xmlResetLastError();
22540 if (mem_base != xmlMemBlocks()) {
22541 printf("Leak of %d blocks found in xmlNodeSetContent",
22542 xmlMemBlocks() - mem_base);
22544 printf(" %d", n_cur);
22545 printf(" %d", n_content);
22557 test_xmlNodeSetContentLen(void) {
22560 #if defined(LIBXML_TREE_ENABLED)
22562 xmlNodePtr cur; /* the node being modified */
22564 xmlChar * content; /* the new value of the content */
22566 int len; /* the size of @content */
22569 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22570 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
22571 for (n_len = 0;n_len < gen_nb_int;n_len++) {
22572 mem_base = xmlMemBlocks();
22573 cur = gen_xmlNodePtr(n_cur, 0);
22574 content = gen_const_xmlChar_ptr(n_content, 1);
22575 len = gen_int(n_len, 2);
22577 xmlNodeSetContentLen(cur, (const xmlChar *)content, len);
22579 des_xmlNodePtr(n_cur, cur, 0);
22580 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
22581 des_int(n_len, len, 2);
22582 xmlResetLastError();
22583 if (mem_base != xmlMemBlocks()) {
22584 printf("Leak of %d blocks found in xmlNodeSetContentLen",
22585 xmlMemBlocks() - mem_base);
22587 printf(" %d", n_cur);
22588 printf(" %d", n_content);
22589 printf(" %d", n_len);
22603 test_xmlNodeSetLang(void) {
22606 #if defined(LIBXML_TREE_ENABLED)
22608 xmlNodePtr cur; /* the node being changed */
22610 xmlChar * lang; /* the language description */
22613 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22614 for (n_lang = 0;n_lang < gen_nb_const_xmlChar_ptr;n_lang++) {
22615 mem_base = xmlMemBlocks();
22616 cur = gen_xmlNodePtr(n_cur, 0);
22617 lang = gen_const_xmlChar_ptr(n_lang, 1);
22619 xmlNodeSetLang(cur, (const xmlChar *)lang);
22621 des_xmlNodePtr(n_cur, cur, 0);
22622 des_const_xmlChar_ptr(n_lang, (const xmlChar *)lang, 1);
22623 xmlResetLastError();
22624 if (mem_base != xmlMemBlocks()) {
22625 printf("Leak of %d blocks found in xmlNodeSetLang",
22626 xmlMemBlocks() - mem_base);
22628 printf(" %d", n_cur);
22629 printf(" %d", n_lang);
22642 test_xmlNodeSetName(void) {
22645 #if defined(LIBXML_TREE_ENABLED)
22647 xmlNodePtr cur; /* the node being changed */
22649 xmlChar * name; /* the new tag name */
22652 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22653 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
22654 mem_base = xmlMemBlocks();
22655 cur = gen_xmlNodePtr(n_cur, 0);
22656 name = gen_const_xmlChar_ptr(n_name, 1);
22658 xmlNodeSetName(cur, (const xmlChar *)name);
22660 des_xmlNodePtr(n_cur, cur, 0);
22661 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
22662 xmlResetLastError();
22663 if (mem_base != xmlMemBlocks()) {
22664 printf("Leak of %d blocks found in xmlNodeSetName",
22665 xmlMemBlocks() - mem_base);
22667 printf(" %d", n_cur);
22668 printf(" %d", n_name);
22681 test_xmlNodeSetSpacePreserve(void) {
22684 #if defined(LIBXML_TREE_ENABLED)
22686 xmlNodePtr cur; /* the node being changed */
22688 int val; /* the xml:space value ("0": default, 1: "preserve") */
22691 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22692 for (n_val = 0;n_val < gen_nb_int;n_val++) {
22693 mem_base = xmlMemBlocks();
22694 cur = gen_xmlNodePtr(n_cur, 0);
22695 val = gen_int(n_val, 1);
22697 xmlNodeSetSpacePreserve(cur, val);
22699 des_xmlNodePtr(n_cur, cur, 0);
22700 des_int(n_val, val, 1);
22701 xmlResetLastError();
22702 if (mem_base != xmlMemBlocks()) {
22703 printf("Leak of %d blocks found in xmlNodeSetSpacePreserve",
22704 xmlMemBlocks() - mem_base);
22706 printf(" %d", n_cur);
22707 printf(" %d", n_val);
22720 test_xmlPreviousElementSibling(void) {
22723 #if defined(LIBXML_TREE_ENABLED)
22725 xmlNodePtr ret_val;
22726 xmlNodePtr node; /* the current node */
22729 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
22730 mem_base = xmlMemBlocks();
22731 node = gen_xmlNodePtr(n_node, 0);
22733 ret_val = xmlPreviousElementSibling(node);
22734 desret_xmlNodePtr(ret_val);
22736 des_xmlNodePtr(n_node, node, 0);
22737 xmlResetLastError();
22738 if (mem_base != xmlMemBlocks()) {
22739 printf("Leak of %d blocks found in xmlPreviousElementSibling",
22740 xmlMemBlocks() - mem_base);
22742 printf(" %d", n_node);
22754 test_xmlReconciliateNs(void) {
22757 #if defined(LIBXML_TREE_ENABLED)
22758 #ifdef LIBXML_TREE_ENABLED
22761 xmlDocPtr doc; /* the document */
22763 xmlNodePtr tree; /* a node defining the subtree to reconciliate */
22766 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22767 for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
22768 mem_base = xmlMemBlocks();
22769 doc = gen_xmlDocPtr(n_doc, 0);
22770 tree = gen_xmlNodePtr(n_tree, 1);
22772 ret_val = xmlReconciliateNs(doc, tree);
22773 desret_int(ret_val);
22775 des_xmlDocPtr(n_doc, doc, 0);
22776 des_xmlNodePtr(n_tree, tree, 1);
22777 xmlResetLastError();
22778 if (mem_base != xmlMemBlocks()) {
22779 printf("Leak of %d blocks found in xmlReconciliateNs",
22780 xmlMemBlocks() - mem_base);
22782 printf(" %d", n_doc);
22783 printf(" %d", n_tree);
22797 test_xmlRemoveProp(void) {
22802 xmlAttrPtr cur; /* an attribute */
22805 for (n_cur = 0;n_cur < gen_nb_xmlAttrPtr;n_cur++) {
22806 mem_base = xmlMemBlocks();
22807 cur = gen_xmlAttrPtr(n_cur, 0);
22809 ret_val = xmlRemoveProp(cur);
22811 desret_int(ret_val);
22813 des_xmlAttrPtr(n_cur, cur, 0);
22814 xmlResetLastError();
22815 if (mem_base != xmlMemBlocks()) {
22816 printf("Leak of %d blocks found in xmlRemoveProp",
22817 xmlMemBlocks() - mem_base);
22819 printf(" %d", n_cur);
22830 test_xmlReplaceNode(void) {
22833 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED)
22835 xmlNodePtr ret_val;
22836 xmlNodePtr old; /* the old node */
22838 xmlNodePtr cur; /* the node */
22841 for (n_old = 0;n_old < gen_nb_xmlNodePtr;n_old++) {
22842 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr_in;n_cur++) {
22843 mem_base = xmlMemBlocks();
22844 old = gen_xmlNodePtr(n_old, 0);
22845 cur = gen_xmlNodePtr_in(n_cur, 1);
22847 ret_val = xmlReplaceNode(old, cur);
22849 xmlUnlinkNode(cur);
22850 xmlFreeNode(cur) ; cur = NULL ; }
22852 xmlUnlinkNode(old);
22853 xmlFreeNode(old) ; old = NULL ; }
22855 desret_xmlNodePtr(ret_val);
22857 des_xmlNodePtr(n_old, old, 0);
22858 des_xmlNodePtr_in(n_cur, cur, 1);
22859 xmlResetLastError();
22860 if (mem_base != xmlMemBlocks()) {
22861 printf("Leak of %d blocks found in xmlReplaceNode",
22862 xmlMemBlocks() - mem_base);
22864 printf(" %d", n_old);
22865 printf(" %d", n_cur);
22878 test_xmlSaveFile(void) {
22881 #if defined(LIBXML_OUTPUT_ENABLED)
22884 const char * filename; /* the filename (or URL) */
22886 xmlDocPtr cur; /* the document */
22889 for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
22890 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
22891 mem_base = xmlMemBlocks();
22892 filename = gen_fileoutput(n_filename, 0);
22893 cur = gen_xmlDocPtr(n_cur, 1);
22895 ret_val = xmlSaveFile(filename, cur);
22896 desret_int(ret_val);
22898 des_fileoutput(n_filename, filename, 0);
22899 des_xmlDocPtr(n_cur, cur, 1);
22900 xmlResetLastError();
22901 if (mem_base != xmlMemBlocks()) {
22902 printf("Leak of %d blocks found in xmlSaveFile",
22903 xmlMemBlocks() - mem_base);
22905 printf(" %d", n_filename);
22906 printf(" %d", n_cur);
22919 test_xmlSaveFileEnc(void) {
22922 #if defined(LIBXML_OUTPUT_ENABLED)
22925 const char * filename; /* the filename (or URL) */
22927 xmlDocPtr cur; /* the document */
22929 char * encoding; /* the name of an encoding (or NULL) */
22932 for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
22933 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
22934 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
22935 mem_base = xmlMemBlocks();
22936 filename = gen_fileoutput(n_filename, 0);
22937 cur = gen_xmlDocPtr(n_cur, 1);
22938 encoding = gen_const_char_ptr(n_encoding, 2);
22940 ret_val = xmlSaveFileEnc(filename, cur, (const char *)encoding);
22941 desret_int(ret_val);
22943 des_fileoutput(n_filename, filename, 0);
22944 des_xmlDocPtr(n_cur, cur, 1);
22945 des_const_char_ptr(n_encoding, (const char *)encoding, 2);
22946 xmlResetLastError();
22947 if (mem_base != xmlMemBlocks()) {
22948 printf("Leak of %d blocks found in xmlSaveFileEnc",
22949 xmlMemBlocks() - mem_base);
22951 printf(" %d", n_filename);
22952 printf(" %d", n_cur);
22953 printf(" %d", n_encoding);
22967 test_xmlSaveFileTo(void) {
22970 #if defined(LIBXML_OUTPUT_ENABLED)
22973 xmlOutputBufferPtr buf; /* an output I/O buffer */
22975 xmlDocPtr cur; /* the document */
22977 char * encoding; /* the encoding if any assuming the I/O layer handles the trancoding */
22980 for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
22981 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
22982 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
22983 mem_base = xmlMemBlocks();
22984 buf = gen_xmlOutputBufferPtr(n_buf, 0);
22985 cur = gen_xmlDocPtr(n_cur, 1);
22986 encoding = gen_const_char_ptr(n_encoding, 2);
22988 ret_val = xmlSaveFileTo(buf, cur, (const char *)encoding);
22990 desret_int(ret_val);
22992 des_xmlOutputBufferPtr(n_buf, buf, 0);
22993 des_xmlDocPtr(n_cur, cur, 1);
22994 des_const_char_ptr(n_encoding, (const char *)encoding, 2);
22995 xmlResetLastError();
22996 if (mem_base != xmlMemBlocks()) {
22997 printf("Leak of %d blocks found in xmlSaveFileTo",
22998 xmlMemBlocks() - mem_base);
23000 printf(" %d", n_buf);
23001 printf(" %d", n_cur);
23002 printf(" %d", n_encoding);
23016 test_xmlSaveFormatFile(void) {
23019 #if defined(LIBXML_OUTPUT_ENABLED)
23022 const char * filename; /* the filename (or URL) */
23024 xmlDocPtr cur; /* the document */
23026 int format; /* should formatting spaces been added */
23029 for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
23030 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
23031 for (n_format = 0;n_format < gen_nb_int;n_format++) {
23032 mem_base = xmlMemBlocks();
23033 filename = gen_fileoutput(n_filename, 0);
23034 cur = gen_xmlDocPtr(n_cur, 1);
23035 format = gen_int(n_format, 2);
23037 ret_val = xmlSaveFormatFile(filename, cur, format);
23038 desret_int(ret_val);
23040 des_fileoutput(n_filename, filename, 0);
23041 des_xmlDocPtr(n_cur, cur, 1);
23042 des_int(n_format, format, 2);
23043 xmlResetLastError();
23044 if (mem_base != xmlMemBlocks()) {
23045 printf("Leak of %d blocks found in xmlSaveFormatFile",
23046 xmlMemBlocks() - mem_base);
23048 printf(" %d", n_filename);
23049 printf(" %d", n_cur);
23050 printf(" %d", n_format);
23064 test_xmlSaveFormatFileEnc(void) {
23067 #if defined(LIBXML_OUTPUT_ENABLED)
23070 const char * filename; /* the filename or URL to output */
23072 xmlDocPtr cur; /* the document being saved */
23074 char * encoding; /* the name of the encoding to use or NULL. */
23076 int format; /* should formatting spaces be added. */
23079 for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
23080 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
23081 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
23082 for (n_format = 0;n_format < gen_nb_int;n_format++) {
23083 mem_base = xmlMemBlocks();
23084 filename = gen_fileoutput(n_filename, 0);
23085 cur = gen_xmlDocPtr(n_cur, 1);
23086 encoding = gen_const_char_ptr(n_encoding, 2);
23087 format = gen_int(n_format, 3);
23089 ret_val = xmlSaveFormatFileEnc(filename, cur, (const char *)encoding, format);
23090 desret_int(ret_val);
23092 des_fileoutput(n_filename, filename, 0);
23093 des_xmlDocPtr(n_cur, cur, 1);
23094 des_const_char_ptr(n_encoding, (const char *)encoding, 2);
23095 des_int(n_format, format, 3);
23096 xmlResetLastError();
23097 if (mem_base != xmlMemBlocks()) {
23098 printf("Leak of %d blocks found in xmlSaveFormatFileEnc",
23099 xmlMemBlocks() - mem_base);
23101 printf(" %d", n_filename);
23102 printf(" %d", n_cur);
23103 printf(" %d", n_encoding);
23104 printf(" %d", n_format);
23119 test_xmlSaveFormatFileTo(void) {
23122 #if defined(LIBXML_OUTPUT_ENABLED)
23125 xmlOutputBufferPtr buf; /* an output I/O buffer */
23127 xmlDocPtr cur; /* the document */
23129 char * encoding; /* the encoding if any assuming the I/O layer handles the trancoding */
23131 int format; /* should formatting spaces been added */
23134 for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
23135 for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
23136 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
23137 for (n_format = 0;n_format < gen_nb_int;n_format++) {
23138 mem_base = xmlMemBlocks();
23139 buf = gen_xmlOutputBufferPtr(n_buf, 0);
23140 cur = gen_xmlDocPtr(n_cur, 1);
23141 encoding = gen_const_char_ptr(n_encoding, 2);
23142 format = gen_int(n_format, 3);
23144 ret_val = xmlSaveFormatFileTo(buf, cur, (const char *)encoding, format);
23146 desret_int(ret_val);
23148 des_xmlOutputBufferPtr(n_buf, buf, 0);
23149 des_xmlDocPtr(n_cur, cur, 1);
23150 des_const_char_ptr(n_encoding, (const char *)encoding, 2);
23151 des_int(n_format, format, 3);
23152 xmlResetLastError();
23153 if (mem_base != xmlMemBlocks()) {
23154 printf("Leak of %d blocks found in xmlSaveFormatFileTo",
23155 xmlMemBlocks() - mem_base);
23157 printf(" %d", n_buf);
23158 printf(" %d", n_cur);
23159 printf(" %d", n_encoding);
23160 printf(" %d", n_format);
23175 test_xmlSearchNs(void) {
23180 xmlDocPtr doc; /* the document */
23182 xmlNodePtr node; /* the current node */
23184 xmlChar * nameSpace; /* the namespace prefix */
23187 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
23188 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23189 for (n_nameSpace = 0;n_nameSpace < gen_nb_const_xmlChar_ptr;n_nameSpace++) {
23190 mem_base = xmlMemBlocks();
23191 doc = gen_xmlDocPtr(n_doc, 0);
23192 node = gen_xmlNodePtr(n_node, 1);
23193 nameSpace = gen_const_xmlChar_ptr(n_nameSpace, 2);
23195 ret_val = xmlSearchNs(doc, node, (const xmlChar *)nameSpace);
23196 desret_xmlNsPtr(ret_val);
23198 des_xmlDocPtr(n_doc, doc, 0);
23199 des_xmlNodePtr(n_node, node, 1);
23200 des_const_xmlChar_ptr(n_nameSpace, (const xmlChar *)nameSpace, 2);
23201 xmlResetLastError();
23202 if (mem_base != xmlMemBlocks()) {
23203 printf("Leak of %d blocks found in xmlSearchNs",
23204 xmlMemBlocks() - mem_base);
23206 printf(" %d", n_doc);
23207 printf(" %d", n_node);
23208 printf(" %d", n_nameSpace);
23221 test_xmlSearchNsByHref(void) {
23226 xmlDocPtr doc; /* the document */
23228 xmlNodePtr node; /* the current node */
23230 xmlChar * href; /* the namespace value */
23233 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
23234 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23235 for (n_href = 0;n_href < gen_nb_const_xmlChar_ptr;n_href++) {
23236 mem_base = xmlMemBlocks();
23237 doc = gen_xmlDocPtr(n_doc, 0);
23238 node = gen_xmlNodePtr(n_node, 1);
23239 href = gen_const_xmlChar_ptr(n_href, 2);
23241 ret_val = xmlSearchNsByHref(doc, node, (const xmlChar *)href);
23242 desret_xmlNsPtr(ret_val);
23244 des_xmlDocPtr(n_doc, doc, 0);
23245 des_xmlNodePtr(n_node, node, 1);
23246 des_const_xmlChar_ptr(n_href, (const xmlChar *)href, 2);
23247 xmlResetLastError();
23248 if (mem_base != xmlMemBlocks()) {
23249 printf("Leak of %d blocks found in xmlSearchNsByHref",
23250 xmlMemBlocks() - mem_base);
23252 printf(" %d", n_doc);
23253 printf(" %d", n_node);
23254 printf(" %d", n_href);
23267 test_xmlSetBufferAllocationScheme(void) {
23271 xmlBufferAllocationScheme scheme; /* allocation method to use */
23274 for (n_scheme = 0;n_scheme < gen_nb_xmlBufferAllocationScheme;n_scheme++) {
23275 mem_base = xmlMemBlocks();
23276 scheme = gen_xmlBufferAllocationScheme(n_scheme, 0);
23278 xmlSetBufferAllocationScheme(scheme);
23280 des_xmlBufferAllocationScheme(n_scheme, scheme, 0);
23281 xmlResetLastError();
23282 if (mem_base != xmlMemBlocks()) {
23283 printf("Leak of %d blocks found in xmlSetBufferAllocationScheme",
23284 xmlMemBlocks() - mem_base);
23286 printf(" %d", n_scheme);
23297 test_xmlSetCompressMode(void) {
23301 int mode; /* the compression ratio */
23304 for (n_mode = 0;n_mode < gen_nb_int;n_mode++) {
23305 mem_base = xmlMemBlocks();
23306 mode = gen_int(n_mode, 0);
23308 xmlSetCompressMode(mode);
23310 des_int(n_mode, mode, 0);
23311 xmlResetLastError();
23312 if (mem_base != xmlMemBlocks()) {
23313 printf("Leak of %d blocks found in xmlSetCompressMode",
23314 xmlMemBlocks() - mem_base);
23316 printf(" %d", n_mode);
23327 test_xmlSetDocCompressMode(void) {
23331 xmlDocPtr doc; /* the document */
23333 int mode; /* the compression ratio */
23336 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
23337 for (n_mode = 0;n_mode < gen_nb_int;n_mode++) {
23338 mem_base = xmlMemBlocks();
23339 doc = gen_xmlDocPtr(n_doc, 0);
23340 mode = gen_int(n_mode, 1);
23342 xmlSetDocCompressMode(doc, mode);
23344 des_xmlDocPtr(n_doc, doc, 0);
23345 des_int(n_mode, mode, 1);
23346 xmlResetLastError();
23347 if (mem_base != xmlMemBlocks()) {
23348 printf("Leak of %d blocks found in xmlSetDocCompressMode",
23349 xmlMemBlocks() - mem_base);
23351 printf(" %d", n_doc);
23352 printf(" %d", n_mode);
23364 test_xmlSetNs(void) {
23368 xmlNodePtr node; /* a node in the document */
23370 xmlNsPtr ns; /* a namespace pointer */
23373 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23374 for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
23375 mem_base = xmlMemBlocks();
23376 node = gen_xmlNodePtr(n_node, 0);
23377 ns = gen_xmlNsPtr(n_ns, 1);
23379 xmlSetNs(node, ns);
23381 des_xmlNodePtr(n_node, node, 0);
23382 des_xmlNsPtr(n_ns, ns, 1);
23383 xmlResetLastError();
23384 if (mem_base != xmlMemBlocks()) {
23385 printf("Leak of %d blocks found in xmlSetNs",
23386 xmlMemBlocks() - mem_base);
23388 printf(" %d", n_node);
23389 printf(" %d", n_ns);
23401 test_xmlSetNsProp(void) {
23404 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED)
23406 xmlAttrPtr ret_val;
23407 xmlNodePtr node; /* the node */
23409 xmlNsPtr ns; /* the namespace definition */
23411 xmlChar * name; /* the attribute name */
23413 xmlChar * value; /* the attribute value */
23416 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23417 for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
23418 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23419 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23420 mem_base = xmlMemBlocks();
23421 node = gen_xmlNodePtr(n_node, 0);
23422 ns = gen_xmlNsPtr(n_ns, 1);
23423 name = gen_const_xmlChar_ptr(n_name, 2);
23424 value = gen_const_xmlChar_ptr(n_value, 3);
23426 ret_val = xmlSetNsProp(node, ns, (const xmlChar *)name, (const xmlChar *)value);
23427 desret_xmlAttrPtr(ret_val);
23429 des_xmlNodePtr(n_node, node, 0);
23430 des_xmlNsPtr(n_ns, ns, 1);
23431 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
23432 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
23433 xmlResetLastError();
23434 if (mem_base != xmlMemBlocks()) {
23435 printf("Leak of %d blocks found in xmlSetNsProp",
23436 xmlMemBlocks() - mem_base);
23438 printf(" %d", n_node);
23439 printf(" %d", n_ns);
23440 printf(" %d", n_name);
23441 printf(" %d", n_value);
23456 test_xmlSetProp(void) {
23459 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED)
23461 xmlAttrPtr ret_val;
23462 xmlNodePtr node; /* the node */
23464 xmlChar * name; /* the attribute name (a QName) */
23466 xmlChar * value; /* the attribute value */
23469 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23470 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23471 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23472 mem_base = xmlMemBlocks();
23473 node = gen_xmlNodePtr(n_node, 0);
23474 name = gen_const_xmlChar_ptr(n_name, 1);
23475 value = gen_const_xmlChar_ptr(n_value, 2);
23477 ret_val = xmlSetProp(node, (const xmlChar *)name, (const xmlChar *)value);
23478 desret_xmlAttrPtr(ret_val);
23480 des_xmlNodePtr(n_node, node, 0);
23481 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
23482 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
23483 xmlResetLastError();
23484 if (mem_base != xmlMemBlocks()) {
23485 printf("Leak of %d blocks found in xmlSetProp",
23486 xmlMemBlocks() - mem_base);
23488 printf(" %d", n_node);
23489 printf(" %d", n_name);
23490 printf(" %d", n_value);
23504 test_xmlSplitQName2(void) {
23509 xmlChar * name; /* the full QName */
23511 xmlChar ** prefix; /* a xmlChar ** */
23514 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23515 for (n_prefix = 0;n_prefix < gen_nb_xmlChar_ptr_ptr;n_prefix++) {
23516 mem_base = xmlMemBlocks();
23517 name = gen_const_xmlChar_ptr(n_name, 0);
23518 prefix = gen_xmlChar_ptr_ptr(n_prefix, 1);
23520 ret_val = xmlSplitQName2((const xmlChar *)name, prefix);
23521 desret_xmlChar_ptr(ret_val);
23523 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
23524 des_xmlChar_ptr_ptr(n_prefix, prefix, 1);
23525 xmlResetLastError();
23526 if (mem_base != xmlMemBlocks()) {
23527 printf("Leak of %d blocks found in xmlSplitQName2",
23528 xmlMemBlocks() - mem_base);
23530 printf(" %d", n_name);
23531 printf(" %d", n_prefix);
23543 test_xmlSplitQName3(void) {
23547 const xmlChar * ret_val;
23548 xmlChar * name; /* the full QName */
23550 int * len; /* an int * */
23553 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23554 for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
23555 mem_base = xmlMemBlocks();
23556 name = gen_const_xmlChar_ptr(n_name, 0);
23557 len = gen_int_ptr(n_len, 1);
23559 ret_val = xmlSplitQName3((const xmlChar *)name, len);
23560 desret_const_xmlChar_ptr(ret_val);
23562 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
23563 des_int_ptr(n_len, len, 1);
23564 xmlResetLastError();
23565 if (mem_base != xmlMemBlocks()) {
23566 printf("Leak of %d blocks found in xmlSplitQName3",
23567 xmlMemBlocks() - mem_base);
23569 printf(" %d", n_name);
23570 printf(" %d", n_len);
23582 test_xmlStringGetNodeList(void) {
23586 xmlNodePtr ret_val;
23587 xmlDocPtr doc; /* the document */
23589 xmlChar * value; /* the value of the attribute */
23592 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
23593 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23594 mem_base = xmlMemBlocks();
23595 doc = gen_xmlDocPtr(n_doc, 0);
23596 value = gen_const_xmlChar_ptr(n_value, 1);
23598 ret_val = xmlStringGetNodeList(doc, (const xmlChar *)value);
23599 desret_xmlNodePtr(ret_val);
23601 des_xmlDocPtr(n_doc, doc, 0);
23602 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
23603 xmlResetLastError();
23604 if (mem_base != xmlMemBlocks()) {
23605 printf("Leak of %d blocks found in xmlStringGetNodeList",
23606 xmlMemBlocks() - mem_base);
23608 printf(" %d", n_doc);
23609 printf(" %d", n_value);
23621 test_xmlStringLenGetNodeList(void) {
23625 xmlNodePtr ret_val;
23626 xmlDocPtr doc; /* the document */
23628 xmlChar * value; /* the value of the text */
23630 int len; /* the length of the string value */
23633 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
23634 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23635 for (n_len = 0;n_len < gen_nb_int;n_len++) {
23636 mem_base = xmlMemBlocks();
23637 doc = gen_xmlDocPtr(n_doc, 0);
23638 value = gen_const_xmlChar_ptr(n_value, 1);
23639 len = gen_int(n_len, 2);
23641 ret_val = xmlStringLenGetNodeList(doc, (const xmlChar *)value, len);
23642 desret_xmlNodePtr(ret_val);
23644 des_xmlDocPtr(n_doc, doc, 0);
23645 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
23646 des_int(n_len, len, 2);
23647 xmlResetLastError();
23648 if (mem_base != xmlMemBlocks()) {
23649 printf("Leak of %d blocks found in xmlStringLenGetNodeList",
23650 xmlMemBlocks() - mem_base);
23652 printf(" %d", n_doc);
23653 printf(" %d", n_value);
23654 printf(" %d", n_len);
23667 test_xmlTextConcat(void) {
23672 xmlNodePtr node; /* the node */
23674 xmlChar * content; /* the content */
23676 int len; /* @content length */
23679 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23680 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
23681 for (n_len = 0;n_len < gen_nb_int;n_len++) {
23682 mem_base = xmlMemBlocks();
23683 node = gen_xmlNodePtr(n_node, 0);
23684 content = gen_const_xmlChar_ptr(n_content, 1);
23685 len = gen_int(n_len, 2);
23687 ret_val = xmlTextConcat(node, (const xmlChar *)content, len);
23688 desret_int(ret_val);
23690 des_xmlNodePtr(n_node, node, 0);
23691 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
23692 des_int(n_len, len, 2);
23693 xmlResetLastError();
23694 if (mem_base != xmlMemBlocks()) {
23695 printf("Leak of %d blocks found in xmlTextConcat",
23696 xmlMemBlocks() - mem_base);
23698 printf(" %d", n_node);
23699 printf(" %d", n_content);
23700 printf(" %d", n_len);
23713 test_xmlTextMerge(void) {
23717 xmlNodePtr ret_val;
23718 xmlNodePtr first; /* the first text node */
23720 xmlNodePtr second; /* the second text node being merged */
23723 for (n_first = 0;n_first < gen_nb_xmlNodePtr_in;n_first++) {
23724 for (n_second = 0;n_second < gen_nb_xmlNodePtr_in;n_second++) {
23725 mem_base = xmlMemBlocks();
23726 first = gen_xmlNodePtr_in(n_first, 0);
23727 second = gen_xmlNodePtr_in(n_second, 1);
23729 ret_val = xmlTextMerge(first, second);
23730 if ((first != NULL) && (first->type != XML_TEXT_NODE)) {
23731 xmlUnlinkNode(second);
23732 xmlFreeNode(second) ; second = NULL ; }
23733 desret_xmlNodePtr(ret_val);
23735 des_xmlNodePtr_in(n_first, first, 0);
23736 des_xmlNodePtr_in(n_second, second, 1);
23737 xmlResetLastError();
23738 if (mem_base != xmlMemBlocks()) {
23739 printf("Leak of %d blocks found in xmlTextMerge",
23740 xmlMemBlocks() - mem_base);
23742 printf(" %d", n_first);
23743 printf(" %d", n_second);
23755 test_xmlUnsetNsProp(void) {
23758 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
23761 xmlNodePtr node; /* the node */
23763 xmlNsPtr ns; /* the namespace definition */
23765 xmlChar * name; /* the attribute name */
23768 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23769 for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
23770 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23771 mem_base = xmlMemBlocks();
23772 node = gen_xmlNodePtr(n_node, 0);
23773 ns = gen_xmlNsPtr(n_ns, 1);
23774 name = gen_const_xmlChar_ptr(n_name, 2);
23776 ret_val = xmlUnsetNsProp(node, ns, (const xmlChar *)name);
23777 desret_int(ret_val);
23779 des_xmlNodePtr(n_node, node, 0);
23780 des_xmlNsPtr(n_ns, ns, 1);
23781 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
23782 xmlResetLastError();
23783 if (mem_base != xmlMemBlocks()) {
23784 printf("Leak of %d blocks found in xmlUnsetNsProp",
23785 xmlMemBlocks() - mem_base);
23787 printf(" %d", n_node);
23788 printf(" %d", n_ns);
23789 printf(" %d", n_name);
23803 test_xmlUnsetProp(void) {
23806 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
23809 xmlNodePtr node; /* the node */
23811 xmlChar * name; /* the attribute name */
23814 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23815 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23816 mem_base = xmlMemBlocks();
23817 node = gen_xmlNodePtr(n_node, 0);
23818 name = gen_const_xmlChar_ptr(n_name, 1);
23820 ret_val = xmlUnsetProp(node, (const xmlChar *)name);
23821 desret_int(ret_val);
23823 des_xmlNodePtr(n_node, node, 0);
23824 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
23825 xmlResetLastError();
23826 if (mem_base != xmlMemBlocks()) {
23827 printf("Leak of %d blocks found in xmlUnsetProp",
23828 xmlMemBlocks() - mem_base);
23830 printf(" %d", n_node);
23831 printf(" %d", n_name);
23844 test_xmlValidateNCName(void) {
23847 #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)
23848 #ifdef LIBXML_TREE_ENABLED
23851 xmlChar * value; /* the value to check */
23853 int space; /* allow spaces in front and end of the string */
23856 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23857 for (n_space = 0;n_space < gen_nb_int;n_space++) {
23858 mem_base = xmlMemBlocks();
23859 value = gen_const_xmlChar_ptr(n_value, 0);
23860 space = gen_int(n_space, 1);
23862 ret_val = xmlValidateNCName((const xmlChar *)value, space);
23863 desret_int(ret_val);
23865 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
23866 des_int(n_space, space, 1);
23867 xmlResetLastError();
23868 if (mem_base != xmlMemBlocks()) {
23869 printf("Leak of %d blocks found in xmlValidateNCName",
23870 xmlMemBlocks() - mem_base);
23872 printf(" %d", n_value);
23873 printf(" %d", n_space);
23887 test_xmlValidateNMToken(void) {
23890 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
23891 #ifdef LIBXML_TREE_ENABLED
23894 xmlChar * value; /* the value to check */
23896 int space; /* allow spaces in front and end of the string */
23899 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23900 for (n_space = 0;n_space < gen_nb_int;n_space++) {
23901 mem_base = xmlMemBlocks();
23902 value = gen_const_xmlChar_ptr(n_value, 0);
23903 space = gen_int(n_space, 1);
23905 ret_val = xmlValidateNMToken((const xmlChar *)value, space);
23906 desret_int(ret_val);
23908 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
23909 des_int(n_space, space, 1);
23910 xmlResetLastError();
23911 if (mem_base != xmlMemBlocks()) {
23912 printf("Leak of %d blocks found in xmlValidateNMToken",
23913 xmlMemBlocks() - mem_base);
23915 printf(" %d", n_value);
23916 printf(" %d", n_space);
23930 test_xmlValidateName(void) {
23933 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
23934 #ifdef LIBXML_TREE_ENABLED
23937 xmlChar * value; /* the value to check */
23939 int space; /* allow spaces in front and end of the string */
23942 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23943 for (n_space = 0;n_space < gen_nb_int;n_space++) {
23944 mem_base = xmlMemBlocks();
23945 value = gen_const_xmlChar_ptr(n_value, 0);
23946 space = gen_int(n_space, 1);
23948 ret_val = xmlValidateName((const xmlChar *)value, space);
23949 desret_int(ret_val);
23951 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
23952 des_int(n_space, space, 1);
23953 xmlResetLastError();
23954 if (mem_base != xmlMemBlocks()) {
23955 printf("Leak of %d blocks found in xmlValidateName",
23956 xmlMemBlocks() - mem_base);
23958 printf(" %d", n_value);
23959 printf(" %d", n_space);
23973 test_xmlValidateQName(void) {
23976 #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
23977 #ifdef LIBXML_TREE_ENABLED
23980 xmlChar * value; /* the value to check */
23982 int space; /* allow spaces in front and end of the string */
23985 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23986 for (n_space = 0;n_space < gen_nb_int;n_space++) {
23987 mem_base = xmlMemBlocks();
23988 value = gen_const_xmlChar_ptr(n_value, 0);
23989 space = gen_int(n_space, 1);
23991 ret_val = xmlValidateQName((const xmlChar *)value, space);
23992 desret_int(ret_val);
23994 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
23995 des_int(n_space, space, 1);
23996 xmlResetLastError();
23997 if (mem_base != xmlMemBlocks()) {
23998 printf("Leak of %d blocks found in xmlValidateQName",
23999 xmlMemBlocks() - mem_base);
24001 printf(" %d", n_value);
24002 printf(" %d", n_space);
24018 if (quiet == 0) printf("Testing tree : 139 of 158 functions ...\n");
24019 test_ret += test_xmlAddChild();
24020 test_ret += test_xmlAddChildList();
24021 test_ret += test_xmlAddNextSibling();
24022 test_ret += test_xmlAddPrevSibling();
24023 test_ret += test_xmlAddSibling();
24024 test_ret += test_xmlAttrSerializeTxtContent();
24025 test_ret += test_xmlBufferAdd();
24026 test_ret += test_xmlBufferAddHead();
24027 test_ret += test_xmlBufferCCat();
24028 test_ret += test_xmlBufferCat();
24029 test_ret += test_xmlBufferContent();
24030 test_ret += test_xmlBufferCreate();
24031 test_ret += test_xmlBufferCreateSize();
24032 test_ret += test_xmlBufferCreateStatic();
24033 test_ret += test_xmlBufferDetach();
24034 test_ret += test_xmlBufferEmpty();
24035 test_ret += test_xmlBufferGrow();
24036 test_ret += test_xmlBufferLength();
24037 test_ret += test_xmlBufferResize();
24038 test_ret += test_xmlBufferSetAllocationScheme();
24039 test_ret += test_xmlBufferShrink();
24040 test_ret += test_xmlBufferWriteCHAR();
24041 test_ret += test_xmlBufferWriteChar();
24042 test_ret += test_xmlBufferWriteQuotedString();
24043 test_ret += test_xmlBuildQName();
24044 test_ret += test_xmlChildElementCount();
24045 test_ret += test_xmlCopyDoc();
24046 test_ret += test_xmlCopyDtd();
24047 test_ret += test_xmlCopyNamespace();
24048 test_ret += test_xmlCopyNamespaceList();
24049 test_ret += test_xmlCopyNode();
24050 test_ret += test_xmlCopyNodeList();
24051 test_ret += test_xmlCopyProp();
24052 test_ret += test_xmlCopyPropList();
24053 test_ret += test_xmlCreateIntSubset();
24054 test_ret += test_xmlDOMWrapAdoptNode();
24055 test_ret += test_xmlDOMWrapCloneNode();
24056 test_ret += test_xmlDOMWrapNewCtxt();
24057 test_ret += test_xmlDOMWrapReconcileNamespaces();
24058 test_ret += test_xmlDOMWrapRemoveNode();
24059 test_ret += test_xmlDocCopyNode();
24060 test_ret += test_xmlDocCopyNodeList();
24061 test_ret += test_xmlDocDump();
24062 test_ret += test_xmlDocDumpFormatMemory();
24063 test_ret += test_xmlDocDumpFormatMemoryEnc();
24064 test_ret += test_xmlDocDumpMemory();
24065 test_ret += test_xmlDocDumpMemoryEnc();
24066 test_ret += test_xmlDocFormatDump();
24067 test_ret += test_xmlDocGetRootElement();
24068 test_ret += test_xmlDocSetRootElement();
24069 test_ret += test_xmlElemDump();
24070 test_ret += test_xmlFirstElementChild();
24071 test_ret += test_xmlGetBufferAllocationScheme();
24072 test_ret += test_xmlGetCompressMode();
24073 test_ret += test_xmlGetDocCompressMode();
24074 test_ret += test_xmlGetIntSubset();
24075 test_ret += test_xmlGetLastChild();
24076 test_ret += test_xmlGetLineNo();
24077 test_ret += test_xmlGetNoNsProp();
24078 test_ret += test_xmlGetNodePath();
24079 test_ret += test_xmlGetNsList();
24080 test_ret += test_xmlGetNsProp();
24081 test_ret += test_xmlGetProp();
24082 test_ret += test_xmlHasNsProp();
24083 test_ret += test_xmlHasProp();
24084 test_ret += test_xmlIsBlankNode();
24085 test_ret += test_xmlIsXHTML();
24086 test_ret += test_xmlLastElementChild();
24087 test_ret += test_xmlNewCDataBlock();
24088 test_ret += test_xmlNewCharRef();
24089 test_ret += test_xmlNewChild();
24090 test_ret += test_xmlNewComment();
24091 test_ret += test_xmlNewDoc();
24092 test_ret += test_xmlNewDocComment();
24093 test_ret += test_xmlNewDocFragment();
24094 test_ret += test_xmlNewDocNode();
24095 test_ret += test_xmlNewDocNodeEatName();
24096 test_ret += test_xmlNewDocPI();
24097 test_ret += test_xmlNewDocProp();
24098 test_ret += test_xmlNewDocRawNode();
24099 test_ret += test_xmlNewDocText();
24100 test_ret += test_xmlNewDocTextLen();
24101 test_ret += test_xmlNewDtd();
24102 test_ret += test_xmlNewNode();
24103 test_ret += test_xmlNewNodeEatName();
24104 test_ret += test_xmlNewNs();
24105 test_ret += test_xmlNewNsProp();
24106 test_ret += test_xmlNewNsPropEatName();
24107 test_ret += test_xmlNewPI();
24108 test_ret += test_xmlNewProp();
24109 test_ret += test_xmlNewReference();
24110 test_ret += test_xmlNewText();
24111 test_ret += test_xmlNewTextChild();
24112 test_ret += test_xmlNewTextLen();
24113 test_ret += test_xmlNextElementSibling();
24114 test_ret += test_xmlNodeAddContent();
24115 test_ret += test_xmlNodeAddContentLen();
24116 test_ret += test_xmlNodeBufGetContent();
24117 test_ret += test_xmlNodeDump();
24118 test_ret += test_xmlNodeDumpOutput();
24119 test_ret += test_xmlNodeGetBase();
24120 test_ret += test_xmlNodeGetContent();
24121 test_ret += test_xmlNodeGetLang();
24122 test_ret += test_xmlNodeGetSpacePreserve();
24123 test_ret += test_xmlNodeIsText();
24124 test_ret += test_xmlNodeListGetRawString();
24125 test_ret += test_xmlNodeListGetString();
24126 test_ret += test_xmlNodeSetBase();
24127 test_ret += test_xmlNodeSetContent();
24128 test_ret += test_xmlNodeSetContentLen();
24129 test_ret += test_xmlNodeSetLang();
24130 test_ret += test_xmlNodeSetName();
24131 test_ret += test_xmlNodeSetSpacePreserve();
24132 test_ret += test_xmlPreviousElementSibling();
24133 test_ret += test_xmlReconciliateNs();
24134 test_ret += test_xmlRemoveProp();
24135 test_ret += test_xmlReplaceNode();
24136 test_ret += test_xmlSaveFile();
24137 test_ret += test_xmlSaveFileEnc();
24138 test_ret += test_xmlSaveFileTo();
24139 test_ret += test_xmlSaveFormatFile();
24140 test_ret += test_xmlSaveFormatFileEnc();
24141 test_ret += test_xmlSaveFormatFileTo();
24142 test_ret += test_xmlSearchNs();
24143 test_ret += test_xmlSearchNsByHref();
24144 test_ret += test_xmlSetBufferAllocationScheme();
24145 test_ret += test_xmlSetCompressMode();
24146 test_ret += test_xmlSetDocCompressMode();
24147 test_ret += test_xmlSetNs();
24148 test_ret += test_xmlSetNsProp();
24149 test_ret += test_xmlSetProp();
24150 test_ret += test_xmlSplitQName2();
24151 test_ret += test_xmlSplitQName3();
24152 test_ret += test_xmlStringGetNodeList();
24153 test_ret += test_xmlStringLenGetNodeList();
24154 test_ret += test_xmlTextConcat();
24155 test_ret += test_xmlTextMerge();
24156 test_ret += test_xmlUnsetNsProp();
24157 test_ret += test_xmlUnsetProp();
24158 test_ret += test_xmlValidateNCName();
24159 test_ret += test_xmlValidateNMToken();
24160 test_ret += test_xmlValidateName();
24161 test_ret += test_xmlValidateQName();
24164 printf("Module tree: %d errors\n", test_ret);
24169 test_xmlBuildRelativeURI(void) {
24174 xmlChar * URI; /* the URI reference under consideration */
24176 xmlChar * base; /* the base value */
24179 for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
24180 for (n_base = 0;n_base < gen_nb_const_xmlChar_ptr;n_base++) {
24181 mem_base = xmlMemBlocks();
24182 URI = gen_const_xmlChar_ptr(n_URI, 0);
24183 base = gen_const_xmlChar_ptr(n_base, 1);
24185 ret_val = xmlBuildRelativeURI((const xmlChar *)URI, (const xmlChar *)base);
24186 desret_xmlChar_ptr(ret_val);
24188 des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0);
24189 des_const_xmlChar_ptr(n_base, (const xmlChar *)base, 1);
24190 xmlResetLastError();
24191 if (mem_base != xmlMemBlocks()) {
24192 printf("Leak of %d blocks found in xmlBuildRelativeURI",
24193 xmlMemBlocks() - mem_base);
24195 printf(" %d", n_URI);
24196 printf(" %d", n_base);
24208 test_xmlBuildURI(void) {
24213 xmlChar * URI; /* the URI instance found in the document */
24215 xmlChar * base; /* the base value */
24218 for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
24219 for (n_base = 0;n_base < gen_nb_const_xmlChar_ptr;n_base++) {
24220 mem_base = xmlMemBlocks();
24221 URI = gen_const_xmlChar_ptr(n_URI, 0);
24222 base = gen_const_xmlChar_ptr(n_base, 1);
24224 ret_val = xmlBuildURI((const xmlChar *)URI, (const xmlChar *)base);
24225 desret_xmlChar_ptr(ret_val);
24227 des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0);
24228 des_const_xmlChar_ptr(n_base, (const xmlChar *)base, 1);
24229 xmlResetLastError();
24230 if (mem_base != xmlMemBlocks()) {
24231 printf("Leak of %d blocks found in xmlBuildURI",
24232 xmlMemBlocks() - mem_base);
24234 printf(" %d", n_URI);
24235 printf(" %d", n_base);
24247 test_xmlCanonicPath(void) {
24252 xmlChar * path; /* the resource locator in a filesystem notation */
24255 for (n_path = 0;n_path < gen_nb_const_xmlChar_ptr;n_path++) {
24256 mem_base = xmlMemBlocks();
24257 path = gen_const_xmlChar_ptr(n_path, 0);
24259 ret_val = xmlCanonicPath((const xmlChar *)path);
24260 desret_xmlChar_ptr(ret_val);
24262 des_const_xmlChar_ptr(n_path, (const xmlChar *)path, 0);
24263 xmlResetLastError();
24264 if (mem_base != xmlMemBlocks()) {
24265 printf("Leak of %d blocks found in xmlCanonicPath",
24266 xmlMemBlocks() - mem_base);
24268 printf(" %d", n_path);
24279 test_xmlCreateURI(void) {
24283 /* missing type support */
24289 test_xmlNormalizeURIPath(void) {
24294 char * path; /* pointer to the path string */
24297 for (n_path = 0;n_path < gen_nb_char_ptr;n_path++) {
24298 mem_base = xmlMemBlocks();
24299 path = gen_char_ptr(n_path, 0);
24301 ret_val = xmlNormalizeURIPath(path);
24302 desret_int(ret_val);
24304 des_char_ptr(n_path, path, 0);
24305 xmlResetLastError();
24306 if (mem_base != xmlMemBlocks()) {
24307 printf("Leak of %d blocks found in xmlNormalizeURIPath",
24308 xmlMemBlocks() - mem_base);
24310 printf(" %d", n_path);
24321 test_xmlParseURI(void) {
24325 /* missing type support */
24331 test_xmlParseURIRaw(void) {
24335 /* missing type support */
24340 #define gen_nb_xmlURIPtr 1
24341 static xmlURIPtr gen_xmlURIPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24344 static void des_xmlURIPtr(int no ATTRIBUTE_UNUSED, xmlURIPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24348 test_xmlParseURIReference(void) {
24353 xmlURIPtr uri; /* pointer to an URI structure */
24355 char * str; /* the string to analyze */
24358 for (n_uri = 0;n_uri < gen_nb_xmlURIPtr;n_uri++) {
24359 for (n_str = 0;n_str < gen_nb_const_char_ptr;n_str++) {
24360 mem_base = xmlMemBlocks();
24361 uri = gen_xmlURIPtr(n_uri, 0);
24362 str = gen_const_char_ptr(n_str, 1);
24364 ret_val = xmlParseURIReference(uri, (const char *)str);
24365 desret_int(ret_val);
24367 des_xmlURIPtr(n_uri, uri, 0);
24368 des_const_char_ptr(n_str, (const char *)str, 1);
24369 xmlResetLastError();
24370 if (mem_base != xmlMemBlocks()) {
24371 printf("Leak of %d blocks found in xmlParseURIReference",
24372 xmlMemBlocks() - mem_base);
24374 printf(" %d", n_uri);
24375 printf(" %d", n_str);
24387 test_xmlPathToURI(void) {
24392 xmlChar * path; /* the resource locator in a filesystem notation */
24395 for (n_path = 0;n_path < gen_nb_const_xmlChar_ptr;n_path++) {
24396 mem_base = xmlMemBlocks();
24397 path = gen_const_xmlChar_ptr(n_path, 0);
24399 ret_val = xmlPathToURI((const xmlChar *)path);
24400 desret_xmlChar_ptr(ret_val);
24402 des_const_xmlChar_ptr(n_path, (const xmlChar *)path, 0);
24403 xmlResetLastError();
24404 if (mem_base != xmlMemBlocks()) {
24405 printf("Leak of %d blocks found in xmlPathToURI",
24406 xmlMemBlocks() - mem_base);
24408 printf(" %d", n_path);
24419 test_xmlPrintURI(void) {
24423 FILE * stream; /* a FILE* for the output */
24425 xmlURIPtr uri; /* pointer to an xmlURI */
24428 for (n_stream = 0;n_stream < gen_nb_FILE_ptr;n_stream++) {
24429 for (n_uri = 0;n_uri < gen_nb_xmlURIPtr;n_uri++) {
24430 mem_base = xmlMemBlocks();
24431 stream = gen_FILE_ptr(n_stream, 0);
24432 uri = gen_xmlURIPtr(n_uri, 1);
24434 xmlPrintURI(stream, uri);
24436 des_FILE_ptr(n_stream, stream, 0);
24437 des_xmlURIPtr(n_uri, uri, 1);
24438 xmlResetLastError();
24439 if (mem_base != xmlMemBlocks()) {
24440 printf("Leak of %d blocks found in xmlPrintURI",
24441 xmlMemBlocks() - mem_base);
24443 printf(" %d", n_stream);
24444 printf(" %d", n_uri);
24456 test_xmlSaveUri(void) {
24461 xmlURIPtr uri; /* pointer to an xmlURI */
24464 for (n_uri = 0;n_uri < gen_nb_xmlURIPtr;n_uri++) {
24465 mem_base = xmlMemBlocks();
24466 uri = gen_xmlURIPtr(n_uri, 0);
24468 ret_val = xmlSaveUri(uri);
24469 desret_xmlChar_ptr(ret_val);
24471 des_xmlURIPtr(n_uri, uri, 0);
24472 xmlResetLastError();
24473 if (mem_base != xmlMemBlocks()) {
24474 printf("Leak of %d blocks found in xmlSaveUri",
24475 xmlMemBlocks() - mem_base);
24477 printf(" %d", n_uri);
24488 test_xmlURIEscape(void) {
24493 xmlChar * str; /* the string of the URI to escape */
24496 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
24497 mem_base = xmlMemBlocks();
24498 str = gen_const_xmlChar_ptr(n_str, 0);
24500 ret_val = xmlURIEscape((const xmlChar *)str);
24501 desret_xmlChar_ptr(ret_val);
24503 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
24504 xmlResetLastError();
24505 if (mem_base != xmlMemBlocks()) {
24506 printf("Leak of %d blocks found in xmlURIEscape",
24507 xmlMemBlocks() - mem_base);
24509 printf(" %d", n_str);
24520 test_xmlURIEscapeStr(void) {
24525 xmlChar * str; /* string to escape */
24527 xmlChar * list; /* exception list string of chars not to escape */
24530 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
24531 for (n_list = 0;n_list < gen_nb_const_xmlChar_ptr;n_list++) {
24532 mem_base = xmlMemBlocks();
24533 str = gen_const_xmlChar_ptr(n_str, 0);
24534 list = gen_const_xmlChar_ptr(n_list, 1);
24536 ret_val = xmlURIEscapeStr((const xmlChar *)str, (const xmlChar *)list);
24537 desret_xmlChar_ptr(ret_val);
24539 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
24540 des_const_xmlChar_ptr(n_list, (const xmlChar *)list, 1);
24541 xmlResetLastError();
24542 if (mem_base != xmlMemBlocks()) {
24543 printf("Leak of %d blocks found in xmlURIEscapeStr",
24544 xmlMemBlocks() - mem_base);
24546 printf(" %d", n_str);
24547 printf(" %d", n_list);
24559 test_xmlURIUnescapeString(void) {
24563 /* missing type support */
24571 if (quiet == 0) printf("Testing uri : 10 of 15 functions ...\n");
24572 test_ret += test_xmlBuildRelativeURI();
24573 test_ret += test_xmlBuildURI();
24574 test_ret += test_xmlCanonicPath();
24575 test_ret += test_xmlCreateURI();
24576 test_ret += test_xmlNormalizeURIPath();
24577 test_ret += test_xmlParseURI();
24578 test_ret += test_xmlParseURIRaw();
24579 test_ret += test_xmlParseURIReference();
24580 test_ret += test_xmlPathToURI();
24581 test_ret += test_xmlPrintURI();
24582 test_ret += test_xmlSaveUri();
24583 test_ret += test_xmlURIEscape();
24584 test_ret += test_xmlURIEscapeStr();
24585 test_ret += test_xmlURIUnescapeString();
24588 printf("Module uri: %d errors\n", test_ret);
24593 test_xmlAddAttributeDecl(void) {
24597 xmlAttributePtr ret_val;
24598 xmlValidCtxtPtr ctxt; /* the validation context */
24600 xmlDtdPtr dtd; /* pointer to the DTD */
24602 xmlChar * elem; /* the element name */
24604 xmlChar * name; /* the attribute name */
24606 xmlChar * ns; /* the attribute namespace prefix */
24608 xmlAttributeType type; /* the attribute type */
24610 xmlAttributeDefault def; /* the attribute default type */
24612 xmlChar * defaultValue; /* the attribute default value */
24613 int n_defaultValue;
24614 xmlEnumerationPtr tree; /* if it's an enumeration, the associated list */
24617 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
24618 for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
24619 for (n_elem = 0;n_elem < gen_nb_const_xmlChar_ptr;n_elem++) {
24620 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
24621 for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
24622 for (n_type = 0;n_type < gen_nb_xmlAttributeType;n_type++) {
24623 for (n_def = 0;n_def < gen_nb_xmlAttributeDefault;n_def++) {
24624 for (n_defaultValue = 0;n_defaultValue < gen_nb_const_xmlChar_ptr;n_defaultValue++) {
24625 for (n_tree = 0;n_tree < gen_nb_xmlEnumerationPtr;n_tree++) {
24626 mem_base = xmlMemBlocks();
24627 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
24628 dtd = gen_xmlDtdPtr(n_dtd, 1);
24629 elem = gen_const_xmlChar_ptr(n_elem, 2);
24630 name = gen_const_xmlChar_ptr(n_name, 3);
24631 ns = gen_const_xmlChar_ptr(n_ns, 4);
24632 type = gen_xmlAttributeType(n_type, 5);
24633 def = gen_xmlAttributeDefault(n_def, 6);
24634 defaultValue = gen_const_xmlChar_ptr(n_defaultValue, 7);
24635 tree = gen_xmlEnumerationPtr(n_tree, 8);
24637 ret_val = xmlAddAttributeDecl(ctxt, dtd, (const xmlChar *)elem, (const xmlChar *)name, (const xmlChar *)ns, type, def, (const xmlChar *)defaultValue, tree);
24638 desret_xmlAttributePtr(ret_val);
24640 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
24641 des_xmlDtdPtr(n_dtd, dtd, 1);
24642 des_const_xmlChar_ptr(n_elem, (const xmlChar *)elem, 2);
24643 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 3);
24644 des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 4);
24645 des_xmlAttributeType(n_type, type, 5);
24646 des_xmlAttributeDefault(n_def, def, 6);
24647 des_const_xmlChar_ptr(n_defaultValue, (const xmlChar *)defaultValue, 7);
24648 des_xmlEnumerationPtr(n_tree, tree, 8);
24649 xmlResetLastError();
24650 if (mem_base != xmlMemBlocks()) {
24651 printf("Leak of %d blocks found in xmlAddAttributeDecl",
24652 xmlMemBlocks() - mem_base);
24654 printf(" %d", n_ctxt);
24655 printf(" %d", n_dtd);
24656 printf(" %d", n_elem);
24657 printf(" %d", n_name);
24658 printf(" %d", n_ns);
24659 printf(" %d", n_type);
24660 printf(" %d", n_def);
24661 printf(" %d", n_defaultValue);
24662 printf(" %d", n_tree);
24681 test_xmlAddElementDecl(void) {
24685 xmlElementPtr ret_val;
24686 xmlValidCtxtPtr ctxt; /* the validation context */
24688 xmlDtdPtr dtd; /* pointer to the DTD */
24690 xmlChar * name; /* the entity name */
24692 xmlElementTypeVal type; /* the element type */
24694 xmlElementContentPtr content; /* the element content tree or NULL */
24697 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
24698 for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
24699 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
24700 for (n_type = 0;n_type < gen_nb_xmlElementTypeVal;n_type++) {
24701 for (n_content = 0;n_content < gen_nb_xmlElementContentPtr;n_content++) {
24702 mem_base = xmlMemBlocks();
24703 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
24704 dtd = gen_xmlDtdPtr(n_dtd, 1);
24705 name = gen_const_xmlChar_ptr(n_name, 2);
24706 type = gen_xmlElementTypeVal(n_type, 3);
24707 content = gen_xmlElementContentPtr(n_content, 4);
24709 ret_val = xmlAddElementDecl(ctxt, dtd, (const xmlChar *)name, type, content);
24710 desret_xmlElementPtr(ret_val);
24712 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
24713 des_xmlDtdPtr(n_dtd, dtd, 1);
24714 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
24715 des_xmlElementTypeVal(n_type, type, 3);
24716 des_xmlElementContentPtr(n_content, content, 4);
24717 xmlResetLastError();
24718 if (mem_base != xmlMemBlocks()) {
24719 printf("Leak of %d blocks found in xmlAddElementDecl",
24720 xmlMemBlocks() - mem_base);
24722 printf(" %d", n_ctxt);
24723 printf(" %d", n_dtd);
24724 printf(" %d", n_name);
24725 printf(" %d", n_type);
24726 printf(" %d", n_content);
24741 test_xmlAddID(void) {
24745 /* missing type support */
24751 test_xmlAddNotationDecl(void) {
24755 /* missing type support */
24761 test_xmlAddRef(void) {
24765 /* missing type support */
24770 #define gen_nb_xmlAttributeTablePtr 1
24771 static xmlAttributeTablePtr gen_xmlAttributeTablePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24774 static void des_xmlAttributeTablePtr(int no ATTRIBUTE_UNUSED, xmlAttributeTablePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24778 test_xmlCopyAttributeTable(void) {
24782 /* missing type support */
24788 test_xmlCopyDocElementContent(void) {
24792 xmlElementContentPtr ret_val;
24793 xmlDocPtr doc; /* the document owning the element declaration */
24795 xmlElementContentPtr cur; /* An element content pointer. */
24798 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
24799 for (n_cur = 0;n_cur < gen_nb_xmlElementContentPtr;n_cur++) {
24800 mem_base = xmlMemBlocks();
24801 doc = gen_xmlDocPtr(n_doc, 0);
24802 cur = gen_xmlElementContentPtr(n_cur, 1);
24804 ret_val = xmlCopyDocElementContent(doc, cur);
24805 desret_xmlElementContentPtr(ret_val);
24807 des_xmlDocPtr(n_doc, doc, 0);
24808 des_xmlElementContentPtr(n_cur, cur, 1);
24809 xmlResetLastError();
24810 if (mem_base != xmlMemBlocks()) {
24811 printf("Leak of %d blocks found in xmlCopyDocElementContent",
24812 xmlMemBlocks() - mem_base);
24814 printf(" %d", n_doc);
24815 printf(" %d", n_cur);
24827 test_xmlCopyElementContent(void) {
24831 xmlElementContentPtr ret_val;
24832 xmlElementContentPtr cur; /* An element content pointer. */
24835 for (n_cur = 0;n_cur < gen_nb_xmlElementContentPtr;n_cur++) {
24836 mem_base = xmlMemBlocks();
24837 cur = gen_xmlElementContentPtr(n_cur, 0);
24839 ret_val = xmlCopyElementContent(cur);
24840 desret_xmlElementContentPtr(ret_val);
24842 des_xmlElementContentPtr(n_cur, cur, 0);
24843 xmlResetLastError();
24844 if (mem_base != xmlMemBlocks()) {
24845 printf("Leak of %d blocks found in xmlCopyElementContent",
24846 xmlMemBlocks() - mem_base);
24848 printf(" %d", n_cur);
24858 #define gen_nb_xmlElementTablePtr 1
24859 static xmlElementTablePtr gen_xmlElementTablePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24862 static void des_xmlElementTablePtr(int no ATTRIBUTE_UNUSED, xmlElementTablePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24866 test_xmlCopyElementTable(void) {
24870 /* missing type support */
24876 test_xmlCopyEnumeration(void) {
24880 /* missing type support */
24885 #define gen_nb_xmlNotationTablePtr 1
24886 static xmlNotationTablePtr gen_xmlNotationTablePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24889 static void des_xmlNotationTablePtr(int no ATTRIBUTE_UNUSED, xmlNotationTablePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24893 test_xmlCopyNotationTable(void) {
24897 /* missing type support */
24903 test_xmlCreateEnumeration(void) {
24907 /* missing type support */
24912 #define gen_nb_xmlAttributePtr 1
24913 static xmlAttributePtr gen_xmlAttributePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24916 static void des_xmlAttributePtr(int no ATTRIBUTE_UNUSED, xmlAttributePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24920 test_xmlDumpAttributeDecl(void) {
24923 #if defined(LIBXML_OUTPUT_ENABLED)
24925 xmlBufferPtr buf; /* the XML buffer output */
24927 xmlAttributePtr attr; /* An attribute declaration */
24930 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
24931 for (n_attr = 0;n_attr < gen_nb_xmlAttributePtr;n_attr++) {
24932 mem_base = xmlMemBlocks();
24933 buf = gen_xmlBufferPtr(n_buf, 0);
24934 attr = gen_xmlAttributePtr(n_attr, 1);
24936 xmlDumpAttributeDecl(buf, attr);
24938 des_xmlBufferPtr(n_buf, buf, 0);
24939 des_xmlAttributePtr(n_attr, attr, 1);
24940 xmlResetLastError();
24941 if (mem_base != xmlMemBlocks()) {
24942 printf("Leak of %d blocks found in xmlDumpAttributeDecl",
24943 xmlMemBlocks() - mem_base);
24945 printf(" %d", n_buf);
24946 printf(" %d", n_attr);
24959 test_xmlDumpAttributeTable(void) {
24962 #if defined(LIBXML_OUTPUT_ENABLED)
24964 xmlBufferPtr buf; /* the XML buffer output */
24966 xmlAttributeTablePtr table; /* An attribute table */
24969 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
24970 for (n_table = 0;n_table < gen_nb_xmlAttributeTablePtr;n_table++) {
24971 mem_base = xmlMemBlocks();
24972 buf = gen_xmlBufferPtr(n_buf, 0);
24973 table = gen_xmlAttributeTablePtr(n_table, 1);
24975 xmlDumpAttributeTable(buf, table);
24977 des_xmlBufferPtr(n_buf, buf, 0);
24978 des_xmlAttributeTablePtr(n_table, table, 1);
24979 xmlResetLastError();
24980 if (mem_base != xmlMemBlocks()) {
24981 printf("Leak of %d blocks found in xmlDumpAttributeTable",
24982 xmlMemBlocks() - mem_base);
24984 printf(" %d", n_buf);
24985 printf(" %d", n_table);
24997 #define gen_nb_xmlElementPtr 1
24998 static xmlElementPtr gen_xmlElementPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25001 static void des_xmlElementPtr(int no ATTRIBUTE_UNUSED, xmlElementPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25005 test_xmlDumpElementDecl(void) {
25008 #if defined(LIBXML_OUTPUT_ENABLED)
25010 xmlBufferPtr buf; /* the XML buffer output */
25012 xmlElementPtr elem; /* An element table */
25015 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
25016 for (n_elem = 0;n_elem < gen_nb_xmlElementPtr;n_elem++) {
25017 mem_base = xmlMemBlocks();
25018 buf = gen_xmlBufferPtr(n_buf, 0);
25019 elem = gen_xmlElementPtr(n_elem, 1);
25021 xmlDumpElementDecl(buf, elem);
25023 des_xmlBufferPtr(n_buf, buf, 0);
25024 des_xmlElementPtr(n_elem, elem, 1);
25025 xmlResetLastError();
25026 if (mem_base != xmlMemBlocks()) {
25027 printf("Leak of %d blocks found in xmlDumpElementDecl",
25028 xmlMemBlocks() - mem_base);
25030 printf(" %d", n_buf);
25031 printf(" %d", n_elem);
25044 test_xmlDumpElementTable(void) {
25047 #if defined(LIBXML_OUTPUT_ENABLED)
25049 xmlBufferPtr buf; /* the XML buffer output */
25051 xmlElementTablePtr table; /* An element table */
25054 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
25055 for (n_table = 0;n_table < gen_nb_xmlElementTablePtr;n_table++) {
25056 mem_base = xmlMemBlocks();
25057 buf = gen_xmlBufferPtr(n_buf, 0);
25058 table = gen_xmlElementTablePtr(n_table, 1);
25060 xmlDumpElementTable(buf, table);
25062 des_xmlBufferPtr(n_buf, buf, 0);
25063 des_xmlElementTablePtr(n_table, table, 1);
25064 xmlResetLastError();
25065 if (mem_base != xmlMemBlocks()) {
25066 printf("Leak of %d blocks found in xmlDumpElementTable",
25067 xmlMemBlocks() - mem_base);
25069 printf(" %d", n_buf);
25070 printf(" %d", n_table);
25082 #define gen_nb_xmlNotationPtr 1
25083 static xmlNotationPtr gen_xmlNotationPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25086 static void des_xmlNotationPtr(int no ATTRIBUTE_UNUSED, xmlNotationPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25090 test_xmlDumpNotationDecl(void) {
25093 #if defined(LIBXML_OUTPUT_ENABLED)
25095 xmlBufferPtr buf; /* the XML buffer output */
25097 xmlNotationPtr nota; /* A notation declaration */
25100 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
25101 for (n_nota = 0;n_nota < gen_nb_xmlNotationPtr;n_nota++) {
25102 mem_base = xmlMemBlocks();
25103 buf = gen_xmlBufferPtr(n_buf, 0);
25104 nota = gen_xmlNotationPtr(n_nota, 1);
25106 xmlDumpNotationDecl(buf, nota);
25108 des_xmlBufferPtr(n_buf, buf, 0);
25109 des_xmlNotationPtr(n_nota, nota, 1);
25110 xmlResetLastError();
25111 if (mem_base != xmlMemBlocks()) {
25112 printf("Leak of %d blocks found in xmlDumpNotationDecl",
25113 xmlMemBlocks() - mem_base);
25115 printf(" %d", n_buf);
25116 printf(" %d", n_nota);
25129 test_xmlDumpNotationTable(void) {
25132 #if defined(LIBXML_OUTPUT_ENABLED)
25134 xmlBufferPtr buf; /* the XML buffer output */
25136 xmlNotationTablePtr table; /* A notation table */
25139 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
25140 for (n_table = 0;n_table < gen_nb_xmlNotationTablePtr;n_table++) {
25141 mem_base = xmlMemBlocks();
25142 buf = gen_xmlBufferPtr(n_buf, 0);
25143 table = gen_xmlNotationTablePtr(n_table, 1);
25145 xmlDumpNotationTable(buf, table);
25147 des_xmlBufferPtr(n_buf, buf, 0);
25148 des_xmlNotationTablePtr(n_table, table, 1);
25149 xmlResetLastError();
25150 if (mem_base != xmlMemBlocks()) {
25151 printf("Leak of %d blocks found in xmlDumpNotationTable",
25152 xmlMemBlocks() - mem_base);
25154 printf(" %d", n_buf);
25155 printf(" %d", n_table);
25168 test_xmlGetDtdAttrDesc(void) {
25172 xmlAttributePtr ret_val;
25173 xmlDtdPtr dtd; /* a pointer to the DtD to search */
25175 xmlChar * elem; /* the element name */
25177 xmlChar * name; /* the attribute name */
25180 for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
25181 for (n_elem = 0;n_elem < gen_nb_const_xmlChar_ptr;n_elem++) {
25182 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25183 mem_base = xmlMemBlocks();
25184 dtd = gen_xmlDtdPtr(n_dtd, 0);
25185 elem = gen_const_xmlChar_ptr(n_elem, 1);
25186 name = gen_const_xmlChar_ptr(n_name, 2);
25188 ret_val = xmlGetDtdAttrDesc(dtd, (const xmlChar *)elem, (const xmlChar *)name);
25189 desret_xmlAttributePtr(ret_val);
25191 des_xmlDtdPtr(n_dtd, dtd, 0);
25192 des_const_xmlChar_ptr(n_elem, (const xmlChar *)elem, 1);
25193 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
25194 xmlResetLastError();
25195 if (mem_base != xmlMemBlocks()) {
25196 printf("Leak of %d blocks found in xmlGetDtdAttrDesc",
25197 xmlMemBlocks() - mem_base);
25199 printf(" %d", n_dtd);
25200 printf(" %d", n_elem);
25201 printf(" %d", n_name);
25214 test_xmlGetDtdElementDesc(void) {
25218 xmlElementPtr ret_val;
25219 xmlDtdPtr dtd; /* a pointer to the DtD to search */
25221 xmlChar * name; /* the element name */
25224 for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
25225 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25226 mem_base = xmlMemBlocks();
25227 dtd = gen_xmlDtdPtr(n_dtd, 0);
25228 name = gen_const_xmlChar_ptr(n_name, 1);
25230 ret_val = xmlGetDtdElementDesc(dtd, (const xmlChar *)name);
25231 desret_xmlElementPtr(ret_val);
25233 des_xmlDtdPtr(n_dtd, dtd, 0);
25234 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
25235 xmlResetLastError();
25236 if (mem_base != xmlMemBlocks()) {
25237 printf("Leak of %d blocks found in xmlGetDtdElementDesc",
25238 xmlMemBlocks() - mem_base);
25240 printf(" %d", n_dtd);
25241 printf(" %d", n_name);
25253 test_xmlGetDtdNotationDesc(void) {
25257 /* missing type support */
25263 test_xmlGetDtdQAttrDesc(void) {
25267 xmlAttributePtr ret_val;
25268 xmlDtdPtr dtd; /* a pointer to the DtD to search */
25270 xmlChar * elem; /* the element name */
25272 xmlChar * name; /* the attribute name */
25274 xmlChar * prefix; /* the attribute namespace prefix */
25277 for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
25278 for (n_elem = 0;n_elem < gen_nb_const_xmlChar_ptr;n_elem++) {
25279 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25280 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
25281 mem_base = xmlMemBlocks();
25282 dtd = gen_xmlDtdPtr(n_dtd, 0);
25283 elem = gen_const_xmlChar_ptr(n_elem, 1);
25284 name = gen_const_xmlChar_ptr(n_name, 2);
25285 prefix = gen_const_xmlChar_ptr(n_prefix, 3);
25287 ret_val = xmlGetDtdQAttrDesc(dtd, (const xmlChar *)elem, (const xmlChar *)name, (const xmlChar *)prefix);
25288 desret_xmlAttributePtr(ret_val);
25290 des_xmlDtdPtr(n_dtd, dtd, 0);
25291 des_const_xmlChar_ptr(n_elem, (const xmlChar *)elem, 1);
25292 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
25293 des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 3);
25294 xmlResetLastError();
25295 if (mem_base != xmlMemBlocks()) {
25296 printf("Leak of %d blocks found in xmlGetDtdQAttrDesc",
25297 xmlMemBlocks() - mem_base);
25299 printf(" %d", n_dtd);
25300 printf(" %d", n_elem);
25301 printf(" %d", n_name);
25302 printf(" %d", n_prefix);
25316 test_xmlGetDtdQElementDesc(void) {
25320 xmlElementPtr ret_val;
25321 xmlDtdPtr dtd; /* a pointer to the DtD to search */
25323 xmlChar * name; /* the element name */
25325 xmlChar * prefix; /* the element namespace prefix */
25328 for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
25329 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25330 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
25331 mem_base = xmlMemBlocks();
25332 dtd = gen_xmlDtdPtr(n_dtd, 0);
25333 name = gen_const_xmlChar_ptr(n_name, 1);
25334 prefix = gen_const_xmlChar_ptr(n_prefix, 2);
25336 ret_val = xmlGetDtdQElementDesc(dtd, (const xmlChar *)name, (const xmlChar *)prefix);
25337 desret_xmlElementPtr(ret_val);
25339 des_xmlDtdPtr(n_dtd, dtd, 0);
25340 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
25341 des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 2);
25342 xmlResetLastError();
25343 if (mem_base != xmlMemBlocks()) {
25344 printf("Leak of %d blocks found in xmlGetDtdQElementDesc",
25345 xmlMemBlocks() - mem_base);
25347 printf(" %d", n_dtd);
25348 printf(" %d", n_name);
25349 printf(" %d", n_prefix);
25362 test_xmlGetID(void) {
25366 xmlAttrPtr ret_val;
25367 xmlDocPtr doc; /* pointer to the document */
25369 xmlChar * ID; /* the ID value */
25372 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25373 for (n_ID = 0;n_ID < gen_nb_const_xmlChar_ptr;n_ID++) {
25374 mem_base = xmlMemBlocks();
25375 doc = gen_xmlDocPtr(n_doc, 0);
25376 ID = gen_const_xmlChar_ptr(n_ID, 1);
25378 ret_val = xmlGetID(doc, (const xmlChar *)ID);
25379 desret_xmlAttrPtr(ret_val);
25381 des_xmlDocPtr(n_doc, doc, 0);
25382 des_const_xmlChar_ptr(n_ID, (const xmlChar *)ID, 1);
25383 xmlResetLastError();
25384 if (mem_base != xmlMemBlocks()) {
25385 printf("Leak of %d blocks found in xmlGetID",
25386 xmlMemBlocks() - mem_base);
25388 printf(" %d", n_doc);
25389 printf(" %d", n_ID);
25401 test_xmlGetRefs(void) {
25405 /* missing type support */
25411 test_xmlIsID(void) {
25416 xmlDocPtr doc; /* the document */
25418 xmlNodePtr elem; /* the element carrying the attribute */
25420 xmlAttrPtr attr; /* the attribute */
25423 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25424 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
25425 for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
25426 mem_base = xmlMemBlocks();
25427 doc = gen_xmlDocPtr(n_doc, 0);
25428 elem = gen_xmlNodePtr(n_elem, 1);
25429 attr = gen_xmlAttrPtr(n_attr, 2);
25431 ret_val = xmlIsID(doc, elem, attr);
25432 desret_int(ret_val);
25434 des_xmlDocPtr(n_doc, doc, 0);
25435 des_xmlNodePtr(n_elem, elem, 1);
25436 des_xmlAttrPtr(n_attr, attr, 2);
25437 xmlResetLastError();
25438 if (mem_base != xmlMemBlocks()) {
25439 printf("Leak of %d blocks found in xmlIsID",
25440 xmlMemBlocks() - mem_base);
25442 printf(" %d", n_doc);
25443 printf(" %d", n_elem);
25444 printf(" %d", n_attr);
25457 test_xmlIsMixedElement(void) {
25462 xmlDocPtr doc; /* the document */
25464 xmlChar * name; /* the element name */
25467 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25468 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25469 mem_base = xmlMemBlocks();
25470 doc = gen_xmlDocPtr(n_doc, 0);
25471 name = gen_const_xmlChar_ptr(n_name, 1);
25473 ret_val = xmlIsMixedElement(doc, (const xmlChar *)name);
25474 desret_int(ret_val);
25476 des_xmlDocPtr(n_doc, doc, 0);
25477 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
25478 xmlResetLastError();
25479 if (mem_base != xmlMemBlocks()) {
25480 printf("Leak of %d blocks found in xmlIsMixedElement",
25481 xmlMemBlocks() - mem_base);
25483 printf(" %d", n_doc);
25484 printf(" %d", n_name);
25496 test_xmlIsRef(void) {
25501 xmlDocPtr doc; /* the document */
25503 xmlNodePtr elem; /* the element carrying the attribute */
25505 xmlAttrPtr attr; /* the attribute */
25508 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25509 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
25510 for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
25511 mem_base = xmlMemBlocks();
25512 doc = gen_xmlDocPtr(n_doc, 0);
25513 elem = gen_xmlNodePtr(n_elem, 1);
25514 attr = gen_xmlAttrPtr(n_attr, 2);
25516 ret_val = xmlIsRef(doc, elem, attr);
25517 desret_int(ret_val);
25519 des_xmlDocPtr(n_doc, doc, 0);
25520 des_xmlNodePtr(n_elem, elem, 1);
25521 des_xmlAttrPtr(n_attr, attr, 2);
25522 xmlResetLastError();
25523 if (mem_base != xmlMemBlocks()) {
25524 printf("Leak of %d blocks found in xmlIsRef",
25525 xmlMemBlocks() - mem_base);
25527 printf(" %d", n_doc);
25528 printf(" %d", n_elem);
25529 printf(" %d", n_attr);
25542 test_xmlNewDocElementContent(void) {
25546 xmlElementContentPtr ret_val;
25547 xmlDocPtr doc; /* the document */
25549 xmlChar * name; /* the subelement name or NULL */
25551 xmlElementContentType type; /* the type of element content decl */
25554 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25555 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25556 for (n_type = 0;n_type < gen_nb_xmlElementContentType;n_type++) {
25557 mem_base = xmlMemBlocks();
25558 doc = gen_xmlDocPtr(n_doc, 0);
25559 name = gen_const_xmlChar_ptr(n_name, 1);
25560 type = gen_xmlElementContentType(n_type, 2);
25562 ret_val = xmlNewDocElementContent(doc, (const xmlChar *)name, type);
25563 xmlFreeDocElementContent(doc, ret_val); ret_val = NULL;
25564 desret_xmlElementContentPtr(ret_val);
25566 des_xmlDocPtr(n_doc, doc, 0);
25567 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
25568 des_xmlElementContentType(n_type, type, 2);
25569 xmlResetLastError();
25570 if (mem_base != xmlMemBlocks()) {
25571 printf("Leak of %d blocks found in xmlNewDocElementContent",
25572 xmlMemBlocks() - mem_base);
25574 printf(" %d", n_doc);
25575 printf(" %d", n_name);
25576 printf(" %d", n_type);
25589 test_xmlNewElementContent(void) {
25593 xmlElementContentPtr ret_val;
25594 xmlChar * name; /* the subelement name or NULL */
25596 xmlElementContentType type; /* the type of element content decl */
25599 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25600 for (n_type = 0;n_type < gen_nb_xmlElementContentType;n_type++) {
25601 mem_base = xmlMemBlocks();
25602 name = gen_const_xmlChar_ptr(n_name, 0);
25603 type = gen_xmlElementContentType(n_type, 1);
25605 ret_val = xmlNewElementContent((const xmlChar *)name, type);
25606 desret_xmlElementContentPtr(ret_val);
25608 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
25609 des_xmlElementContentType(n_type, type, 1);
25610 xmlResetLastError();
25611 if (mem_base != xmlMemBlocks()) {
25612 printf("Leak of %d blocks found in xmlNewElementContent",
25613 xmlMemBlocks() - mem_base);
25615 printf(" %d", n_name);
25616 printf(" %d", n_type);
25628 test_xmlNewValidCtxt(void) {
25632 /* missing type support */
25638 test_xmlRemoveID(void) {
25643 xmlDocPtr doc; /* the document */
25645 xmlAttrPtr attr; /* the attribute */
25648 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25649 for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
25650 mem_base = xmlMemBlocks();
25651 doc = gen_xmlDocPtr(n_doc, 0);
25652 attr = gen_xmlAttrPtr(n_attr, 1);
25654 ret_val = xmlRemoveID(doc, attr);
25655 desret_int(ret_val);
25657 des_xmlDocPtr(n_doc, doc, 0);
25658 des_xmlAttrPtr(n_attr, attr, 1);
25659 xmlResetLastError();
25660 if (mem_base != xmlMemBlocks()) {
25661 printf("Leak of %d blocks found in xmlRemoveID",
25662 xmlMemBlocks() - mem_base);
25664 printf(" %d", n_doc);
25665 printf(" %d", n_attr);
25677 test_xmlRemoveRef(void) {
25682 xmlDocPtr doc; /* the document */
25684 xmlAttrPtr attr; /* the attribute */
25687 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25688 for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
25689 mem_base = xmlMemBlocks();
25690 doc = gen_xmlDocPtr(n_doc, 0);
25691 attr = gen_xmlAttrPtr(n_attr, 1);
25693 ret_val = xmlRemoveRef(doc, attr);
25694 desret_int(ret_val);
25696 des_xmlDocPtr(n_doc, doc, 0);
25697 des_xmlAttrPtr(n_attr, attr, 1);
25698 xmlResetLastError();
25699 if (mem_base != xmlMemBlocks()) {
25700 printf("Leak of %d blocks found in xmlRemoveRef",
25701 xmlMemBlocks() - mem_base);
25703 printf(" %d", n_doc);
25704 printf(" %d", n_attr);
25716 test_xmlSnprintfElementContent(void) {
25720 char * buf; /* an output buffer */
25722 int size; /* the buffer size */
25724 xmlElementContentPtr content; /* An element table */
25726 int englob; /* 1 if one must print the englobing parenthesis, 0 otherwise */
25729 for (n_buf = 0;n_buf < gen_nb_char_ptr;n_buf++) {
25730 for (n_size = 0;n_size < gen_nb_int;n_size++) {
25731 for (n_content = 0;n_content < gen_nb_xmlElementContentPtr;n_content++) {
25732 for (n_englob = 0;n_englob < gen_nb_int;n_englob++) {
25733 mem_base = xmlMemBlocks();
25734 buf = gen_char_ptr(n_buf, 0);
25735 size = gen_int(n_size, 1);
25736 content = gen_xmlElementContentPtr(n_content, 2);
25737 englob = gen_int(n_englob, 3);
25739 xmlSnprintfElementContent(buf, size, content, englob);
25741 des_char_ptr(n_buf, buf, 0);
25742 des_int(n_size, size, 1);
25743 des_xmlElementContentPtr(n_content, content, 2);
25744 des_int(n_englob, englob, 3);
25745 xmlResetLastError();
25746 if (mem_base != xmlMemBlocks()) {
25747 printf("Leak of %d blocks found in xmlSnprintfElementContent",
25748 xmlMemBlocks() - mem_base);
25750 printf(" %d", n_buf);
25751 printf(" %d", n_size);
25752 printf(" %d", n_content);
25753 printf(" %d", n_englob);
25767 test_xmlSprintfElementContent(void) {
25770 #if defined(LIBXML_OUTPUT_ENABLED)
25771 #ifdef LIBXML_OUTPUT_ENABLED
25773 char * buf; /* an output buffer */
25775 xmlElementContentPtr content; /* An element table */
25777 int englob; /* 1 if one must print the englobing parenthesis, 0 otherwise */
25780 for (n_buf = 0;n_buf < gen_nb_char_ptr;n_buf++) {
25781 for (n_content = 0;n_content < gen_nb_xmlElementContentPtr;n_content++) {
25782 for (n_englob = 0;n_englob < gen_nb_int;n_englob++) {
25783 mem_base = xmlMemBlocks();
25784 buf = gen_char_ptr(n_buf, 0);
25785 content = gen_xmlElementContentPtr(n_content, 1);
25786 englob = gen_int(n_englob, 2);
25788 xmlSprintfElementContent(buf, content, englob);
25790 des_char_ptr(n_buf, buf, 0);
25791 des_xmlElementContentPtr(n_content, content, 1);
25792 des_int(n_englob, englob, 2);
25793 xmlResetLastError();
25794 if (mem_base != xmlMemBlocks()) {
25795 printf("Leak of %d blocks found in xmlSprintfElementContent",
25796 xmlMemBlocks() - mem_base);
25798 printf(" %d", n_buf);
25799 printf(" %d", n_content);
25800 printf(" %d", n_englob);
25815 test_xmlValidBuildContentModel(void) {
25818 #if defined(LIBXML_VALID_ENABLED) && defined(LIBXML_REGEXP_ENABLED)
25821 xmlValidCtxtPtr ctxt; /* a validation context */
25823 xmlElementPtr elem; /* an element declaration node */
25826 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
25827 for (n_elem = 0;n_elem < gen_nb_xmlElementPtr;n_elem++) {
25828 mem_base = xmlMemBlocks();
25829 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
25830 elem = gen_xmlElementPtr(n_elem, 1);
25832 ret_val = xmlValidBuildContentModel(ctxt, elem);
25833 desret_int(ret_val);
25835 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
25836 des_xmlElementPtr(n_elem, elem, 1);
25837 xmlResetLastError();
25838 if (mem_base != xmlMemBlocks()) {
25839 printf("Leak of %d blocks found in xmlValidBuildContentModel",
25840 xmlMemBlocks() - mem_base);
25842 printf(" %d", n_ctxt);
25843 printf(" %d", n_elem);
25856 test_xmlValidCtxtNormalizeAttributeValue(void) {
25859 #if defined(LIBXML_VALID_ENABLED)
25862 xmlValidCtxtPtr ctxt; /* the validation context or NULL */
25864 xmlDocPtr doc; /* the document */
25866 xmlNodePtr elem; /* the parent */
25868 xmlChar * name; /* the attribute name */
25870 xmlChar * value; /* the attribute value */
25873 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
25874 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25875 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
25876 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25877 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
25878 mem_base = xmlMemBlocks();
25879 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
25880 doc = gen_xmlDocPtr(n_doc, 1);
25881 elem = gen_xmlNodePtr(n_elem, 2);
25882 name = gen_const_xmlChar_ptr(n_name, 3);
25883 value = gen_const_xmlChar_ptr(n_value, 4);
25885 ret_val = xmlValidCtxtNormalizeAttributeValue(ctxt, doc, elem, (const xmlChar *)name, (const xmlChar *)value);
25886 desret_xmlChar_ptr(ret_val);
25888 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
25889 des_xmlDocPtr(n_doc, doc, 1);
25890 des_xmlNodePtr(n_elem, elem, 2);
25891 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 3);
25892 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 4);
25893 xmlResetLastError();
25894 if (mem_base != xmlMemBlocks()) {
25895 printf("Leak of %d blocks found in xmlValidCtxtNormalizeAttributeValue",
25896 xmlMemBlocks() - mem_base);
25898 printf(" %d", n_ctxt);
25899 printf(" %d", n_doc);
25900 printf(" %d", n_elem);
25901 printf(" %d", n_name);
25902 printf(" %d", n_value);
25917 #define gen_nb_xmlElementContent_ptr 1
25918 static xmlElementContent * gen_xmlElementContent_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25921 static void des_xmlElementContent_ptr(int no ATTRIBUTE_UNUSED, xmlElementContent * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25925 test_xmlValidGetPotentialChildren(void) {
25928 #if defined(LIBXML_VALID_ENABLED)
25929 #ifdef LIBXML_VALID_ENABLED
25932 xmlElementContent * ctree; /* an element content tree */
25934 xmlChar ** names; /* an array to store the list of child names */
25936 int * len; /* a pointer to the number of element in the list */
25938 int max; /* the size of the array */
25941 for (n_ctree = 0;n_ctree < gen_nb_xmlElementContent_ptr;n_ctree++) {
25942 for (n_names = 0;n_names < gen_nb_const_xmlChar_ptr_ptr;n_names++) {
25943 for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
25944 for (n_max = 0;n_max < gen_nb_int;n_max++) {
25945 mem_base = xmlMemBlocks();
25946 ctree = gen_xmlElementContent_ptr(n_ctree, 0);
25947 names = gen_const_xmlChar_ptr_ptr(n_names, 1);
25948 len = gen_int_ptr(n_len, 2);
25949 max = gen_int(n_max, 3);
25951 ret_val = xmlValidGetPotentialChildren(ctree, (const xmlChar **)names, len, max);
25952 desret_int(ret_val);
25954 des_xmlElementContent_ptr(n_ctree, ctree, 0);
25955 des_const_xmlChar_ptr_ptr(n_names, (const xmlChar **)names, 1);
25956 des_int_ptr(n_len, len, 2);
25957 des_int(n_max, max, 3);
25958 xmlResetLastError();
25959 if (mem_base != xmlMemBlocks()) {
25960 printf("Leak of %d blocks found in xmlValidGetPotentialChildren",
25961 xmlMemBlocks() - mem_base);
25963 printf(" %d", n_ctree);
25964 printf(" %d", n_names);
25965 printf(" %d", n_len);
25966 printf(" %d", n_max);
25982 test_xmlValidGetValidElements(void) {
25985 #if defined(LIBXML_VALID_ENABLED)
25986 #ifdef LIBXML_VALID_ENABLED
25989 xmlNode * prev; /* an element to insert after */
25991 xmlNode * next; /* an element to insert next */
25993 xmlChar ** names; /* an array to store the list of child names */
25995 int max; /* the size of the array */
25998 for (n_prev = 0;n_prev < gen_nb_xmlNodePtr;n_prev++) {
25999 for (n_next = 0;n_next < gen_nb_xmlNodePtr;n_next++) {
26000 for (n_names = 0;n_names < gen_nb_const_xmlChar_ptr_ptr;n_names++) {
26001 for (n_max = 0;n_max < gen_nb_int;n_max++) {
26002 mem_base = xmlMemBlocks();
26003 prev = gen_xmlNodePtr(n_prev, 0);
26004 next = gen_xmlNodePtr(n_next, 1);
26005 names = gen_const_xmlChar_ptr_ptr(n_names, 2);
26006 max = gen_int(n_max, 3);
26008 ret_val = xmlValidGetValidElements(prev, next, (const xmlChar **)names, max);
26009 desret_int(ret_val);
26011 des_xmlNodePtr(n_prev, prev, 0);
26012 des_xmlNodePtr(n_next, next, 1);
26013 des_const_xmlChar_ptr_ptr(n_names, (const xmlChar **)names, 2);
26014 des_int(n_max, max, 3);
26015 xmlResetLastError();
26016 if (mem_base != xmlMemBlocks()) {
26017 printf("Leak of %d blocks found in xmlValidGetValidElements",
26018 xmlMemBlocks() - mem_base);
26020 printf(" %d", n_prev);
26021 printf(" %d", n_next);
26022 printf(" %d", n_names);
26023 printf(" %d", n_max);
26039 test_xmlValidNormalizeAttributeValue(void) {
26042 #if defined(LIBXML_VALID_ENABLED)
26045 xmlDocPtr doc; /* the document */
26047 xmlNodePtr elem; /* the parent */
26049 xmlChar * name; /* the attribute name */
26051 xmlChar * value; /* the attribute value */
26054 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26055 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26056 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
26057 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26058 mem_base = xmlMemBlocks();
26059 doc = gen_xmlDocPtr(n_doc, 0);
26060 elem = gen_xmlNodePtr(n_elem, 1);
26061 name = gen_const_xmlChar_ptr(n_name, 2);
26062 value = gen_const_xmlChar_ptr(n_value, 3);
26064 ret_val = xmlValidNormalizeAttributeValue(doc, elem, (const xmlChar *)name, (const xmlChar *)value);
26065 desret_xmlChar_ptr(ret_val);
26067 des_xmlDocPtr(n_doc, doc, 0);
26068 des_xmlNodePtr(n_elem, elem, 1);
26069 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
26070 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
26071 xmlResetLastError();
26072 if (mem_base != xmlMemBlocks()) {
26073 printf("Leak of %d blocks found in xmlValidNormalizeAttributeValue",
26074 xmlMemBlocks() - mem_base);
26076 printf(" %d", n_doc);
26077 printf(" %d", n_elem);
26078 printf(" %d", n_name);
26079 printf(" %d", n_value);
26094 test_xmlValidateAttributeDecl(void) {
26097 #if defined(LIBXML_VALID_ENABLED)
26100 xmlValidCtxtPtr ctxt; /* the validation context */
26102 xmlDocPtr doc; /* a document instance */
26104 xmlAttributePtr attr; /* an attribute definition */
26107 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26108 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26109 for (n_attr = 0;n_attr < gen_nb_xmlAttributePtr;n_attr++) {
26110 mem_base = xmlMemBlocks();
26111 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26112 doc = gen_xmlDocPtr(n_doc, 1);
26113 attr = gen_xmlAttributePtr(n_attr, 2);
26115 ret_val = xmlValidateAttributeDecl(ctxt, doc, attr);
26116 desret_int(ret_val);
26118 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26119 des_xmlDocPtr(n_doc, doc, 1);
26120 des_xmlAttributePtr(n_attr, attr, 2);
26121 xmlResetLastError();
26122 if (mem_base != xmlMemBlocks()) {
26123 printf("Leak of %d blocks found in xmlValidateAttributeDecl",
26124 xmlMemBlocks() - mem_base);
26126 printf(" %d", n_ctxt);
26127 printf(" %d", n_doc);
26128 printf(" %d", n_attr);
26142 test_xmlValidateAttributeValue(void) {
26145 #if defined(LIBXML_VALID_ENABLED)
26148 xmlAttributeType type; /* an attribute type */
26150 xmlChar * value; /* an attribute value */
26153 for (n_type = 0;n_type < gen_nb_xmlAttributeType;n_type++) {
26154 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26155 mem_base = xmlMemBlocks();
26156 type = gen_xmlAttributeType(n_type, 0);
26157 value = gen_const_xmlChar_ptr(n_value, 1);
26159 ret_val = xmlValidateAttributeValue(type, (const xmlChar *)value);
26160 desret_int(ret_val);
26162 des_xmlAttributeType(n_type, type, 0);
26163 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
26164 xmlResetLastError();
26165 if (mem_base != xmlMemBlocks()) {
26166 printf("Leak of %d blocks found in xmlValidateAttributeValue",
26167 xmlMemBlocks() - mem_base);
26169 printf(" %d", n_type);
26170 printf(" %d", n_value);
26183 test_xmlValidateDocument(void) {
26186 #if defined(LIBXML_VALID_ENABLED)
26189 xmlValidCtxtPtr ctxt; /* the validation context */
26191 xmlDocPtr doc; /* a document instance */
26194 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26195 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26196 mem_base = xmlMemBlocks();
26197 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26198 doc = gen_xmlDocPtr(n_doc, 1);
26200 ret_val = xmlValidateDocument(ctxt, doc);
26201 desret_int(ret_val);
26203 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26204 des_xmlDocPtr(n_doc, doc, 1);
26205 xmlResetLastError();
26206 if (mem_base != xmlMemBlocks()) {
26207 printf("Leak of %d blocks found in xmlValidateDocument",
26208 xmlMemBlocks() - mem_base);
26210 printf(" %d", n_ctxt);
26211 printf(" %d", n_doc);
26224 test_xmlValidateDocumentFinal(void) {
26227 #if defined(LIBXML_VALID_ENABLED)
26230 xmlValidCtxtPtr ctxt; /* the validation context */
26232 xmlDocPtr doc; /* a document instance */
26235 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26236 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26237 mem_base = xmlMemBlocks();
26238 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26239 doc = gen_xmlDocPtr(n_doc, 1);
26241 ret_val = xmlValidateDocumentFinal(ctxt, doc);
26242 desret_int(ret_val);
26244 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26245 des_xmlDocPtr(n_doc, doc, 1);
26246 xmlResetLastError();
26247 if (mem_base != xmlMemBlocks()) {
26248 printf("Leak of %d blocks found in xmlValidateDocumentFinal",
26249 xmlMemBlocks() - mem_base);
26251 printf(" %d", n_ctxt);
26252 printf(" %d", n_doc);
26265 test_xmlValidateDtd(void) {
26268 #if defined(LIBXML_VALID_ENABLED)
26271 xmlValidCtxtPtr ctxt; /* the validation context */
26273 xmlDocPtr doc; /* a document instance */
26275 xmlDtdPtr dtd; /* a dtd instance */
26278 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26279 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26280 for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
26281 mem_base = xmlMemBlocks();
26282 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26283 doc = gen_xmlDocPtr(n_doc, 1);
26284 dtd = gen_xmlDtdPtr(n_dtd, 2);
26286 ret_val = xmlValidateDtd(ctxt, doc, dtd);
26287 desret_int(ret_val);
26289 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26290 des_xmlDocPtr(n_doc, doc, 1);
26291 des_xmlDtdPtr(n_dtd, dtd, 2);
26292 xmlResetLastError();
26293 if (mem_base != xmlMemBlocks()) {
26294 printf("Leak of %d blocks found in xmlValidateDtd",
26295 xmlMemBlocks() - mem_base);
26297 printf(" %d", n_ctxt);
26298 printf(" %d", n_doc);
26299 printf(" %d", n_dtd);
26313 test_xmlValidateDtdFinal(void) {
26316 #if defined(LIBXML_VALID_ENABLED)
26319 xmlValidCtxtPtr ctxt; /* the validation context */
26321 xmlDocPtr doc; /* a document instance */
26324 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26325 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26326 mem_base = xmlMemBlocks();
26327 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26328 doc = gen_xmlDocPtr(n_doc, 1);
26330 ret_val = xmlValidateDtdFinal(ctxt, doc);
26331 desret_int(ret_val);
26333 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26334 des_xmlDocPtr(n_doc, doc, 1);
26335 xmlResetLastError();
26336 if (mem_base != xmlMemBlocks()) {
26337 printf("Leak of %d blocks found in xmlValidateDtdFinal",
26338 xmlMemBlocks() - mem_base);
26340 printf(" %d", n_ctxt);
26341 printf(" %d", n_doc);
26354 test_xmlValidateElement(void) {
26357 #if defined(LIBXML_VALID_ENABLED)
26360 xmlValidCtxtPtr ctxt; /* the validation context */
26362 xmlDocPtr doc; /* a document instance */
26364 xmlNodePtr elem; /* an element instance */
26367 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26368 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26369 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26370 mem_base = xmlMemBlocks();
26371 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26372 doc = gen_xmlDocPtr(n_doc, 1);
26373 elem = gen_xmlNodePtr(n_elem, 2);
26375 ret_val = xmlValidateElement(ctxt, doc, elem);
26376 desret_int(ret_val);
26378 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26379 des_xmlDocPtr(n_doc, doc, 1);
26380 des_xmlNodePtr(n_elem, elem, 2);
26381 xmlResetLastError();
26382 if (mem_base != xmlMemBlocks()) {
26383 printf("Leak of %d blocks found in xmlValidateElement",
26384 xmlMemBlocks() - mem_base);
26386 printf(" %d", n_ctxt);
26387 printf(" %d", n_doc);
26388 printf(" %d", n_elem);
26402 test_xmlValidateElementDecl(void) {
26405 #if defined(LIBXML_VALID_ENABLED)
26408 xmlValidCtxtPtr ctxt; /* the validation context */
26410 xmlDocPtr doc; /* a document instance */
26412 xmlElementPtr elem; /* an element definition */
26415 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26416 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26417 for (n_elem = 0;n_elem < gen_nb_xmlElementPtr;n_elem++) {
26418 mem_base = xmlMemBlocks();
26419 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26420 doc = gen_xmlDocPtr(n_doc, 1);
26421 elem = gen_xmlElementPtr(n_elem, 2);
26423 ret_val = xmlValidateElementDecl(ctxt, doc, elem);
26424 desret_int(ret_val);
26426 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26427 des_xmlDocPtr(n_doc, doc, 1);
26428 des_xmlElementPtr(n_elem, elem, 2);
26429 xmlResetLastError();
26430 if (mem_base != xmlMemBlocks()) {
26431 printf("Leak of %d blocks found in xmlValidateElementDecl",
26432 xmlMemBlocks() - mem_base);
26434 printf(" %d", n_ctxt);
26435 printf(" %d", n_doc);
26436 printf(" %d", n_elem);
26450 test_xmlValidateNameValue(void) {
26453 #if defined(LIBXML_VALID_ENABLED)
26456 xmlChar * value; /* an Name value */
26459 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26460 mem_base = xmlMemBlocks();
26461 value = gen_const_xmlChar_ptr(n_value, 0);
26463 ret_val = xmlValidateNameValue((const xmlChar *)value);
26464 desret_int(ret_val);
26466 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
26467 xmlResetLastError();
26468 if (mem_base != xmlMemBlocks()) {
26469 printf("Leak of %d blocks found in xmlValidateNameValue",
26470 xmlMemBlocks() - mem_base);
26472 printf(" %d", n_value);
26484 test_xmlValidateNamesValue(void) {
26487 #if defined(LIBXML_VALID_ENABLED)
26490 xmlChar * value; /* an Names value */
26493 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26494 mem_base = xmlMemBlocks();
26495 value = gen_const_xmlChar_ptr(n_value, 0);
26497 ret_val = xmlValidateNamesValue((const xmlChar *)value);
26498 desret_int(ret_val);
26500 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
26501 xmlResetLastError();
26502 if (mem_base != xmlMemBlocks()) {
26503 printf("Leak of %d blocks found in xmlValidateNamesValue",
26504 xmlMemBlocks() - mem_base);
26506 printf(" %d", n_value);
26518 test_xmlValidateNmtokenValue(void) {
26521 #if defined(LIBXML_VALID_ENABLED)
26524 xmlChar * value; /* an Nmtoken value */
26527 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26528 mem_base = xmlMemBlocks();
26529 value = gen_const_xmlChar_ptr(n_value, 0);
26531 ret_val = xmlValidateNmtokenValue((const xmlChar *)value);
26532 desret_int(ret_val);
26534 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
26535 xmlResetLastError();
26536 if (mem_base != xmlMemBlocks()) {
26537 printf("Leak of %d blocks found in xmlValidateNmtokenValue",
26538 xmlMemBlocks() - mem_base);
26540 printf(" %d", n_value);
26552 test_xmlValidateNmtokensValue(void) {
26555 #if defined(LIBXML_VALID_ENABLED)
26558 xmlChar * value; /* an Nmtokens value */
26561 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26562 mem_base = xmlMemBlocks();
26563 value = gen_const_xmlChar_ptr(n_value, 0);
26565 ret_val = xmlValidateNmtokensValue((const xmlChar *)value);
26566 desret_int(ret_val);
26568 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
26569 xmlResetLastError();
26570 if (mem_base != xmlMemBlocks()) {
26571 printf("Leak of %d blocks found in xmlValidateNmtokensValue",
26572 xmlMemBlocks() - mem_base);
26574 printf(" %d", n_value);
26586 test_xmlValidateNotationDecl(void) {
26589 #if defined(LIBXML_VALID_ENABLED)
26592 xmlValidCtxtPtr ctxt; /* the validation context */
26594 xmlDocPtr doc; /* a document instance */
26596 xmlNotationPtr nota; /* a notation definition */
26599 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26600 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26601 for (n_nota = 0;n_nota < gen_nb_xmlNotationPtr;n_nota++) {
26602 mem_base = xmlMemBlocks();
26603 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26604 doc = gen_xmlDocPtr(n_doc, 1);
26605 nota = gen_xmlNotationPtr(n_nota, 2);
26607 ret_val = xmlValidateNotationDecl(ctxt, doc, nota);
26608 desret_int(ret_val);
26610 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26611 des_xmlDocPtr(n_doc, doc, 1);
26612 des_xmlNotationPtr(n_nota, nota, 2);
26613 xmlResetLastError();
26614 if (mem_base != xmlMemBlocks()) {
26615 printf("Leak of %d blocks found in xmlValidateNotationDecl",
26616 xmlMemBlocks() - mem_base);
26618 printf(" %d", n_ctxt);
26619 printf(" %d", n_doc);
26620 printf(" %d", n_nota);
26634 test_xmlValidateNotationUse(void) {
26637 #if defined(LIBXML_VALID_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
26640 xmlValidCtxtPtr ctxt; /* the validation context */
26642 xmlDocPtr doc; /* the document */
26644 xmlChar * notationName; /* the notation name to check */
26645 int n_notationName;
26647 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26648 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26649 for (n_notationName = 0;n_notationName < gen_nb_const_xmlChar_ptr;n_notationName++) {
26650 mem_base = xmlMemBlocks();
26651 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26652 doc = gen_xmlDocPtr(n_doc, 1);
26653 notationName = gen_const_xmlChar_ptr(n_notationName, 2);
26655 ret_val = xmlValidateNotationUse(ctxt, doc, (const xmlChar *)notationName);
26656 desret_int(ret_val);
26658 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26659 des_xmlDocPtr(n_doc, doc, 1);
26660 des_const_xmlChar_ptr(n_notationName, (const xmlChar *)notationName, 2);
26661 xmlResetLastError();
26662 if (mem_base != xmlMemBlocks()) {
26663 printf("Leak of %d blocks found in xmlValidateNotationUse",
26664 xmlMemBlocks() - mem_base);
26666 printf(" %d", n_ctxt);
26667 printf(" %d", n_doc);
26668 printf(" %d", n_notationName);
26682 test_xmlValidateOneAttribute(void) {
26685 #if defined(LIBXML_VALID_ENABLED)
26688 xmlValidCtxtPtr ctxt; /* the validation context */
26690 xmlDocPtr doc; /* a document instance */
26692 xmlNodePtr elem; /* an element instance */
26694 xmlAttrPtr attr; /* an attribute instance */
26696 xmlChar * value; /* the attribute value (without entities processing) */
26699 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26700 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26701 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26702 for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
26703 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26704 mem_base = xmlMemBlocks();
26705 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26706 doc = gen_xmlDocPtr(n_doc, 1);
26707 elem = gen_xmlNodePtr(n_elem, 2);
26708 attr = gen_xmlAttrPtr(n_attr, 3);
26709 value = gen_const_xmlChar_ptr(n_value, 4);
26711 ret_val = xmlValidateOneAttribute(ctxt, doc, elem, attr, (const xmlChar *)value);
26712 desret_int(ret_val);
26714 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26715 des_xmlDocPtr(n_doc, doc, 1);
26716 des_xmlNodePtr(n_elem, elem, 2);
26717 des_xmlAttrPtr(n_attr, attr, 3);
26718 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 4);
26719 xmlResetLastError();
26720 if (mem_base != xmlMemBlocks()) {
26721 printf("Leak of %d blocks found in xmlValidateOneAttribute",
26722 xmlMemBlocks() - mem_base);
26724 printf(" %d", n_ctxt);
26725 printf(" %d", n_doc);
26726 printf(" %d", n_elem);
26727 printf(" %d", n_attr);
26728 printf(" %d", n_value);
26744 test_xmlValidateOneElement(void) {
26747 #if defined(LIBXML_VALID_ENABLED)
26750 xmlValidCtxtPtr ctxt; /* the validation context */
26752 xmlDocPtr doc; /* a document instance */
26754 xmlNodePtr elem; /* an element instance */
26757 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26758 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26759 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26760 mem_base = xmlMemBlocks();
26761 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26762 doc = gen_xmlDocPtr(n_doc, 1);
26763 elem = gen_xmlNodePtr(n_elem, 2);
26765 ret_val = xmlValidateOneElement(ctxt, doc, elem);
26766 desret_int(ret_val);
26768 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26769 des_xmlDocPtr(n_doc, doc, 1);
26770 des_xmlNodePtr(n_elem, elem, 2);
26771 xmlResetLastError();
26772 if (mem_base != xmlMemBlocks()) {
26773 printf("Leak of %d blocks found in xmlValidateOneElement",
26774 xmlMemBlocks() - mem_base);
26776 printf(" %d", n_ctxt);
26777 printf(" %d", n_doc);
26778 printf(" %d", n_elem);
26792 test_xmlValidateOneNamespace(void) {
26795 #if defined(LIBXML_VALID_ENABLED)
26798 xmlValidCtxtPtr ctxt; /* the validation context */
26800 xmlDocPtr doc; /* a document instance */
26802 xmlNodePtr elem; /* an element instance */
26804 xmlChar * prefix; /* the namespace prefix */
26806 xmlNsPtr ns; /* an namespace declaration instance */
26808 xmlChar * value; /* the attribute value (without entities processing) */
26811 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26812 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26813 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26814 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
26815 for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
26816 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26817 mem_base = xmlMemBlocks();
26818 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26819 doc = gen_xmlDocPtr(n_doc, 1);
26820 elem = gen_xmlNodePtr(n_elem, 2);
26821 prefix = gen_const_xmlChar_ptr(n_prefix, 3);
26822 ns = gen_xmlNsPtr(n_ns, 4);
26823 value = gen_const_xmlChar_ptr(n_value, 5);
26825 ret_val = xmlValidateOneNamespace(ctxt, doc, elem, (const xmlChar *)prefix, ns, (const xmlChar *)value);
26826 desret_int(ret_val);
26828 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26829 des_xmlDocPtr(n_doc, doc, 1);
26830 des_xmlNodePtr(n_elem, elem, 2);
26831 des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 3);
26832 des_xmlNsPtr(n_ns, ns, 4);
26833 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 5);
26834 xmlResetLastError();
26835 if (mem_base != xmlMemBlocks()) {
26836 printf("Leak of %d blocks found in xmlValidateOneNamespace",
26837 xmlMemBlocks() - mem_base);
26839 printf(" %d", n_ctxt);
26840 printf(" %d", n_doc);
26841 printf(" %d", n_elem);
26842 printf(" %d", n_prefix);
26843 printf(" %d", n_ns);
26844 printf(" %d", n_value);
26861 test_xmlValidatePopElement(void) {
26864 #if defined(LIBXML_VALID_ENABLED) && defined(LIBXML_REGEXP_ENABLED)
26867 xmlValidCtxtPtr ctxt; /* the validation context */
26869 xmlDocPtr doc; /* a document instance */
26871 xmlNodePtr elem; /* an element instance */
26873 xmlChar * qname; /* the qualified name as appearing in the serialization */
26876 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26877 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26878 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26879 for (n_qname = 0;n_qname < gen_nb_const_xmlChar_ptr;n_qname++) {
26880 mem_base = xmlMemBlocks();
26881 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26882 doc = gen_xmlDocPtr(n_doc, 1);
26883 elem = gen_xmlNodePtr(n_elem, 2);
26884 qname = gen_const_xmlChar_ptr(n_qname, 3);
26886 ret_val = xmlValidatePopElement(ctxt, doc, elem, (const xmlChar *)qname);
26887 desret_int(ret_val);
26889 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26890 des_xmlDocPtr(n_doc, doc, 1);
26891 des_xmlNodePtr(n_elem, elem, 2);
26892 des_const_xmlChar_ptr(n_qname, (const xmlChar *)qname, 3);
26893 xmlResetLastError();
26894 if (mem_base != xmlMemBlocks()) {
26895 printf("Leak of %d blocks found in xmlValidatePopElement",
26896 xmlMemBlocks() - mem_base);
26898 printf(" %d", n_ctxt);
26899 printf(" %d", n_doc);
26900 printf(" %d", n_elem);
26901 printf(" %d", n_qname);
26916 test_xmlValidatePushCData(void) {
26919 #if defined(LIBXML_VALID_ENABLED) && defined(LIBXML_REGEXP_ENABLED)
26922 xmlValidCtxtPtr ctxt; /* the validation context */
26924 xmlChar * data; /* some character data read */
26926 int len; /* the lenght of the data */
26929 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26930 for (n_data = 0;n_data < gen_nb_const_xmlChar_ptr;n_data++) {
26931 for (n_len = 0;n_len < gen_nb_int;n_len++) {
26932 mem_base = xmlMemBlocks();
26933 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26934 data = gen_const_xmlChar_ptr(n_data, 1);
26935 len = gen_int(n_len, 2);
26937 ret_val = xmlValidatePushCData(ctxt, (const xmlChar *)data, len);
26938 desret_int(ret_val);
26940 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26941 des_const_xmlChar_ptr(n_data, (const xmlChar *)data, 1);
26942 des_int(n_len, len, 2);
26943 xmlResetLastError();
26944 if (mem_base != xmlMemBlocks()) {
26945 printf("Leak of %d blocks found in xmlValidatePushCData",
26946 xmlMemBlocks() - mem_base);
26948 printf(" %d", n_ctxt);
26949 printf(" %d", n_data);
26950 printf(" %d", n_len);
26964 test_xmlValidatePushElement(void) {
26967 #if defined(LIBXML_VALID_ENABLED) && defined(LIBXML_REGEXP_ENABLED)
26970 xmlValidCtxtPtr ctxt; /* the validation context */
26972 xmlDocPtr doc; /* a document instance */
26974 xmlNodePtr elem; /* an element instance */
26976 xmlChar * qname; /* the qualified name as appearing in the serialization */
26979 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26980 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26981 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26982 for (n_qname = 0;n_qname < gen_nb_const_xmlChar_ptr;n_qname++) {
26983 mem_base = xmlMemBlocks();
26984 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26985 doc = gen_xmlDocPtr(n_doc, 1);
26986 elem = gen_xmlNodePtr(n_elem, 2);
26987 qname = gen_const_xmlChar_ptr(n_qname, 3);
26989 ret_val = xmlValidatePushElement(ctxt, doc, elem, (const xmlChar *)qname);
26990 desret_int(ret_val);
26992 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26993 des_xmlDocPtr(n_doc, doc, 1);
26994 des_xmlNodePtr(n_elem, elem, 2);
26995 des_const_xmlChar_ptr(n_qname, (const xmlChar *)qname, 3);
26996 xmlResetLastError();
26997 if (mem_base != xmlMemBlocks()) {
26998 printf("Leak of %d blocks found in xmlValidatePushElement",
26999 xmlMemBlocks() - mem_base);
27001 printf(" %d", n_ctxt);
27002 printf(" %d", n_doc);
27003 printf(" %d", n_elem);
27004 printf(" %d", n_qname);
27019 test_xmlValidateRoot(void) {
27022 #if defined(LIBXML_VALID_ENABLED)
27025 xmlValidCtxtPtr ctxt; /* the validation context */
27027 xmlDocPtr doc; /* a document instance */
27030 for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
27031 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
27032 mem_base = xmlMemBlocks();
27033 ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
27034 doc = gen_xmlDocPtr(n_doc, 1);
27036 ret_val = xmlValidateRoot(ctxt, doc);
27037 desret_int(ret_val);
27039 des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
27040 des_xmlDocPtr(n_doc, doc, 1);
27041 xmlResetLastError();
27042 if (mem_base != xmlMemBlocks()) {
27043 printf("Leak of %d blocks found in xmlValidateRoot",
27044 xmlMemBlocks() - mem_base);
27046 printf(" %d", n_ctxt);
27047 printf(" %d", n_doc);
27062 if (quiet == 0) printf("Testing valid : 50 of 70 functions ...\n");
27063 test_ret += test_xmlAddAttributeDecl();
27064 test_ret += test_xmlAddElementDecl();
27065 test_ret += test_xmlAddID();
27066 test_ret += test_xmlAddNotationDecl();
27067 test_ret += test_xmlAddRef();
27068 test_ret += test_xmlCopyAttributeTable();
27069 test_ret += test_xmlCopyDocElementContent();
27070 test_ret += test_xmlCopyElementContent();
27071 test_ret += test_xmlCopyElementTable();
27072 test_ret += test_xmlCopyEnumeration();
27073 test_ret += test_xmlCopyNotationTable();
27074 test_ret += test_xmlCreateEnumeration();
27075 test_ret += test_xmlDumpAttributeDecl();
27076 test_ret += test_xmlDumpAttributeTable();
27077 test_ret += test_xmlDumpElementDecl();
27078 test_ret += test_xmlDumpElementTable();
27079 test_ret += test_xmlDumpNotationDecl();
27080 test_ret += test_xmlDumpNotationTable();
27081 test_ret += test_xmlGetDtdAttrDesc();
27082 test_ret += test_xmlGetDtdElementDesc();
27083 test_ret += test_xmlGetDtdNotationDesc();
27084 test_ret += test_xmlGetDtdQAttrDesc();
27085 test_ret += test_xmlGetDtdQElementDesc();
27086 test_ret += test_xmlGetID();
27087 test_ret += test_xmlGetRefs();
27088 test_ret += test_xmlIsID();
27089 test_ret += test_xmlIsMixedElement();
27090 test_ret += test_xmlIsRef();
27091 test_ret += test_xmlNewDocElementContent();
27092 test_ret += test_xmlNewElementContent();
27093 test_ret += test_xmlNewValidCtxt();
27094 test_ret += test_xmlRemoveID();
27095 test_ret += test_xmlRemoveRef();
27096 test_ret += test_xmlSnprintfElementContent();
27097 test_ret += test_xmlSprintfElementContent();
27098 test_ret += test_xmlValidBuildContentModel();
27099 test_ret += test_xmlValidCtxtNormalizeAttributeValue();
27100 test_ret += test_xmlValidGetPotentialChildren();
27101 test_ret += test_xmlValidGetValidElements();
27102 test_ret += test_xmlValidNormalizeAttributeValue();
27103 test_ret += test_xmlValidateAttributeDecl();
27104 test_ret += test_xmlValidateAttributeValue();
27105 test_ret += test_xmlValidateDocument();
27106 test_ret += test_xmlValidateDocumentFinal();
27107 test_ret += test_xmlValidateDtd();
27108 test_ret += test_xmlValidateDtdFinal();
27109 test_ret += test_xmlValidateElement();
27110 test_ret += test_xmlValidateElementDecl();
27111 test_ret += test_xmlValidateNameValue();
27112 test_ret += test_xmlValidateNamesValue();
27113 test_ret += test_xmlValidateNmtokenValue();
27114 test_ret += test_xmlValidateNmtokensValue();
27115 test_ret += test_xmlValidateNotationDecl();
27116 test_ret += test_xmlValidateNotationUse();
27117 test_ret += test_xmlValidateOneAttribute();
27118 test_ret += test_xmlValidateOneElement();
27119 test_ret += test_xmlValidateOneNamespace();
27120 test_ret += test_xmlValidatePopElement();
27121 test_ret += test_xmlValidatePushCData();
27122 test_ret += test_xmlValidatePushElement();
27123 test_ret += test_xmlValidateRoot();
27126 printf("Module valid: %d errors\n", test_ret);
27131 test_xmlXIncludeNewContext(void) {
27135 /* missing type support */
27141 test_xmlXIncludeProcess(void) {
27144 #if defined(LIBXML_XINCLUDE_ENABLED)
27147 xmlDocPtr doc; /* an XML document */
27150 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
27151 mem_base = xmlMemBlocks();
27152 doc = gen_xmlDocPtr(n_doc, 0);
27154 ret_val = xmlXIncludeProcess(doc);
27155 desret_int(ret_val);
27157 des_xmlDocPtr(n_doc, doc, 0);
27158 xmlResetLastError();
27159 if (mem_base != xmlMemBlocks()) {
27160 printf("Leak of %d blocks found in xmlXIncludeProcess",
27161 xmlMemBlocks() - mem_base);
27163 printf(" %d", n_doc);
27175 test_xmlXIncludeProcessFlags(void) {
27178 #if defined(LIBXML_XINCLUDE_ENABLED)
27181 xmlDocPtr doc; /* an XML document */
27183 int flags; /* a set of xmlParserOption used for parsing XML includes */
27186 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
27187 for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
27188 mem_base = xmlMemBlocks();
27189 doc = gen_xmlDocPtr(n_doc, 0);
27190 flags = gen_int(n_flags, 1);
27192 ret_val = xmlXIncludeProcessFlags(doc, flags);
27193 desret_int(ret_val);
27195 des_xmlDocPtr(n_doc, doc, 0);
27196 des_int(n_flags, flags, 1);
27197 xmlResetLastError();
27198 if (mem_base != xmlMemBlocks()) {
27199 printf("Leak of %d blocks found in xmlXIncludeProcessFlags",
27200 xmlMemBlocks() - mem_base);
27202 printf(" %d", n_doc);
27203 printf(" %d", n_flags);
27216 test_xmlXIncludeProcessFlagsData(void) {
27219 #if defined(LIBXML_XINCLUDE_ENABLED)
27222 xmlDocPtr doc; /* an XML document */
27224 int flags; /* a set of xmlParserOption used for parsing XML includes */
27226 void * data; /* application data that will be passed to the parser context in the _private field of the parser context(s) */
27229 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
27230 for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
27231 for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
27232 mem_base = xmlMemBlocks();
27233 doc = gen_xmlDocPtr(n_doc, 0);
27234 flags = gen_int(n_flags, 1);
27235 data = gen_userdata(n_data, 2);
27237 ret_val = xmlXIncludeProcessFlagsData(doc, flags, data);
27238 desret_int(ret_val);
27240 des_xmlDocPtr(n_doc, doc, 0);
27241 des_int(n_flags, flags, 1);
27242 des_userdata(n_data, data, 2);
27243 xmlResetLastError();
27244 if (mem_base != xmlMemBlocks()) {
27245 printf("Leak of %d blocks found in xmlXIncludeProcessFlagsData",
27246 xmlMemBlocks() - mem_base);
27248 printf(" %d", n_doc);
27249 printf(" %d", n_flags);
27250 printf(" %d", n_data);
27262 #ifdef LIBXML_XINCLUDE_ENABLED
27264 #define gen_nb_xmlXIncludeCtxtPtr 1
27265 static xmlXIncludeCtxtPtr gen_xmlXIncludeCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
27268 static void des_xmlXIncludeCtxtPtr(int no ATTRIBUTE_UNUSED, xmlXIncludeCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
27274 test_xmlXIncludeProcessNode(void) {
27277 #if defined(LIBXML_XINCLUDE_ENABLED)
27280 xmlXIncludeCtxtPtr ctxt; /* an existing XInclude context */
27282 xmlNodePtr node; /* a node in an XML document */
27285 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXIncludeCtxtPtr;n_ctxt++) {
27286 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
27287 mem_base = xmlMemBlocks();
27288 ctxt = gen_xmlXIncludeCtxtPtr(n_ctxt, 0);
27289 node = gen_xmlNodePtr(n_node, 1);
27291 ret_val = xmlXIncludeProcessNode(ctxt, node);
27292 desret_int(ret_val);
27294 des_xmlXIncludeCtxtPtr(n_ctxt, ctxt, 0);
27295 des_xmlNodePtr(n_node, node, 1);
27296 xmlResetLastError();
27297 if (mem_base != xmlMemBlocks()) {
27298 printf("Leak of %d blocks found in xmlXIncludeProcessNode",
27299 xmlMemBlocks() - mem_base);
27301 printf(" %d", n_ctxt);
27302 printf(" %d", n_node);
27315 test_xmlXIncludeProcessTree(void) {
27318 #if defined(LIBXML_XINCLUDE_ENABLED)
27321 xmlNodePtr tree; /* a node in an XML document */
27324 for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
27325 mem_base = xmlMemBlocks();
27326 tree = gen_xmlNodePtr(n_tree, 0);
27328 ret_val = xmlXIncludeProcessTree(tree);
27329 desret_int(ret_val);
27331 des_xmlNodePtr(n_tree, tree, 0);
27332 xmlResetLastError();
27333 if (mem_base != xmlMemBlocks()) {
27334 printf("Leak of %d blocks found in xmlXIncludeProcessTree",
27335 xmlMemBlocks() - mem_base);
27337 printf(" %d", n_tree);
27349 test_xmlXIncludeProcessTreeFlags(void) {
27352 #if defined(LIBXML_XINCLUDE_ENABLED)
27355 xmlNodePtr tree; /* a node in an XML document */
27357 int flags; /* a set of xmlParserOption used for parsing XML includes */
27360 for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
27361 for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
27362 mem_base = xmlMemBlocks();
27363 tree = gen_xmlNodePtr(n_tree, 0);
27364 flags = gen_int(n_flags, 1);
27366 ret_val = xmlXIncludeProcessTreeFlags(tree, flags);
27367 desret_int(ret_val);
27369 des_xmlNodePtr(n_tree, tree, 0);
27370 des_int(n_flags, flags, 1);
27371 xmlResetLastError();
27372 if (mem_base != xmlMemBlocks()) {
27373 printf("Leak of %d blocks found in xmlXIncludeProcessTreeFlags",
27374 xmlMemBlocks() - mem_base);
27376 printf(" %d", n_tree);
27377 printf(" %d", n_flags);
27390 test_xmlXIncludeProcessTreeFlagsData(void) {
27393 #if defined(LIBXML_XINCLUDE_ENABLED)
27396 xmlNodePtr tree; /* an XML node */
27398 int flags; /* a set of xmlParserOption used for parsing XML includes */
27400 void * data; /* application data that will be passed to the parser context in the _private field of the parser context(s) */
27403 for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
27404 for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
27405 for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
27406 mem_base = xmlMemBlocks();
27407 tree = gen_xmlNodePtr(n_tree, 0);
27408 flags = gen_int(n_flags, 1);
27409 data = gen_userdata(n_data, 2);
27411 ret_val = xmlXIncludeProcessTreeFlagsData(tree, flags, data);
27412 desret_int(ret_val);
27414 des_xmlNodePtr(n_tree, tree, 0);
27415 des_int(n_flags, flags, 1);
27416 des_userdata(n_data, data, 2);
27417 xmlResetLastError();
27418 if (mem_base != xmlMemBlocks()) {
27419 printf("Leak of %d blocks found in xmlXIncludeProcessTreeFlagsData",
27420 xmlMemBlocks() - mem_base);
27422 printf(" %d", n_tree);
27423 printf(" %d", n_flags);
27424 printf(" %d", n_data);
27438 test_xmlXIncludeSetFlags(void) {
27441 #if defined(LIBXML_XINCLUDE_ENABLED)
27444 xmlXIncludeCtxtPtr ctxt; /* an XInclude processing context */
27446 int flags; /* a set of xmlParserOption used for parsing XML includes */
27449 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXIncludeCtxtPtr;n_ctxt++) {
27450 for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
27451 mem_base = xmlMemBlocks();
27452 ctxt = gen_xmlXIncludeCtxtPtr(n_ctxt, 0);
27453 flags = gen_int(n_flags, 1);
27455 ret_val = xmlXIncludeSetFlags(ctxt, flags);
27456 desret_int(ret_val);
27458 des_xmlXIncludeCtxtPtr(n_ctxt, ctxt, 0);
27459 des_int(n_flags, flags, 1);
27460 xmlResetLastError();
27461 if (mem_base != xmlMemBlocks()) {
27462 printf("Leak of %d blocks found in xmlXIncludeSetFlags",
27463 xmlMemBlocks() - mem_base);
27465 printf(" %d", n_ctxt);
27466 printf(" %d", n_flags);
27478 test_xinclude(void) {
27481 if (quiet == 0) printf("Testing xinclude : 8 of 10 functions ...\n");
27482 test_ret += test_xmlXIncludeNewContext();
27483 test_ret += test_xmlXIncludeProcess();
27484 test_ret += test_xmlXIncludeProcessFlags();
27485 test_ret += test_xmlXIncludeProcessFlagsData();
27486 test_ret += test_xmlXIncludeProcessNode();
27487 test_ret += test_xmlXIncludeProcessTree();
27488 test_ret += test_xmlXIncludeProcessTreeFlags();
27489 test_ret += test_xmlXIncludeProcessTreeFlagsData();
27490 test_ret += test_xmlXIncludeSetFlags();
27493 printf("Module xinclude: %d errors\n", test_ret);
27498 test_xmlAllocOutputBuffer(void) {
27501 #if defined(LIBXML_OUTPUT_ENABLED)
27503 xmlOutputBufferPtr ret_val;
27504 xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
27507 for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
27508 mem_base = xmlMemBlocks();
27509 encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 0);
27511 ret_val = xmlAllocOutputBuffer(encoder);
27512 desret_xmlOutputBufferPtr(ret_val);
27514 des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 0);
27515 xmlResetLastError();
27516 if (mem_base != xmlMemBlocks()) {
27517 printf("Leak of %d blocks found in xmlAllocOutputBuffer",
27518 xmlMemBlocks() - mem_base);
27520 printf(" %d", n_encoder);
27532 test_xmlAllocParserInputBuffer(void) {
27536 xmlParserInputBufferPtr ret_val;
27537 xmlCharEncoding enc; /* the charset encoding if known */
27540 for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
27541 mem_base = xmlMemBlocks();
27542 enc = gen_xmlCharEncoding(n_enc, 0);
27544 ret_val = xmlAllocParserInputBuffer(enc);
27545 desret_xmlParserInputBufferPtr(ret_val);
27547 des_xmlCharEncoding(n_enc, enc, 0);
27548 xmlResetLastError();
27549 if (mem_base != xmlMemBlocks()) {
27550 printf("Leak of %d blocks found in xmlAllocParserInputBuffer",
27551 xmlMemBlocks() - mem_base);
27553 printf(" %d", n_enc);
27564 test_xmlCheckFilename(void) {
27569 char * path; /* the path to check */
27572 for (n_path = 0;n_path < gen_nb_const_char_ptr;n_path++) {
27573 mem_base = xmlMemBlocks();
27574 path = gen_const_char_ptr(n_path, 0);
27576 ret_val = xmlCheckFilename((const char *)path);
27577 desret_int(ret_val);
27579 des_const_char_ptr(n_path, (const char *)path, 0);
27580 xmlResetLastError();
27581 if (mem_base != xmlMemBlocks()) {
27582 printf("Leak of %d blocks found in xmlCheckFilename",
27583 xmlMemBlocks() - mem_base);
27585 printf(" %d", n_path);
27596 test_xmlCheckHTTPInput(void) {
27600 xmlParserInputPtr ret_val;
27601 xmlParserCtxtPtr ctxt; /* an XML parser context */
27603 xmlParserInputPtr ret; /* an XML parser input */
27606 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
27607 for (n_ret = 0;n_ret < gen_nb_xmlParserInputPtr;n_ret++) {
27608 mem_base = xmlMemBlocks();
27609 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
27610 ret = gen_xmlParserInputPtr(n_ret, 1);
27612 ret_val = xmlCheckHTTPInput(ctxt, ret);
27613 desret_xmlParserInputPtr(ret_val);
27615 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
27616 des_xmlParserInputPtr(n_ret, ret, 1);
27617 xmlResetLastError();
27618 if (mem_base != xmlMemBlocks()) {
27619 printf("Leak of %d blocks found in xmlCheckHTTPInput",
27620 xmlMemBlocks() - mem_base);
27622 printf(" %d", n_ctxt);
27623 printf(" %d", n_ret);
27635 test_xmlCleanupInputCallbacks(void) {
27640 mem_base = xmlMemBlocks();
27642 xmlCleanupInputCallbacks();
27644 xmlResetLastError();
27645 if (mem_base != xmlMemBlocks()) {
27646 printf("Leak of %d blocks found in xmlCleanupInputCallbacks",
27647 xmlMemBlocks() - mem_base);
27658 test_xmlCleanupOutputCallbacks(void) {
27661 #if defined(LIBXML_OUTPUT_ENABLED)
27664 mem_base = xmlMemBlocks();
27666 xmlCleanupOutputCallbacks();
27668 xmlResetLastError();
27669 if (mem_base != xmlMemBlocks()) {
27670 printf("Leak of %d blocks found in xmlCleanupOutputCallbacks",
27671 xmlMemBlocks() - mem_base);
27683 test_xmlFileClose(void) {
27688 void * context; /* the I/O context */
27691 for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
27692 mem_base = xmlMemBlocks();
27693 context = gen_void_ptr(n_context, 0);
27695 ret_val = xmlFileClose(context);
27696 desret_int(ret_val);
27698 des_void_ptr(n_context, context, 0);
27699 xmlResetLastError();
27700 if (mem_base != xmlMemBlocks()) {
27701 printf("Leak of %d blocks found in xmlFileClose",
27702 xmlMemBlocks() - mem_base);
27704 printf(" %d", n_context);
27715 test_xmlFileMatch(void) {
27720 const char * filename; /* the URI for matching */
27723 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
27724 mem_base = xmlMemBlocks();
27725 filename = gen_filepath(n_filename, 0);
27727 ret_val = xmlFileMatch(filename);
27728 desret_int(ret_val);
27730 des_filepath(n_filename, filename, 0);
27731 xmlResetLastError();
27732 if (mem_base != xmlMemBlocks()) {
27733 printf("Leak of %d blocks found in xmlFileMatch",
27734 xmlMemBlocks() - mem_base);
27736 printf(" %d", n_filename);
27747 test_xmlFileOpen(void) {
27752 const char * filename; /* the URI for matching */
27755 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
27756 mem_base = xmlMemBlocks();
27757 filename = gen_filepath(n_filename, 0);
27759 ret_val = xmlFileOpen(filename);
27760 desret_void_ptr(ret_val);
27762 des_filepath(n_filename, filename, 0);
27763 xmlResetLastError();
27764 if (mem_base != xmlMemBlocks()) {
27765 printf("Leak of %d blocks found in xmlFileOpen",
27766 xmlMemBlocks() - mem_base);
27768 printf(" %d", n_filename);
27779 test_xmlFileRead(void) {
27784 void * context; /* the I/O context */
27786 char * buffer; /* where to drop data */
27788 int len; /* number of bytes to write */
27791 for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
27792 for (n_buffer = 0;n_buffer < gen_nb_char_ptr;n_buffer++) {
27793 for (n_len = 0;n_len < gen_nb_int;n_len++) {
27794 mem_base = xmlMemBlocks();
27795 context = gen_void_ptr(n_context, 0);
27796 buffer = gen_char_ptr(n_buffer, 1);
27797 len = gen_int(n_len, 2);
27799 ret_val = xmlFileRead(context, buffer, len);
27800 desret_int(ret_val);
27802 des_void_ptr(n_context, context, 0);
27803 des_char_ptr(n_buffer, buffer, 1);
27804 des_int(n_len, len, 2);
27805 xmlResetLastError();
27806 if (mem_base != xmlMemBlocks()) {
27807 printf("Leak of %d blocks found in xmlFileRead",
27808 xmlMemBlocks() - mem_base);
27810 printf(" %d", n_context);
27811 printf(" %d", n_buffer);
27812 printf(" %d", n_len);
27825 test_xmlIOFTPClose(void) {
27828 #if defined(LIBXML_FTP_ENABLED)
27831 void * context; /* the I/O context */
27834 for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
27835 mem_base = xmlMemBlocks();
27836 context = gen_void_ptr(n_context, 0);
27838 ret_val = xmlIOFTPClose(context);
27839 desret_int(ret_val);
27841 des_void_ptr(n_context, context, 0);
27842 xmlResetLastError();
27843 if (mem_base != xmlMemBlocks()) {
27844 printf("Leak of %d blocks found in xmlIOFTPClose",
27845 xmlMemBlocks() - mem_base);
27847 printf(" %d", n_context);
27859 test_xmlIOFTPMatch(void) {
27862 #if defined(LIBXML_FTP_ENABLED)
27865 const char * filename; /* the URI for matching */
27868 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
27869 mem_base = xmlMemBlocks();
27870 filename = gen_filepath(n_filename, 0);
27872 ret_val = xmlIOFTPMatch(filename);
27873 desret_int(ret_val);
27875 des_filepath(n_filename, filename, 0);
27876 xmlResetLastError();
27877 if (mem_base != xmlMemBlocks()) {
27878 printf("Leak of %d blocks found in xmlIOFTPMatch",
27879 xmlMemBlocks() - mem_base);
27881 printf(" %d", n_filename);
27893 test_xmlIOFTPOpen(void) {
27896 #if defined(LIBXML_FTP_ENABLED)
27899 const char * filename; /* the URI for matching */
27902 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
27903 mem_base = xmlMemBlocks();
27904 filename = gen_filepath(n_filename, 0);
27906 ret_val = xmlIOFTPOpen(filename);
27907 desret_void_ptr(ret_val);
27909 des_filepath(n_filename, filename, 0);
27910 xmlResetLastError();
27911 if (mem_base != xmlMemBlocks()) {
27912 printf("Leak of %d blocks found in xmlIOFTPOpen",
27913 xmlMemBlocks() - mem_base);
27915 printf(" %d", n_filename);
27927 test_xmlIOFTPRead(void) {
27930 #if defined(LIBXML_FTP_ENABLED)
27933 void * context; /* the I/O context */
27935 char * buffer; /* where to drop data */
27937 int len; /* number of bytes to write */
27940 for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
27941 for (n_buffer = 0;n_buffer < gen_nb_char_ptr;n_buffer++) {
27942 for (n_len = 0;n_len < gen_nb_int;n_len++) {
27943 mem_base = xmlMemBlocks();
27944 context = gen_void_ptr(n_context, 0);
27945 buffer = gen_char_ptr(n_buffer, 1);
27946 len = gen_int(n_len, 2);
27948 ret_val = xmlIOFTPRead(context, buffer, len);
27949 desret_int(ret_val);
27951 des_void_ptr(n_context, context, 0);
27952 des_char_ptr(n_buffer, buffer, 1);
27953 des_int(n_len, len, 2);
27954 xmlResetLastError();
27955 if (mem_base != xmlMemBlocks()) {
27956 printf("Leak of %d blocks found in xmlIOFTPRead",
27957 xmlMemBlocks() - mem_base);
27959 printf(" %d", n_context);
27960 printf(" %d", n_buffer);
27961 printf(" %d", n_len);
27975 test_xmlIOHTTPClose(void) {
27978 #if defined(LIBXML_HTTP_ENABLED)
27981 void * context; /* the I/O context */
27984 for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
27985 mem_base = xmlMemBlocks();
27986 context = gen_void_ptr(n_context, 0);
27988 ret_val = xmlIOHTTPClose(context);
27989 desret_int(ret_val);
27991 des_void_ptr(n_context, context, 0);
27992 xmlResetLastError();
27993 if (mem_base != xmlMemBlocks()) {
27994 printf("Leak of %d blocks found in xmlIOHTTPClose",
27995 xmlMemBlocks() - mem_base);
27997 printf(" %d", n_context);
28009 test_xmlIOHTTPMatch(void) {
28012 #if defined(LIBXML_HTTP_ENABLED)
28015 const char * filename; /* the URI for matching */
28018 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
28019 mem_base = xmlMemBlocks();
28020 filename = gen_filepath(n_filename, 0);
28022 ret_val = xmlIOHTTPMatch(filename);
28023 desret_int(ret_val);
28025 des_filepath(n_filename, filename, 0);
28026 xmlResetLastError();
28027 if (mem_base != xmlMemBlocks()) {
28028 printf("Leak of %d blocks found in xmlIOHTTPMatch",
28029 xmlMemBlocks() - mem_base);
28031 printf(" %d", n_filename);
28043 test_xmlIOHTTPOpen(void) {
28046 #if defined(LIBXML_HTTP_ENABLED)
28049 const char * filename; /* the URI for matching */
28052 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
28053 mem_base = xmlMemBlocks();
28054 filename = gen_filepath(n_filename, 0);
28056 ret_val = xmlIOHTTPOpen(filename);
28057 desret_xmlNanoHTTPCtxtPtr(ret_val);
28059 des_filepath(n_filename, filename, 0);
28060 xmlResetLastError();
28061 if (mem_base != xmlMemBlocks()) {
28062 printf("Leak of %d blocks found in xmlIOHTTPOpen",
28063 xmlMemBlocks() - mem_base);
28065 printf(" %d", n_filename);
28077 test_xmlIOHTTPRead(void) {
28080 #if defined(LIBXML_HTTP_ENABLED)
28083 void * context; /* the I/O context */
28085 char * buffer; /* where to drop data */
28087 int len; /* number of bytes to write */
28090 for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
28091 for (n_buffer = 0;n_buffer < gen_nb_char_ptr;n_buffer++) {
28092 for (n_len = 0;n_len < gen_nb_int;n_len++) {
28093 mem_base = xmlMemBlocks();
28094 context = gen_void_ptr(n_context, 0);
28095 buffer = gen_char_ptr(n_buffer, 1);
28096 len = gen_int(n_len, 2);
28098 ret_val = xmlIOHTTPRead(context, buffer, len);
28099 desret_int(ret_val);
28101 des_void_ptr(n_context, context, 0);
28102 des_char_ptr(n_buffer, buffer, 1);
28103 des_int(n_len, len, 2);
28104 xmlResetLastError();
28105 if (mem_base != xmlMemBlocks()) {
28106 printf("Leak of %d blocks found in xmlIOHTTPRead",
28107 xmlMemBlocks() - mem_base);
28109 printf(" %d", n_context);
28110 printf(" %d", n_buffer);
28111 printf(" %d", n_len);
28125 test_xmlNoNetExternalEntityLoader(void) {
28129 xmlParserInputPtr ret_val;
28130 const char * URL; /* the URL for the entity to load */
28132 char * ID; /* the System ID for the entity to load */
28134 xmlParserCtxtPtr ctxt; /* the context in which the entity is called or NULL */
28137 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
28138 for (n_ID = 0;n_ID < gen_nb_const_char_ptr;n_ID++) {
28139 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
28140 mem_base = xmlMemBlocks();
28141 URL = gen_filepath(n_URL, 0);
28142 ID = gen_const_char_ptr(n_ID, 1);
28143 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 2);
28145 ret_val = xmlNoNetExternalEntityLoader(URL, (const char *)ID, ctxt);
28146 desret_xmlParserInputPtr(ret_val);
28148 des_filepath(n_URL, URL, 0);
28149 des_const_char_ptr(n_ID, (const char *)ID, 1);
28150 des_xmlParserCtxtPtr(n_ctxt, ctxt, 2);
28151 xmlResetLastError();
28152 if (mem_base != xmlMemBlocks()) {
28153 printf("Leak of %d blocks found in xmlNoNetExternalEntityLoader",
28154 xmlMemBlocks() - mem_base);
28156 printf(" %d", n_URL);
28157 printf(" %d", n_ID);
28158 printf(" %d", n_ctxt);
28171 test_xmlNormalizeWindowsPath(void) {
28176 xmlChar * path; /* the input file path */
28179 for (n_path = 0;n_path < gen_nb_const_xmlChar_ptr;n_path++) {
28180 mem_base = xmlMemBlocks();
28181 path = gen_const_xmlChar_ptr(n_path, 0);
28183 ret_val = xmlNormalizeWindowsPath((const xmlChar *)path);
28184 desret_xmlChar_ptr(ret_val);
28186 des_const_xmlChar_ptr(n_path, (const xmlChar *)path, 0);
28187 xmlResetLastError();
28188 if (mem_base != xmlMemBlocks()) {
28189 printf("Leak of %d blocks found in xmlNormalizeWindowsPath",
28190 xmlMemBlocks() - mem_base);
28192 printf(" %d", n_path);
28203 test_xmlOutputBufferCreateBuffer(void) {
28206 #if defined(LIBXML_OUTPUT_ENABLED)
28208 xmlOutputBufferPtr ret_val;
28209 xmlBufferPtr buffer; /* a xmlBufferPtr */
28211 xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
28214 for (n_buffer = 0;n_buffer < gen_nb_xmlBufferPtr;n_buffer++) {
28215 for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
28216 mem_base = xmlMemBlocks();
28217 buffer = gen_xmlBufferPtr(n_buffer, 0);
28218 encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 1);
28220 ret_val = xmlOutputBufferCreateBuffer(buffer, encoder);
28221 desret_xmlOutputBufferPtr(ret_val);
28223 des_xmlBufferPtr(n_buffer, buffer, 0);
28224 des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 1);
28225 xmlResetLastError();
28226 if (mem_base != xmlMemBlocks()) {
28227 printf("Leak of %d blocks found in xmlOutputBufferCreateBuffer",
28228 xmlMemBlocks() - mem_base);
28230 printf(" %d", n_buffer);
28231 printf(" %d", n_encoder);
28244 test_xmlOutputBufferCreateFd(void) {
28247 #if defined(LIBXML_OUTPUT_ENABLED)
28249 xmlOutputBufferPtr ret_val;
28250 int fd; /* a file descriptor number */
28252 xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
28255 for (n_fd = 0;n_fd < gen_nb_int;n_fd++) {
28256 for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
28257 mem_base = xmlMemBlocks();
28258 fd = gen_int(n_fd, 0);
28259 encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 1);
28261 ret_val = xmlOutputBufferCreateFd(fd, encoder);
28262 desret_xmlOutputBufferPtr(ret_val);
28264 des_int(n_fd, fd, 0);
28265 des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 1);
28266 xmlResetLastError();
28267 if (mem_base != xmlMemBlocks()) {
28268 printf("Leak of %d blocks found in xmlOutputBufferCreateFd",
28269 xmlMemBlocks() - mem_base);
28271 printf(" %d", n_fd);
28272 printf(" %d", n_encoder);
28285 test_xmlOutputBufferCreateFile(void) {
28288 #if defined(LIBXML_OUTPUT_ENABLED)
28290 xmlOutputBufferPtr ret_val;
28291 FILE * file; /* a FILE* */
28293 xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
28296 for (n_file = 0;n_file < gen_nb_FILE_ptr;n_file++) {
28297 for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
28298 mem_base = xmlMemBlocks();
28299 file = gen_FILE_ptr(n_file, 0);
28300 encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 1);
28302 ret_val = xmlOutputBufferCreateFile(file, encoder);
28303 desret_xmlOutputBufferPtr(ret_val);
28305 des_FILE_ptr(n_file, file, 0);
28306 des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 1);
28307 xmlResetLastError();
28308 if (mem_base != xmlMemBlocks()) {
28309 printf("Leak of %d blocks found in xmlOutputBufferCreateFile",
28310 xmlMemBlocks() - mem_base);
28312 printf(" %d", n_file);
28313 printf(" %d", n_encoder);
28326 test_xmlOutputBufferCreateFilename(void) {
28329 #if defined(LIBXML_OUTPUT_ENABLED)
28331 xmlOutputBufferPtr ret_val;
28332 const char * URI; /* a C string containing the URI or filename */
28334 xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
28336 int compression; /* the compression ration (0 none, 9 max). */
28339 for (n_URI = 0;n_URI < gen_nb_fileoutput;n_URI++) {
28340 for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
28341 for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
28342 mem_base = xmlMemBlocks();
28343 URI = gen_fileoutput(n_URI, 0);
28344 encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 1);
28345 compression = gen_int(n_compression, 2);
28347 ret_val = xmlOutputBufferCreateFilename(URI, encoder, compression);
28348 desret_xmlOutputBufferPtr(ret_val);
28350 des_fileoutput(n_URI, URI, 0);
28351 des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 1);
28352 des_int(n_compression, compression, 2);
28353 xmlResetLastError();
28354 if (mem_base != xmlMemBlocks()) {
28355 printf("Leak of %d blocks found in xmlOutputBufferCreateFilename",
28356 xmlMemBlocks() - mem_base);
28358 printf(" %d", n_URI);
28359 printf(" %d", n_encoder);
28360 printf(" %d", n_compression);
28374 test_xmlOutputBufferFlush(void) {
28377 #if defined(LIBXML_OUTPUT_ENABLED)
28380 xmlOutputBufferPtr out; /* a buffered output */
28383 for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
28384 mem_base = xmlMemBlocks();
28385 out = gen_xmlOutputBufferPtr(n_out, 0);
28387 ret_val = xmlOutputBufferFlush(out);
28388 desret_int(ret_val);
28390 des_xmlOutputBufferPtr(n_out, out, 0);
28391 xmlResetLastError();
28392 if (mem_base != xmlMemBlocks()) {
28393 printf("Leak of %d blocks found in xmlOutputBufferFlush",
28394 xmlMemBlocks() - mem_base);
28396 printf(" %d", n_out);
28408 test_xmlOutputBufferWrite(void) {
28411 #if defined(LIBXML_OUTPUT_ENABLED)
28414 xmlOutputBufferPtr out; /* a buffered parser output */
28416 int len; /* the size in bytes of the array. */
28418 char * buf; /* an char array */
28421 for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
28422 for (n_len = 0;n_len < gen_nb_int;n_len++) {
28423 for (n_buf = 0;n_buf < gen_nb_const_char_ptr;n_buf++) {
28424 mem_base = xmlMemBlocks();
28425 out = gen_xmlOutputBufferPtr(n_out, 0);
28426 len = gen_int(n_len, 1);
28427 buf = gen_const_char_ptr(n_buf, 2);
28429 ret_val = xmlOutputBufferWrite(out, len, (const char *)buf);
28430 desret_int(ret_val);
28432 des_xmlOutputBufferPtr(n_out, out, 0);
28433 des_int(n_len, len, 1);
28434 des_const_char_ptr(n_buf, (const char *)buf, 2);
28435 xmlResetLastError();
28436 if (mem_base != xmlMemBlocks()) {
28437 printf("Leak of %d blocks found in xmlOutputBufferWrite",
28438 xmlMemBlocks() - mem_base);
28440 printf(" %d", n_out);
28441 printf(" %d", n_len);
28442 printf(" %d", n_buf);
28456 test_xmlOutputBufferWriteEscape(void) {
28460 /* missing type support */
28466 test_xmlOutputBufferWriteString(void) {
28469 #if defined(LIBXML_OUTPUT_ENABLED)
28472 xmlOutputBufferPtr out; /* a buffered parser output */
28474 char * str; /* a zero terminated C string */
28477 for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
28478 for (n_str = 0;n_str < gen_nb_const_char_ptr;n_str++) {
28479 mem_base = xmlMemBlocks();
28480 out = gen_xmlOutputBufferPtr(n_out, 0);
28481 str = gen_const_char_ptr(n_str, 1);
28483 ret_val = xmlOutputBufferWriteString(out, (const char *)str);
28484 desret_int(ret_val);
28486 des_xmlOutputBufferPtr(n_out, out, 0);
28487 des_const_char_ptr(n_str, (const char *)str, 1);
28488 xmlResetLastError();
28489 if (mem_base != xmlMemBlocks()) {
28490 printf("Leak of %d blocks found in xmlOutputBufferWriteString",
28491 xmlMemBlocks() - mem_base);
28493 printf(" %d", n_out);
28494 printf(" %d", n_str);
28507 test_xmlParserGetDirectory(void) {
28511 /* missing type support */
28517 test_xmlParserInputBufferCreateFd(void) {
28521 xmlParserInputBufferPtr ret_val;
28522 int fd; /* a file descriptor number */
28524 xmlCharEncoding enc; /* the charset encoding if known */
28527 for (n_fd = 0;n_fd < gen_nb_int;n_fd++) {
28528 for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
28529 mem_base = xmlMemBlocks();
28530 fd = gen_int(n_fd, 0);
28531 enc = gen_xmlCharEncoding(n_enc, 1);
28532 if (fd >= 0) fd = -1;
28534 ret_val = xmlParserInputBufferCreateFd(fd, enc);
28535 desret_xmlParserInputBufferPtr(ret_val);
28537 des_int(n_fd, fd, 0);
28538 des_xmlCharEncoding(n_enc, enc, 1);
28539 xmlResetLastError();
28540 if (mem_base != xmlMemBlocks()) {
28541 printf("Leak of %d blocks found in xmlParserInputBufferCreateFd",
28542 xmlMemBlocks() - mem_base);
28544 printf(" %d", n_fd);
28545 printf(" %d", n_enc);
28557 test_xmlParserInputBufferCreateFile(void) {
28561 xmlParserInputBufferPtr ret_val;
28562 FILE * file; /* a FILE* */
28564 xmlCharEncoding enc; /* the charset encoding if known */
28567 for (n_file = 0;n_file < gen_nb_FILE_ptr;n_file++) {
28568 for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
28569 mem_base = xmlMemBlocks();
28570 file = gen_FILE_ptr(n_file, 0);
28571 enc = gen_xmlCharEncoding(n_enc, 1);
28573 ret_val = xmlParserInputBufferCreateFile(file, enc);
28574 desret_xmlParserInputBufferPtr(ret_val);
28576 des_FILE_ptr(n_file, file, 0);
28577 des_xmlCharEncoding(n_enc, enc, 1);
28578 xmlResetLastError();
28579 if (mem_base != xmlMemBlocks()) {
28580 printf("Leak of %d blocks found in xmlParserInputBufferCreateFile",
28581 xmlMemBlocks() - mem_base);
28583 printf(" %d", n_file);
28584 printf(" %d", n_enc);
28596 test_xmlParserInputBufferCreateFilename(void) {
28600 xmlParserInputBufferPtr ret_val;
28601 const char * URI; /* a C string containing the URI or filename */
28603 xmlCharEncoding enc; /* the charset encoding if known */
28606 for (n_URI = 0;n_URI < gen_nb_fileoutput;n_URI++) {
28607 for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
28608 mem_base = xmlMemBlocks();
28609 URI = gen_fileoutput(n_URI, 0);
28610 enc = gen_xmlCharEncoding(n_enc, 1);
28612 ret_val = xmlParserInputBufferCreateFilename(URI, enc);
28613 desret_xmlParserInputBufferPtr(ret_val);
28615 des_fileoutput(n_URI, URI, 0);
28616 des_xmlCharEncoding(n_enc, enc, 1);
28617 xmlResetLastError();
28618 if (mem_base != xmlMemBlocks()) {
28619 printf("Leak of %d blocks found in xmlParserInputBufferCreateFilename",
28620 xmlMemBlocks() - mem_base);
28622 printf(" %d", n_URI);
28623 printf(" %d", n_enc);
28635 test_xmlParserInputBufferCreateMem(void) {
28639 xmlParserInputBufferPtr ret_val;
28640 char * mem; /* the memory input */
28642 int size; /* the length of the memory block */
28644 xmlCharEncoding enc; /* the charset encoding if known */
28647 for (n_mem = 0;n_mem < gen_nb_const_char_ptr;n_mem++) {
28648 for (n_size = 0;n_size < gen_nb_int;n_size++) {
28649 for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
28650 mem_base = xmlMemBlocks();
28651 mem = gen_const_char_ptr(n_mem, 0);
28652 size = gen_int(n_size, 1);
28653 enc = gen_xmlCharEncoding(n_enc, 2);
28655 ret_val = xmlParserInputBufferCreateMem((const char *)mem, size, enc);
28656 desret_xmlParserInputBufferPtr(ret_val);
28658 des_const_char_ptr(n_mem, (const char *)mem, 0);
28659 des_int(n_size, size, 1);
28660 des_xmlCharEncoding(n_enc, enc, 2);
28661 xmlResetLastError();
28662 if (mem_base != xmlMemBlocks()) {
28663 printf("Leak of %d blocks found in xmlParserInputBufferCreateMem",
28664 xmlMemBlocks() - mem_base);
28666 printf(" %d", n_mem);
28667 printf(" %d", n_size);
28668 printf(" %d", n_enc);
28681 test_xmlParserInputBufferCreateStatic(void) {
28685 xmlParserInputBufferPtr ret_val;
28686 char * mem; /* the memory input */
28688 int size; /* the length of the memory block */
28690 xmlCharEncoding enc; /* the charset encoding if known */
28693 for (n_mem = 0;n_mem < gen_nb_const_char_ptr;n_mem++) {
28694 for (n_size = 0;n_size < gen_nb_int;n_size++) {
28695 for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
28696 mem_base = xmlMemBlocks();
28697 mem = gen_const_char_ptr(n_mem, 0);
28698 size = gen_int(n_size, 1);
28699 enc = gen_xmlCharEncoding(n_enc, 2);
28701 ret_val = xmlParserInputBufferCreateStatic((const char *)mem, size, enc);
28702 desret_xmlParserInputBufferPtr(ret_val);
28704 des_const_char_ptr(n_mem, (const char *)mem, 0);
28705 des_int(n_size, size, 1);
28706 des_xmlCharEncoding(n_enc, enc, 2);
28707 xmlResetLastError();
28708 if (mem_base != xmlMemBlocks()) {
28709 printf("Leak of %d blocks found in xmlParserInputBufferCreateStatic",
28710 xmlMemBlocks() - mem_base);
28712 printf(" %d", n_mem);
28713 printf(" %d", n_size);
28714 printf(" %d", n_enc);
28727 test_xmlParserInputBufferGrow(void) {
28732 xmlParserInputBufferPtr in; /* a buffered parser input */
28734 int len; /* indicative value of the amount of chars to read */
28737 for (n_in = 0;n_in < gen_nb_xmlParserInputBufferPtr;n_in++) {
28738 for (n_len = 0;n_len < gen_nb_int;n_len++) {
28739 mem_base = xmlMemBlocks();
28740 in = gen_xmlParserInputBufferPtr(n_in, 0);
28741 len = gen_int(n_len, 1);
28743 ret_val = xmlParserInputBufferGrow(in, len);
28744 desret_int(ret_val);
28746 des_xmlParserInputBufferPtr(n_in, in, 0);
28747 des_int(n_len, len, 1);
28748 xmlResetLastError();
28749 if (mem_base != xmlMemBlocks()) {
28750 printf("Leak of %d blocks found in xmlParserInputBufferGrow",
28751 xmlMemBlocks() - mem_base);
28753 printf(" %d", n_in);
28754 printf(" %d", n_len);
28766 test_xmlParserInputBufferPush(void) {
28771 xmlParserInputBufferPtr in; /* a buffered parser input */
28773 int len; /* the size in bytes of the array. */
28775 char * buf; /* an char array */
28778 for (n_in = 0;n_in < gen_nb_xmlParserInputBufferPtr;n_in++) {
28779 for (n_len = 0;n_len < gen_nb_int;n_len++) {
28780 for (n_buf = 0;n_buf < gen_nb_const_char_ptr;n_buf++) {
28781 mem_base = xmlMemBlocks();
28782 in = gen_xmlParserInputBufferPtr(n_in, 0);
28783 len = gen_int(n_len, 1);
28784 buf = gen_const_char_ptr(n_buf, 2);
28786 ret_val = xmlParserInputBufferPush(in, len, (const char *)buf);
28787 desret_int(ret_val);
28789 des_xmlParserInputBufferPtr(n_in, in, 0);
28790 des_int(n_len, len, 1);
28791 des_const_char_ptr(n_buf, (const char *)buf, 2);
28792 xmlResetLastError();
28793 if (mem_base != xmlMemBlocks()) {
28794 printf("Leak of %d blocks found in xmlParserInputBufferPush",
28795 xmlMemBlocks() - mem_base);
28797 printf(" %d", n_in);
28798 printf(" %d", n_len);
28799 printf(" %d", n_buf);
28812 test_xmlParserInputBufferRead(void) {
28817 xmlParserInputBufferPtr in; /* a buffered parser input */
28819 int len; /* indicative value of the amount of chars to read */
28822 for (n_in = 0;n_in < gen_nb_xmlParserInputBufferPtr;n_in++) {
28823 for (n_len = 0;n_len < gen_nb_int;n_len++) {
28824 mem_base = xmlMemBlocks();
28825 in = gen_xmlParserInputBufferPtr(n_in, 0);
28826 len = gen_int(n_len, 1);
28828 ret_val = xmlParserInputBufferRead(in, len);
28829 desret_int(ret_val);
28831 des_xmlParserInputBufferPtr(n_in, in, 0);
28832 des_int(n_len, len, 1);
28833 xmlResetLastError();
28834 if (mem_base != xmlMemBlocks()) {
28835 printf("Leak of %d blocks found in xmlParserInputBufferRead",
28836 xmlMemBlocks() - mem_base);
28838 printf(" %d", n_in);
28839 printf(" %d", n_len);
28851 test_xmlPopInputCallbacks(void) {
28857 mem_base = xmlMemBlocks();
28859 ret_val = xmlPopInputCallbacks();
28860 desret_int(ret_val);
28862 xmlResetLastError();
28863 if (mem_base != xmlMemBlocks()) {
28864 printf("Leak of %d blocks found in xmlPopInputCallbacks",
28865 xmlMemBlocks() - mem_base);
28876 test_xmlRegisterDefaultInputCallbacks(void) {
28881 mem_base = xmlMemBlocks();
28883 xmlRegisterDefaultInputCallbacks();
28885 xmlResetLastError();
28886 if (mem_base != xmlMemBlocks()) {
28887 printf("Leak of %d blocks found in xmlRegisterDefaultInputCallbacks",
28888 xmlMemBlocks() - mem_base);
28899 test_xmlRegisterDefaultOutputCallbacks(void) {
28902 #if defined(LIBXML_OUTPUT_ENABLED)
28905 mem_base = xmlMemBlocks();
28907 xmlRegisterDefaultOutputCallbacks();
28909 xmlResetLastError();
28910 if (mem_base != xmlMemBlocks()) {
28911 printf("Leak of %d blocks found in xmlRegisterDefaultOutputCallbacks",
28912 xmlMemBlocks() - mem_base);
28924 test_xmlRegisterHTTPPostCallbacks(void) {
28927 #if defined(LIBXML_OUTPUT_ENABLED) && defined(LIBXML_HTTP_ENABLED)
28930 mem_base = xmlMemBlocks();
28932 xmlRegisterHTTPPostCallbacks();
28934 xmlResetLastError();
28935 if (mem_base != xmlMemBlocks()) {
28936 printf("Leak of %d blocks found in xmlRegisterHTTPPostCallbacks",
28937 xmlMemBlocks() - mem_base);
28951 if (quiet == 0) printf("Testing xmlIO : 39 of 48 functions ...\n");
28952 test_ret += test_xmlAllocOutputBuffer();
28953 test_ret += test_xmlAllocParserInputBuffer();
28954 test_ret += test_xmlCheckFilename();
28955 test_ret += test_xmlCheckHTTPInput();
28956 test_ret += test_xmlCleanupInputCallbacks();
28957 test_ret += test_xmlCleanupOutputCallbacks();
28958 test_ret += test_xmlFileClose();
28959 test_ret += test_xmlFileMatch();
28960 test_ret += test_xmlFileOpen();
28961 test_ret += test_xmlFileRead();
28962 test_ret += test_xmlIOFTPClose();
28963 test_ret += test_xmlIOFTPMatch();
28964 test_ret += test_xmlIOFTPOpen();
28965 test_ret += test_xmlIOFTPRead();
28966 test_ret += test_xmlIOHTTPClose();
28967 test_ret += test_xmlIOHTTPMatch();
28968 test_ret += test_xmlIOHTTPOpen();
28969 test_ret += test_xmlIOHTTPRead();
28970 test_ret += test_xmlNoNetExternalEntityLoader();
28971 test_ret += test_xmlNormalizeWindowsPath();
28972 test_ret += test_xmlOutputBufferCreateBuffer();
28973 test_ret += test_xmlOutputBufferCreateFd();
28974 test_ret += test_xmlOutputBufferCreateFile();
28975 test_ret += test_xmlOutputBufferCreateFilename();
28976 test_ret += test_xmlOutputBufferFlush();
28977 test_ret += test_xmlOutputBufferWrite();
28978 test_ret += test_xmlOutputBufferWriteEscape();
28979 test_ret += test_xmlOutputBufferWriteString();
28980 test_ret += test_xmlParserGetDirectory();
28981 test_ret += test_xmlParserInputBufferCreateFd();
28982 test_ret += test_xmlParserInputBufferCreateFile();
28983 test_ret += test_xmlParserInputBufferCreateFilename();
28984 test_ret += test_xmlParserInputBufferCreateMem();
28985 test_ret += test_xmlParserInputBufferCreateStatic();
28986 test_ret += test_xmlParserInputBufferGrow();
28987 test_ret += test_xmlParserInputBufferPush();
28988 test_ret += test_xmlParserInputBufferRead();
28989 test_ret += test_xmlPopInputCallbacks();
28990 test_ret += test_xmlRegisterDefaultInputCallbacks();
28991 test_ret += test_xmlRegisterDefaultOutputCallbacks();
28992 test_ret += test_xmlRegisterHTTPPostCallbacks();
28995 printf("Module xmlIO: %d errors\n", test_ret);
28998 #ifdef LIBXML_AUTOMATA_ENABLED
29000 #define gen_nb_xmlAutomataPtr 1
29001 static xmlAutomataPtr gen_xmlAutomataPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29004 static void des_xmlAutomataPtr(int no ATTRIBUTE_UNUSED, xmlAutomataPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29010 test_xmlAutomataCompile(void) {
29014 /* missing type support */
29020 test_xmlAutomataGetInitState(void) {
29024 /* missing type support */
29030 test_xmlAutomataIsDeterminist(void) {
29033 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_AUTOMATA_ENABLED)
29036 xmlAutomataPtr am; /* an automata */
29039 for (n_am = 0;n_am < gen_nb_xmlAutomataPtr;n_am++) {
29040 mem_base = xmlMemBlocks();
29041 am = gen_xmlAutomataPtr(n_am, 0);
29043 ret_val = xmlAutomataIsDeterminist(am);
29044 desret_int(ret_val);
29046 des_xmlAutomataPtr(n_am, am, 0);
29047 xmlResetLastError();
29048 if (mem_base != xmlMemBlocks()) {
29049 printf("Leak of %d blocks found in xmlAutomataIsDeterminist",
29050 xmlMemBlocks() - mem_base);
29052 printf(" %d", n_am);
29062 #ifdef LIBXML_AUTOMATA_ENABLED
29064 #define gen_nb_xmlAutomataStatePtr 1
29065 static xmlAutomataStatePtr gen_xmlAutomataStatePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29068 static void des_xmlAutomataStatePtr(int no ATTRIBUTE_UNUSED, xmlAutomataStatePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29074 test_xmlAutomataNewAllTrans(void) {
29078 /* missing type support */
29084 test_xmlAutomataNewCountTrans(void) {
29088 /* missing type support */
29094 test_xmlAutomataNewCountTrans2(void) {
29098 /* missing type support */
29104 test_xmlAutomataNewCountedTrans(void) {
29108 /* missing type support */
29114 test_xmlAutomataNewCounter(void) {
29117 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_AUTOMATA_ENABLED)
29120 xmlAutomataPtr am; /* an automata */
29122 int min; /* the minimal value on the counter */
29124 int max; /* the maximal value on the counter */
29127 for (n_am = 0;n_am < gen_nb_xmlAutomataPtr;n_am++) {
29128 for (n_min = 0;n_min < gen_nb_int;n_min++) {
29129 for (n_max = 0;n_max < gen_nb_int;n_max++) {
29130 mem_base = xmlMemBlocks();
29131 am = gen_xmlAutomataPtr(n_am, 0);
29132 min = gen_int(n_min, 1);
29133 max = gen_int(n_max, 2);
29135 ret_val = xmlAutomataNewCounter(am, min, max);
29136 desret_int(ret_val);
29138 des_xmlAutomataPtr(n_am, am, 0);
29139 des_int(n_min, min, 1);
29140 des_int(n_max, max, 2);
29141 xmlResetLastError();
29142 if (mem_base != xmlMemBlocks()) {
29143 printf("Leak of %d blocks found in xmlAutomataNewCounter",
29144 xmlMemBlocks() - mem_base);
29146 printf(" %d", n_am);
29147 printf(" %d", n_min);
29148 printf(" %d", n_max);
29162 test_xmlAutomataNewCounterTrans(void) {
29166 /* missing type support */
29172 test_xmlAutomataNewEpsilon(void) {
29176 /* missing type support */
29182 test_xmlAutomataNewNegTrans(void) {
29186 /* missing type support */
29192 test_xmlAutomataNewOnceTrans(void) {
29196 /* missing type support */
29202 test_xmlAutomataNewOnceTrans2(void) {
29206 /* missing type support */
29212 test_xmlAutomataNewState(void) {
29216 /* missing type support */
29222 test_xmlAutomataNewTransition(void) {
29226 /* missing type support */
29232 test_xmlAutomataNewTransition2(void) {
29236 /* missing type support */
29242 test_xmlAutomataSetFinalState(void) {
29245 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_AUTOMATA_ENABLED)
29248 xmlAutomataPtr am; /* an automata */
29250 xmlAutomataStatePtr state; /* a state in this automata */
29253 for (n_am = 0;n_am < gen_nb_xmlAutomataPtr;n_am++) {
29254 for (n_state = 0;n_state < gen_nb_xmlAutomataStatePtr;n_state++) {
29255 mem_base = xmlMemBlocks();
29256 am = gen_xmlAutomataPtr(n_am, 0);
29257 state = gen_xmlAutomataStatePtr(n_state, 1);
29259 ret_val = xmlAutomataSetFinalState(am, state);
29260 desret_int(ret_val);
29262 des_xmlAutomataPtr(n_am, am, 0);
29263 des_xmlAutomataStatePtr(n_state, state, 1);
29264 xmlResetLastError();
29265 if (mem_base != xmlMemBlocks()) {
29266 printf("Leak of %d blocks found in xmlAutomataSetFinalState",
29267 xmlMemBlocks() - mem_base);
29269 printf(" %d", n_am);
29270 printf(" %d", n_state);
29283 test_xmlNewAutomata(void) {
29287 /* missing type support */
29292 test_xmlautomata(void) {
29295 if (quiet == 0) printf("Testing xmlautomata : 3 of 19 functions ...\n");
29296 test_ret += test_xmlAutomataCompile();
29297 test_ret += test_xmlAutomataGetInitState();
29298 test_ret += test_xmlAutomataIsDeterminist();
29299 test_ret += test_xmlAutomataNewAllTrans();
29300 test_ret += test_xmlAutomataNewCountTrans();
29301 test_ret += test_xmlAutomataNewCountTrans2();
29302 test_ret += test_xmlAutomataNewCountedTrans();
29303 test_ret += test_xmlAutomataNewCounter();
29304 test_ret += test_xmlAutomataNewCounterTrans();
29305 test_ret += test_xmlAutomataNewEpsilon();
29306 test_ret += test_xmlAutomataNewNegTrans();
29307 test_ret += test_xmlAutomataNewOnceTrans();
29308 test_ret += test_xmlAutomataNewOnceTrans2();
29309 test_ret += test_xmlAutomataNewState();
29310 test_ret += test_xmlAutomataNewTransition();
29311 test_ret += test_xmlAutomataNewTransition2();
29312 test_ret += test_xmlAutomataSetFinalState();
29313 test_ret += test_xmlNewAutomata();
29316 printf("Module xmlautomata: %d errors\n", test_ret);
29320 #define gen_nb_xmlGenericErrorFunc_ptr 1
29321 static xmlGenericErrorFunc * gen_xmlGenericErrorFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29324 static void des_xmlGenericErrorFunc_ptr(int no ATTRIBUTE_UNUSED, xmlGenericErrorFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29328 test_initGenericErrorDefaultFunc(void) {
29332 xmlGenericErrorFunc * handler; /* the handler */
29335 for (n_handler = 0;n_handler < gen_nb_xmlGenericErrorFunc_ptr;n_handler++) {
29336 mem_base = xmlMemBlocks();
29337 handler = gen_xmlGenericErrorFunc_ptr(n_handler, 0);
29339 initGenericErrorDefaultFunc(handler);
29341 des_xmlGenericErrorFunc_ptr(n_handler, handler, 0);
29342 xmlResetLastError();
29343 if (mem_base != xmlMemBlocks()) {
29344 printf("Leak of %d blocks found in initGenericErrorDefaultFunc",
29345 xmlMemBlocks() - mem_base);
29347 printf(" %d", n_handler);
29357 #define gen_nb_xmlErrorPtr 1
29358 static xmlErrorPtr gen_xmlErrorPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29361 static void des_xmlErrorPtr(int no ATTRIBUTE_UNUSED, xmlErrorPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29365 test_xmlCopyError(void) {
29370 xmlErrorPtr from; /* a source error */
29372 xmlErrorPtr to; /* a target error */
29375 for (n_from = 0;n_from < gen_nb_xmlErrorPtr;n_from++) {
29376 for (n_to = 0;n_to < gen_nb_xmlErrorPtr;n_to++) {
29377 mem_base = xmlMemBlocks();
29378 from = gen_xmlErrorPtr(n_from, 0);
29379 to = gen_xmlErrorPtr(n_to, 1);
29381 ret_val = xmlCopyError(from, to);
29382 desret_int(ret_val);
29384 des_xmlErrorPtr(n_from, from, 0);
29385 des_xmlErrorPtr(n_to, to, 1);
29386 xmlResetLastError();
29387 if (mem_base != xmlMemBlocks()) {
29388 printf("Leak of %d blocks found in xmlCopyError",
29389 xmlMemBlocks() - mem_base);
29391 printf(" %d", n_from);
29392 printf(" %d", n_to);
29404 test_xmlCtxtGetLastError(void) {
29408 /* missing type support */
29414 test_xmlCtxtResetLastError(void) {
29418 void * ctx; /* an XML parser context */
29421 for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
29422 mem_base = xmlMemBlocks();
29423 ctx = gen_void_ptr(n_ctx, 0);
29425 xmlCtxtResetLastError(ctx);
29427 des_void_ptr(n_ctx, ctx, 0);
29428 xmlResetLastError();
29429 if (mem_base != xmlMemBlocks()) {
29430 printf("Leak of %d blocks found in xmlCtxtResetLastError",
29431 xmlMemBlocks() - mem_base);
29433 printf(" %d", n_ctx);
29444 test_xmlGetLastError(void) {
29448 /* missing type support */
29454 test_xmlParserError(void) {
29458 /* missing type support */
29464 test_xmlParserPrintFileContext(void) {
29468 xmlParserInputPtr input; /* an xmlParserInputPtr input */
29471 for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) {
29472 mem_base = xmlMemBlocks();
29473 input = gen_xmlParserInputPtr(n_input, 0);
29475 xmlParserPrintFileContext(input);
29477 des_xmlParserInputPtr(n_input, input, 0);
29478 xmlResetLastError();
29479 if (mem_base != xmlMemBlocks()) {
29480 printf("Leak of %d blocks found in xmlParserPrintFileContext",
29481 xmlMemBlocks() - mem_base);
29483 printf(" %d", n_input);
29494 test_xmlParserPrintFileInfo(void) {
29498 xmlParserInputPtr input; /* an xmlParserInputPtr input */
29501 for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) {
29502 mem_base = xmlMemBlocks();
29503 input = gen_xmlParserInputPtr(n_input, 0);
29505 xmlParserPrintFileInfo(input);
29507 des_xmlParserInputPtr(n_input, input, 0);
29508 xmlResetLastError();
29509 if (mem_base != xmlMemBlocks()) {
29510 printf("Leak of %d blocks found in xmlParserPrintFileInfo",
29511 xmlMemBlocks() - mem_base);
29513 printf(" %d", n_input);
29524 test_xmlParserValidityError(void) {
29528 /* missing type support */
29534 test_xmlParserValidityWarning(void) {
29538 /* missing type support */
29544 test_xmlParserWarning(void) {
29548 /* missing type support */
29554 test_xmlResetError(void) {
29558 xmlErrorPtr err; /* pointer to the error. */
29561 for (n_err = 0;n_err < gen_nb_xmlErrorPtr;n_err++) {
29562 mem_base = xmlMemBlocks();
29563 err = gen_xmlErrorPtr(n_err, 0);
29565 xmlResetError(err);
29567 des_xmlErrorPtr(n_err, err, 0);
29568 xmlResetLastError();
29569 if (mem_base != xmlMemBlocks()) {
29570 printf("Leak of %d blocks found in xmlResetError",
29571 xmlMemBlocks() - mem_base);
29573 printf(" %d", n_err);
29584 test_xmlResetLastError(void) {
29589 xmlResetLastError();
29591 xmlResetLastError();
29599 test_xmlSetGenericErrorFunc(void) {
29603 /* missing type support */
29609 test_xmlSetStructuredErrorFunc(void) {
29613 /* missing type support */
29618 test_xmlerror(void) {
29621 if (quiet == 0) printf("Testing xmlerror : 7 of 15 functions ...\n");
29622 test_ret += test_initGenericErrorDefaultFunc();
29623 test_ret += test_xmlCopyError();
29624 test_ret += test_xmlCtxtGetLastError();
29625 test_ret += test_xmlCtxtResetLastError();
29626 test_ret += test_xmlGetLastError();
29627 test_ret += test_xmlParserError();
29628 test_ret += test_xmlParserPrintFileContext();
29629 test_ret += test_xmlParserPrintFileInfo();
29630 test_ret += test_xmlParserValidityError();
29631 test_ret += test_xmlParserValidityWarning();
29632 test_ret += test_xmlParserWarning();
29633 test_ret += test_xmlResetError();
29634 test_ret += test_xmlResetLastError();
29635 test_ret += test_xmlSetGenericErrorFunc();
29636 test_ret += test_xmlSetStructuredErrorFunc();
29639 printf("Module xmlerror: %d errors\n", test_ret);
29642 #ifdef LIBXML_MODULES_ENABLED
29644 #define gen_nb_xmlModulePtr 1
29645 static xmlModulePtr gen_xmlModulePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29648 static void des_xmlModulePtr(int no ATTRIBUTE_UNUSED, xmlModulePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29654 test_xmlModuleClose(void) {
29657 #if defined(LIBXML_MODULES_ENABLED)
29660 xmlModulePtr module; /* the module handle */
29663 for (n_module = 0;n_module < gen_nb_xmlModulePtr;n_module++) {
29664 mem_base = xmlMemBlocks();
29665 module = gen_xmlModulePtr(n_module, 0);
29667 ret_val = xmlModuleClose(module);
29668 desret_int(ret_val);
29670 des_xmlModulePtr(n_module, module, 0);
29671 xmlResetLastError();
29672 if (mem_base != xmlMemBlocks()) {
29673 printf("Leak of %d blocks found in xmlModuleClose",
29674 xmlMemBlocks() - mem_base);
29676 printf(" %d", n_module);
29688 test_xmlModuleOpen(void) {
29692 /* missing type support */
29698 test_xmlModuleSymbol(void) {
29701 #if defined(LIBXML_MODULES_ENABLED)
29704 xmlModulePtr module; /* the module */
29706 char * name; /* the name of the symbol */
29708 void ** symbol; /* the resulting symbol address */
29711 for (n_module = 0;n_module < gen_nb_xmlModulePtr;n_module++) {
29712 for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
29713 for (n_symbol = 0;n_symbol < gen_nb_void_ptr_ptr;n_symbol++) {
29714 mem_base = xmlMemBlocks();
29715 module = gen_xmlModulePtr(n_module, 0);
29716 name = gen_const_char_ptr(n_name, 1);
29717 symbol = gen_void_ptr_ptr(n_symbol, 2);
29719 ret_val = xmlModuleSymbol(module, (const char *)name, symbol);
29720 desret_int(ret_val);
29722 des_xmlModulePtr(n_module, module, 0);
29723 des_const_char_ptr(n_name, (const char *)name, 1);
29724 des_void_ptr_ptr(n_symbol, symbol, 2);
29725 xmlResetLastError();
29726 if (mem_base != xmlMemBlocks()) {
29727 printf("Leak of %d blocks found in xmlModuleSymbol",
29728 xmlMemBlocks() - mem_base);
29730 printf(" %d", n_module);
29731 printf(" %d", n_name);
29732 printf(" %d", n_symbol);
29745 test_xmlmodule(void) {
29748 if (quiet == 0) printf("Testing xmlmodule : 2 of 4 functions ...\n");
29749 test_ret += test_xmlModuleClose();
29750 test_ret += test_xmlModuleOpen();
29751 test_ret += test_xmlModuleSymbol();
29754 printf("Module xmlmodule: %d errors\n", test_ret);
29759 test_xmlNewTextReader(void) {
29762 #if defined(LIBXML_READER_ENABLED)
29764 xmlTextReaderPtr ret_val;
29765 xmlParserInputBufferPtr input; /* the xmlParserInputBufferPtr used to read data */
29767 const char * URI; /* the URI information for the source if available */
29770 for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
29771 for (n_URI = 0;n_URI < gen_nb_filepath;n_URI++) {
29772 mem_base = xmlMemBlocks();
29773 input = gen_xmlParserInputBufferPtr(n_input, 0);
29774 URI = gen_filepath(n_URI, 1);
29776 ret_val = xmlNewTextReader(input, URI);
29777 desret_xmlTextReaderPtr(ret_val);
29779 des_xmlParserInputBufferPtr(n_input, input, 0);
29780 des_filepath(n_URI, URI, 1);
29781 xmlResetLastError();
29782 if (mem_base != xmlMemBlocks()) {
29783 printf("Leak of %d blocks found in xmlNewTextReader",
29784 xmlMemBlocks() - mem_base);
29786 printf(" %d", n_input);
29787 printf(" %d", n_URI);
29800 test_xmlNewTextReaderFilename(void) {
29803 #if defined(LIBXML_READER_ENABLED)
29805 xmlTextReaderPtr ret_val;
29806 const char * URI; /* the URI of the resource to process */
29809 for (n_URI = 0;n_URI < gen_nb_filepath;n_URI++) {
29810 mem_base = xmlMemBlocks();
29811 URI = gen_filepath(n_URI, 0);
29813 ret_val = xmlNewTextReaderFilename(URI);
29814 desret_xmlTextReaderPtr(ret_val);
29816 des_filepath(n_URI, URI, 0);
29817 xmlResetLastError();
29818 if (mem_base != xmlMemBlocks()) {
29819 printf("Leak of %d blocks found in xmlNewTextReaderFilename",
29820 xmlMemBlocks() - mem_base);
29822 printf(" %d", n_URI);
29834 test_xmlReaderForDoc(void) {
29837 #if defined(LIBXML_READER_ENABLED)
29839 xmlTextReaderPtr ret_val;
29840 xmlChar * cur; /* a pointer to a zero terminated string */
29842 const char * URL; /* the base URL to use for the document */
29844 char * encoding; /* the document encoding, or NULL */
29846 int options; /* a combination of xmlParserOption */
29849 for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
29850 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
29851 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
29852 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
29853 mem_base = xmlMemBlocks();
29854 cur = gen_const_xmlChar_ptr(n_cur, 0);
29855 URL = gen_filepath(n_URL, 1);
29856 encoding = gen_const_char_ptr(n_encoding, 2);
29857 options = gen_parseroptions(n_options, 3);
29859 ret_val = xmlReaderForDoc((const xmlChar *)cur, URL, (const char *)encoding, options);
29860 desret_xmlTextReaderPtr(ret_val);
29862 des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
29863 des_filepath(n_URL, URL, 1);
29864 des_const_char_ptr(n_encoding, (const char *)encoding, 2);
29865 des_parseroptions(n_options, options, 3);
29866 xmlResetLastError();
29867 if (mem_base != xmlMemBlocks()) {
29868 printf("Leak of %d blocks found in xmlReaderForDoc",
29869 xmlMemBlocks() - mem_base);
29871 printf(" %d", n_cur);
29872 printf(" %d", n_URL);
29873 printf(" %d", n_encoding);
29874 printf(" %d", n_options);
29889 test_xmlReaderForFile(void) {
29892 #if defined(LIBXML_READER_ENABLED)
29894 xmlTextReaderPtr ret_val;
29895 const char * filename; /* a file or URL */
29897 char * encoding; /* the document encoding, or NULL */
29899 int options; /* a combination of xmlParserOption */
29902 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
29903 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
29904 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
29905 mem_base = xmlMemBlocks();
29906 filename = gen_filepath(n_filename, 0);
29907 encoding = gen_const_char_ptr(n_encoding, 1);
29908 options = gen_parseroptions(n_options, 2);
29910 ret_val = xmlReaderForFile(filename, (const char *)encoding, options);
29911 desret_xmlTextReaderPtr(ret_val);
29913 des_filepath(n_filename, filename, 0);
29914 des_const_char_ptr(n_encoding, (const char *)encoding, 1);
29915 des_parseroptions(n_options, options, 2);
29916 xmlResetLastError();
29917 if (mem_base != xmlMemBlocks()) {
29918 printf("Leak of %d blocks found in xmlReaderForFile",
29919 xmlMemBlocks() - mem_base);
29921 printf(" %d", n_filename);
29922 printf(" %d", n_encoding);
29923 printf(" %d", n_options);
29937 test_xmlReaderForMemory(void) {
29940 #if defined(LIBXML_READER_ENABLED)
29942 xmlTextReaderPtr ret_val;
29943 char * buffer; /* a pointer to a char array */
29945 int size; /* the size of the array */
29947 const char * URL; /* the base URL to use for the document */
29949 char * encoding; /* the document encoding, or NULL */
29951 int options; /* a combination of xmlParserOption */
29954 for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
29955 for (n_size = 0;n_size < gen_nb_int;n_size++) {
29956 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
29957 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
29958 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
29959 mem_base = xmlMemBlocks();
29960 buffer = gen_const_char_ptr(n_buffer, 0);
29961 size = gen_int(n_size, 1);
29962 URL = gen_filepath(n_URL, 2);
29963 encoding = gen_const_char_ptr(n_encoding, 3);
29964 options = gen_parseroptions(n_options, 4);
29966 ret_val = xmlReaderForMemory((const char *)buffer, size, URL, (const char *)encoding, options);
29967 desret_xmlTextReaderPtr(ret_val);
29969 des_const_char_ptr(n_buffer, (const char *)buffer, 0);
29970 des_int(n_size, size, 1);
29971 des_filepath(n_URL, URL, 2);
29972 des_const_char_ptr(n_encoding, (const char *)encoding, 3);
29973 des_parseroptions(n_options, options, 4);
29974 xmlResetLastError();
29975 if (mem_base != xmlMemBlocks()) {
29976 printf("Leak of %d blocks found in xmlReaderForMemory",
29977 xmlMemBlocks() - mem_base);
29979 printf(" %d", n_buffer);
29980 printf(" %d", n_size);
29981 printf(" %d", n_URL);
29982 printf(" %d", n_encoding);
29983 printf(" %d", n_options);
29999 test_xmlReaderNewDoc(void) {
30002 #if defined(LIBXML_READER_ENABLED)
30005 xmlTextReaderPtr reader; /* an XML reader */
30007 xmlChar * cur; /* a pointer to a zero terminated string */
30009 const char * URL; /* the base URL to use for the document */
30011 char * encoding; /* the document encoding, or NULL */
30013 int options; /* a combination of xmlParserOption */
30016 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30017 for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
30018 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
30019 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
30020 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
30021 mem_base = xmlMemBlocks();
30022 reader = gen_xmlTextReaderPtr(n_reader, 0);
30023 cur = gen_const_xmlChar_ptr(n_cur, 1);
30024 URL = gen_filepath(n_URL, 2);
30025 encoding = gen_const_char_ptr(n_encoding, 3);
30026 options = gen_parseroptions(n_options, 4);
30028 ret_val = xmlReaderNewDoc(reader, (const xmlChar *)cur, URL, (const char *)encoding, options);
30029 desret_int(ret_val);
30031 des_xmlTextReaderPtr(n_reader, reader, 0);
30032 des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1);
30033 des_filepath(n_URL, URL, 2);
30034 des_const_char_ptr(n_encoding, (const char *)encoding, 3);
30035 des_parseroptions(n_options, options, 4);
30036 xmlResetLastError();
30037 if (mem_base != xmlMemBlocks()) {
30038 printf("Leak of %d blocks found in xmlReaderNewDoc",
30039 xmlMemBlocks() - mem_base);
30041 printf(" %d", n_reader);
30042 printf(" %d", n_cur);
30043 printf(" %d", n_URL);
30044 printf(" %d", n_encoding);
30045 printf(" %d", n_options);
30061 test_xmlReaderNewFile(void) {
30064 #if defined(LIBXML_READER_ENABLED)
30067 xmlTextReaderPtr reader; /* an XML reader */
30069 const char * filename; /* a file or URL */
30071 char * encoding; /* the document encoding, or NULL */
30073 int options; /* a combination of xmlParserOption */
30076 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30077 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
30078 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
30079 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
30080 mem_base = xmlMemBlocks();
30081 reader = gen_xmlTextReaderPtr(n_reader, 0);
30082 filename = gen_filepath(n_filename, 1);
30083 encoding = gen_const_char_ptr(n_encoding, 2);
30084 options = gen_parseroptions(n_options, 3);
30086 ret_val = xmlReaderNewFile(reader, filename, (const char *)encoding, options);
30087 desret_int(ret_val);
30089 des_xmlTextReaderPtr(n_reader, reader, 0);
30090 des_filepath(n_filename, filename, 1);
30091 des_const_char_ptr(n_encoding, (const char *)encoding, 2);
30092 des_parseroptions(n_options, options, 3);
30093 xmlResetLastError();
30094 if (mem_base != xmlMemBlocks()) {
30095 printf("Leak of %d blocks found in xmlReaderNewFile",
30096 xmlMemBlocks() - mem_base);
30098 printf(" %d", n_reader);
30099 printf(" %d", n_filename);
30100 printf(" %d", n_encoding);
30101 printf(" %d", n_options);
30116 test_xmlReaderNewMemory(void) {
30119 #if defined(LIBXML_READER_ENABLED)
30122 xmlTextReaderPtr reader; /* an XML reader */
30124 char * buffer; /* a pointer to a char array */
30126 int size; /* the size of the array */
30128 const char * URL; /* the base URL to use for the document */
30130 char * encoding; /* the document encoding, or NULL */
30132 int options; /* a combination of xmlParserOption */
30135 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30136 for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
30137 for (n_size = 0;n_size < gen_nb_int;n_size++) {
30138 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
30139 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
30140 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
30141 mem_base = xmlMemBlocks();
30142 reader = gen_xmlTextReaderPtr(n_reader, 0);
30143 buffer = gen_const_char_ptr(n_buffer, 1);
30144 size = gen_int(n_size, 2);
30145 URL = gen_filepath(n_URL, 3);
30146 encoding = gen_const_char_ptr(n_encoding, 4);
30147 options = gen_parseroptions(n_options, 5);
30149 ret_val = xmlReaderNewMemory(reader, (const char *)buffer, size, URL, (const char *)encoding, options);
30150 desret_int(ret_val);
30152 des_xmlTextReaderPtr(n_reader, reader, 0);
30153 des_const_char_ptr(n_buffer, (const char *)buffer, 1);
30154 des_int(n_size, size, 2);
30155 des_filepath(n_URL, URL, 3);
30156 des_const_char_ptr(n_encoding, (const char *)encoding, 4);
30157 des_parseroptions(n_options, options, 5);
30158 xmlResetLastError();
30159 if (mem_base != xmlMemBlocks()) {
30160 printf("Leak of %d blocks found in xmlReaderNewMemory",
30161 xmlMemBlocks() - mem_base);
30163 printf(" %d", n_reader);
30164 printf(" %d", n_buffer);
30165 printf(" %d", n_size);
30166 printf(" %d", n_URL);
30167 printf(" %d", n_encoding);
30168 printf(" %d", n_options);
30185 test_xmlReaderNewWalker(void) {
30188 #if defined(LIBXML_READER_ENABLED)
30191 xmlTextReaderPtr reader; /* an XML reader */
30193 xmlDocPtr doc; /* a preparsed document */
30196 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30197 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
30198 mem_base = xmlMemBlocks();
30199 reader = gen_xmlTextReaderPtr(n_reader, 0);
30200 doc = gen_xmlDocPtr(n_doc, 1);
30202 ret_val = xmlReaderNewWalker(reader, doc);
30203 desret_int(ret_val);
30205 des_xmlTextReaderPtr(n_reader, reader, 0);
30206 des_xmlDocPtr(n_doc, doc, 1);
30207 xmlResetLastError();
30208 if (mem_base != xmlMemBlocks()) {
30209 printf("Leak of %d blocks found in xmlReaderNewWalker",
30210 xmlMemBlocks() - mem_base);
30212 printf(" %d", n_reader);
30213 printf(" %d", n_doc);
30226 test_xmlReaderWalker(void) {
30229 #if defined(LIBXML_READER_ENABLED)
30231 xmlTextReaderPtr ret_val;
30232 xmlDocPtr doc; /* a preparsed document */
30235 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
30236 mem_base = xmlMemBlocks();
30237 doc = gen_xmlDocPtr(n_doc, 0);
30239 ret_val = xmlReaderWalker(doc);
30240 desret_xmlTextReaderPtr(ret_val);
30242 des_xmlDocPtr(n_doc, doc, 0);
30243 xmlResetLastError();
30244 if (mem_base != xmlMemBlocks()) {
30245 printf("Leak of %d blocks found in xmlReaderWalker",
30246 xmlMemBlocks() - mem_base);
30248 printf(" %d", n_doc);
30260 test_xmlTextReaderAttributeCount(void) {
30263 #if defined(LIBXML_READER_ENABLED)
30266 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30269 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30270 mem_base = xmlMemBlocks();
30271 reader = gen_xmlTextReaderPtr(n_reader, 0);
30273 ret_val = xmlTextReaderAttributeCount(reader);
30274 desret_int(ret_val);
30276 des_xmlTextReaderPtr(n_reader, reader, 0);
30277 xmlResetLastError();
30278 if (mem_base != xmlMemBlocks()) {
30279 printf("Leak of %d blocks found in xmlTextReaderAttributeCount",
30280 xmlMemBlocks() - mem_base);
30282 printf(" %d", n_reader);
30294 test_xmlTextReaderBaseUri(void) {
30297 #if defined(LIBXML_READER_ENABLED)
30300 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30303 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30304 mem_base = xmlMemBlocks();
30305 reader = gen_xmlTextReaderPtr(n_reader, 0);
30307 ret_val = xmlTextReaderBaseUri(reader);
30308 desret_xmlChar_ptr(ret_val);
30310 des_xmlTextReaderPtr(n_reader, reader, 0);
30311 xmlResetLastError();
30312 if (mem_base != xmlMemBlocks()) {
30313 printf("Leak of %d blocks found in xmlTextReaderBaseUri",
30314 xmlMemBlocks() - mem_base);
30316 printf(" %d", n_reader);
30328 test_xmlTextReaderByteConsumed(void) {
30331 #if defined(LIBXML_READER_ENABLED)
30334 xmlTextReaderPtr reader; /* an XML reader */
30337 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30338 mem_base = xmlMemBlocks();
30339 reader = gen_xmlTextReaderPtr(n_reader, 0);
30341 ret_val = xmlTextReaderByteConsumed(reader);
30342 desret_long(ret_val);
30344 des_xmlTextReaderPtr(n_reader, reader, 0);
30345 xmlResetLastError();
30346 if (mem_base != xmlMemBlocks()) {
30347 printf("Leak of %d blocks found in xmlTextReaderByteConsumed",
30348 xmlMemBlocks() - mem_base);
30350 printf(" %d", n_reader);
30362 test_xmlTextReaderClose(void) {
30365 #if defined(LIBXML_READER_ENABLED)
30368 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30371 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30372 mem_base = xmlMemBlocks();
30373 reader = gen_xmlTextReaderPtr(n_reader, 0);
30375 ret_val = xmlTextReaderClose(reader);
30376 desret_int(ret_val);
30378 des_xmlTextReaderPtr(n_reader, reader, 0);
30379 xmlResetLastError();
30380 if (mem_base != xmlMemBlocks()) {
30381 printf("Leak of %d blocks found in xmlTextReaderClose",
30382 xmlMemBlocks() - mem_base);
30384 printf(" %d", n_reader);
30396 test_xmlTextReaderConstBaseUri(void) {
30399 #if defined(LIBXML_READER_ENABLED)
30401 const xmlChar * ret_val;
30402 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30405 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30406 mem_base = xmlMemBlocks();
30407 reader = gen_xmlTextReaderPtr(n_reader, 0);
30409 ret_val = xmlTextReaderConstBaseUri(reader);
30410 desret_const_xmlChar_ptr(ret_val);
30412 des_xmlTextReaderPtr(n_reader, reader, 0);
30413 xmlResetLastError();
30414 if (mem_base != xmlMemBlocks()) {
30415 printf("Leak of %d blocks found in xmlTextReaderConstBaseUri",
30416 xmlMemBlocks() - mem_base);
30418 printf(" %d", n_reader);
30430 test_xmlTextReaderConstEncoding(void) {
30433 #if defined(LIBXML_READER_ENABLED)
30435 const xmlChar * ret_val;
30436 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30439 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30440 mem_base = xmlMemBlocks();
30441 reader = gen_xmlTextReaderPtr(n_reader, 0);
30443 ret_val = xmlTextReaderConstEncoding(reader);
30444 desret_const_xmlChar_ptr(ret_val);
30446 des_xmlTextReaderPtr(n_reader, reader, 0);
30447 xmlResetLastError();
30448 if (mem_base != xmlMemBlocks()) {
30449 printf("Leak of %d blocks found in xmlTextReaderConstEncoding",
30450 xmlMemBlocks() - mem_base);
30452 printf(" %d", n_reader);
30464 test_xmlTextReaderConstLocalName(void) {
30467 #if defined(LIBXML_READER_ENABLED)
30469 const xmlChar * ret_val;
30470 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30473 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30474 mem_base = xmlMemBlocks();
30475 reader = gen_xmlTextReaderPtr(n_reader, 0);
30477 ret_val = xmlTextReaderConstLocalName(reader);
30478 desret_const_xmlChar_ptr(ret_val);
30480 des_xmlTextReaderPtr(n_reader, reader, 0);
30481 xmlResetLastError();
30482 if (mem_base != xmlMemBlocks()) {
30483 printf("Leak of %d blocks found in xmlTextReaderConstLocalName",
30484 xmlMemBlocks() - mem_base);
30486 printf(" %d", n_reader);
30498 test_xmlTextReaderConstName(void) {
30501 #if defined(LIBXML_READER_ENABLED)
30503 const xmlChar * ret_val;
30504 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30507 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30508 mem_base = xmlMemBlocks();
30509 reader = gen_xmlTextReaderPtr(n_reader, 0);
30511 ret_val = xmlTextReaderConstName(reader);
30512 desret_const_xmlChar_ptr(ret_val);
30514 des_xmlTextReaderPtr(n_reader, reader, 0);
30515 xmlResetLastError();
30516 if (mem_base != xmlMemBlocks()) {
30517 printf("Leak of %d blocks found in xmlTextReaderConstName",
30518 xmlMemBlocks() - mem_base);
30520 printf(" %d", n_reader);
30532 test_xmlTextReaderConstNamespaceUri(void) {
30535 #if defined(LIBXML_READER_ENABLED)
30537 const xmlChar * ret_val;
30538 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30541 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30542 mem_base = xmlMemBlocks();
30543 reader = gen_xmlTextReaderPtr(n_reader, 0);
30545 ret_val = xmlTextReaderConstNamespaceUri(reader);
30546 desret_const_xmlChar_ptr(ret_val);
30548 des_xmlTextReaderPtr(n_reader, reader, 0);
30549 xmlResetLastError();
30550 if (mem_base != xmlMemBlocks()) {
30551 printf("Leak of %d blocks found in xmlTextReaderConstNamespaceUri",
30552 xmlMemBlocks() - mem_base);
30554 printf(" %d", n_reader);
30566 test_xmlTextReaderConstPrefix(void) {
30569 #if defined(LIBXML_READER_ENABLED)
30571 const xmlChar * ret_val;
30572 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30575 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30576 mem_base = xmlMemBlocks();
30577 reader = gen_xmlTextReaderPtr(n_reader, 0);
30579 ret_val = xmlTextReaderConstPrefix(reader);
30580 desret_const_xmlChar_ptr(ret_val);
30582 des_xmlTextReaderPtr(n_reader, reader, 0);
30583 xmlResetLastError();
30584 if (mem_base != xmlMemBlocks()) {
30585 printf("Leak of %d blocks found in xmlTextReaderConstPrefix",
30586 xmlMemBlocks() - mem_base);
30588 printf(" %d", n_reader);
30600 test_xmlTextReaderConstString(void) {
30603 #if defined(LIBXML_READER_ENABLED)
30605 const xmlChar * ret_val;
30606 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30608 xmlChar * str; /* the string to intern. */
30611 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30612 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
30613 mem_base = xmlMemBlocks();
30614 reader = gen_xmlTextReaderPtr(n_reader, 0);
30615 str = gen_const_xmlChar_ptr(n_str, 1);
30617 ret_val = xmlTextReaderConstString(reader, (const xmlChar *)str);
30618 desret_const_xmlChar_ptr(ret_val);
30620 des_xmlTextReaderPtr(n_reader, reader, 0);
30621 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
30622 xmlResetLastError();
30623 if (mem_base != xmlMemBlocks()) {
30624 printf("Leak of %d blocks found in xmlTextReaderConstString",
30625 xmlMemBlocks() - mem_base);
30627 printf(" %d", n_reader);
30628 printf(" %d", n_str);
30641 test_xmlTextReaderConstValue(void) {
30644 #if defined(LIBXML_READER_ENABLED)
30646 const xmlChar * ret_val;
30647 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30650 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30651 mem_base = xmlMemBlocks();
30652 reader = gen_xmlTextReaderPtr(n_reader, 0);
30654 ret_val = xmlTextReaderConstValue(reader);
30655 desret_const_xmlChar_ptr(ret_val);
30657 des_xmlTextReaderPtr(n_reader, reader, 0);
30658 xmlResetLastError();
30659 if (mem_base != xmlMemBlocks()) {
30660 printf("Leak of %d blocks found in xmlTextReaderConstValue",
30661 xmlMemBlocks() - mem_base);
30663 printf(" %d", n_reader);
30675 test_xmlTextReaderConstXmlLang(void) {
30678 #if defined(LIBXML_READER_ENABLED)
30680 const xmlChar * ret_val;
30681 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30684 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30685 mem_base = xmlMemBlocks();
30686 reader = gen_xmlTextReaderPtr(n_reader, 0);
30688 ret_val = xmlTextReaderConstXmlLang(reader);
30689 desret_const_xmlChar_ptr(ret_val);
30691 des_xmlTextReaderPtr(n_reader, reader, 0);
30692 xmlResetLastError();
30693 if (mem_base != xmlMemBlocks()) {
30694 printf("Leak of %d blocks found in xmlTextReaderConstXmlLang",
30695 xmlMemBlocks() - mem_base);
30697 printf(" %d", n_reader);
30709 test_xmlTextReaderConstXmlVersion(void) {
30712 #if defined(LIBXML_READER_ENABLED)
30714 const xmlChar * ret_val;
30715 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30718 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30719 mem_base = xmlMemBlocks();
30720 reader = gen_xmlTextReaderPtr(n_reader, 0);
30722 ret_val = xmlTextReaderConstXmlVersion(reader);
30723 desret_const_xmlChar_ptr(ret_val);
30725 des_xmlTextReaderPtr(n_reader, reader, 0);
30726 xmlResetLastError();
30727 if (mem_base != xmlMemBlocks()) {
30728 printf("Leak of %d blocks found in xmlTextReaderConstXmlVersion",
30729 xmlMemBlocks() - mem_base);
30731 printf(" %d", n_reader);
30743 test_xmlTextReaderCurrentDoc(void) {
30746 #if defined(LIBXML_READER_ENABLED)
30749 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30752 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30753 mem_base = xmlMemBlocks();
30754 reader = gen_xmlTextReaderPtr(n_reader, 0);
30756 ret_val = xmlTextReaderCurrentDoc(reader);
30757 desret_xmlDocPtr(ret_val);
30759 des_xmlTextReaderPtr(n_reader, reader, 0);
30760 xmlResetLastError();
30761 if (mem_base != xmlMemBlocks()) {
30762 printf("Leak of %d blocks found in xmlTextReaderCurrentDoc",
30763 xmlMemBlocks() - mem_base);
30765 printf(" %d", n_reader);
30777 test_xmlTextReaderCurrentNode(void) {
30780 #if defined(LIBXML_READER_ENABLED)
30782 xmlNodePtr ret_val;
30783 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30786 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30787 mem_base = xmlMemBlocks();
30788 reader = gen_xmlTextReaderPtr(n_reader, 0);
30790 ret_val = xmlTextReaderCurrentNode(reader);
30791 desret_xmlNodePtr(ret_val);
30793 des_xmlTextReaderPtr(n_reader, reader, 0);
30794 xmlResetLastError();
30795 if (mem_base != xmlMemBlocks()) {
30796 printf("Leak of %d blocks found in xmlTextReaderCurrentNode",
30797 xmlMemBlocks() - mem_base);
30799 printf(" %d", n_reader);
30811 test_xmlTextReaderDepth(void) {
30814 #if defined(LIBXML_READER_ENABLED)
30817 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30820 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30821 mem_base = xmlMemBlocks();
30822 reader = gen_xmlTextReaderPtr(n_reader, 0);
30824 ret_val = xmlTextReaderDepth(reader);
30825 desret_int(ret_val);
30827 des_xmlTextReaderPtr(n_reader, reader, 0);
30828 xmlResetLastError();
30829 if (mem_base != xmlMemBlocks()) {
30830 printf("Leak of %d blocks found in xmlTextReaderDepth",
30831 xmlMemBlocks() - mem_base);
30833 printf(" %d", n_reader);
30845 test_xmlTextReaderExpand(void) {
30848 #if defined(LIBXML_READER_ENABLED)
30850 xmlNodePtr ret_val;
30851 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30854 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30855 mem_base = xmlMemBlocks();
30856 reader = gen_xmlTextReaderPtr(n_reader, 0);
30858 ret_val = xmlTextReaderExpand(reader);
30859 desret_xmlNodePtr(ret_val);
30861 des_xmlTextReaderPtr(n_reader, reader, 0);
30862 xmlResetLastError();
30863 if (mem_base != xmlMemBlocks()) {
30864 printf("Leak of %d blocks found in xmlTextReaderExpand",
30865 xmlMemBlocks() - mem_base);
30867 printf(" %d", n_reader);
30879 test_xmlTextReaderGetAttribute(void) {
30882 #if defined(LIBXML_READER_ENABLED)
30885 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30887 xmlChar * name; /* the qualified name of the attribute. */
30890 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30891 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
30892 mem_base = xmlMemBlocks();
30893 reader = gen_xmlTextReaderPtr(n_reader, 0);
30894 name = gen_const_xmlChar_ptr(n_name, 1);
30896 ret_val = xmlTextReaderGetAttribute(reader, (const xmlChar *)name);
30897 desret_xmlChar_ptr(ret_val);
30899 des_xmlTextReaderPtr(n_reader, reader, 0);
30900 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
30901 xmlResetLastError();
30902 if (mem_base != xmlMemBlocks()) {
30903 printf("Leak of %d blocks found in xmlTextReaderGetAttribute",
30904 xmlMemBlocks() - mem_base);
30906 printf(" %d", n_reader);
30907 printf(" %d", n_name);
30920 test_xmlTextReaderGetAttributeNo(void) {
30923 #if defined(LIBXML_READER_ENABLED)
30926 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30928 int no; /* the zero-based index of the attribute relative to the containing element */
30931 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30932 for (n_no = 0;n_no < gen_nb_int;n_no++) {
30933 mem_base = xmlMemBlocks();
30934 reader = gen_xmlTextReaderPtr(n_reader, 0);
30935 no = gen_int(n_no, 1);
30937 ret_val = xmlTextReaderGetAttributeNo(reader, no);
30938 desret_xmlChar_ptr(ret_val);
30940 des_xmlTextReaderPtr(n_reader, reader, 0);
30941 des_int(n_no, no, 1);
30942 xmlResetLastError();
30943 if (mem_base != xmlMemBlocks()) {
30944 printf("Leak of %d blocks found in xmlTextReaderGetAttributeNo",
30945 xmlMemBlocks() - mem_base);
30947 printf(" %d", n_reader);
30948 printf(" %d", n_no);
30961 test_xmlTextReaderGetAttributeNs(void) {
30964 #if defined(LIBXML_READER_ENABLED)
30967 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30969 xmlChar * localName; /* the local name of the attribute. */
30971 xmlChar * namespaceURI; /* the namespace URI of the attribute. */
30972 int n_namespaceURI;
30974 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30975 for (n_localName = 0;n_localName < gen_nb_const_xmlChar_ptr;n_localName++) {
30976 for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
30977 mem_base = xmlMemBlocks();
30978 reader = gen_xmlTextReaderPtr(n_reader, 0);
30979 localName = gen_const_xmlChar_ptr(n_localName, 1);
30980 namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 2);
30982 ret_val = xmlTextReaderGetAttributeNs(reader, (const xmlChar *)localName, (const xmlChar *)namespaceURI);
30983 desret_xmlChar_ptr(ret_val);
30985 des_xmlTextReaderPtr(n_reader, reader, 0);
30986 des_const_xmlChar_ptr(n_localName, (const xmlChar *)localName, 1);
30987 des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 2);
30988 xmlResetLastError();
30989 if (mem_base != xmlMemBlocks()) {
30990 printf("Leak of %d blocks found in xmlTextReaderGetAttributeNs",
30991 xmlMemBlocks() - mem_base);
30993 printf(" %d", n_reader);
30994 printf(" %d", n_localName);
30995 printf(" %d", n_namespaceURI);
31007 #ifdef LIBXML_READER_ENABLED
31009 #define gen_nb_xmlTextReaderErrorFunc_ptr 1
31010 static xmlTextReaderErrorFunc * gen_xmlTextReaderErrorFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
31013 static void des_xmlTextReaderErrorFunc_ptr(int no ATTRIBUTE_UNUSED, xmlTextReaderErrorFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
31019 test_xmlTextReaderGetErrorHandler(void) {
31022 #if defined(LIBXML_READER_ENABLED)
31024 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31026 xmlTextReaderErrorFunc * f; /* the callback function or NULL is no callback has been registered */
31028 void ** arg; /* a user argument */
31031 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31032 for (n_f = 0;n_f < gen_nb_xmlTextReaderErrorFunc_ptr;n_f++) {
31033 for (n_arg = 0;n_arg < gen_nb_void_ptr_ptr;n_arg++) {
31034 mem_base = xmlMemBlocks();
31035 reader = gen_xmlTextReaderPtr(n_reader, 0);
31036 f = gen_xmlTextReaderErrorFunc_ptr(n_f, 1);
31037 arg = gen_void_ptr_ptr(n_arg, 2);
31039 xmlTextReaderGetErrorHandler(reader, f, arg);
31041 des_xmlTextReaderPtr(n_reader, reader, 0);
31042 des_xmlTextReaderErrorFunc_ptr(n_f, f, 1);
31043 des_void_ptr_ptr(n_arg, arg, 2);
31044 xmlResetLastError();
31045 if (mem_base != xmlMemBlocks()) {
31046 printf("Leak of %d blocks found in xmlTextReaderGetErrorHandler",
31047 xmlMemBlocks() - mem_base);
31049 printf(" %d", n_reader);
31050 printf(" %d", n_f);
31051 printf(" %d", n_arg);
31065 test_xmlTextReaderGetParserColumnNumber(void) {
31068 #if defined(LIBXML_READER_ENABLED)
31071 xmlTextReaderPtr reader; /* the user data (XML reader context) */
31074 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31075 mem_base = xmlMemBlocks();
31076 reader = gen_xmlTextReaderPtr(n_reader, 0);
31078 ret_val = xmlTextReaderGetParserColumnNumber(reader);
31079 desret_int(ret_val);
31081 des_xmlTextReaderPtr(n_reader, reader, 0);
31082 xmlResetLastError();
31083 if (mem_base != xmlMemBlocks()) {
31084 printf("Leak of %d blocks found in xmlTextReaderGetParserColumnNumber",
31085 xmlMemBlocks() - mem_base);
31087 printf(" %d", n_reader);
31099 test_xmlTextReaderGetParserLineNumber(void) {
31102 #if defined(LIBXML_READER_ENABLED)
31105 xmlTextReaderPtr reader; /* the user data (XML reader context) */
31108 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31109 mem_base = xmlMemBlocks();
31110 reader = gen_xmlTextReaderPtr(n_reader, 0);
31112 ret_val = xmlTextReaderGetParserLineNumber(reader);
31113 desret_int(ret_val);
31115 des_xmlTextReaderPtr(n_reader, reader, 0);
31116 xmlResetLastError();
31117 if (mem_base != xmlMemBlocks()) {
31118 printf("Leak of %d blocks found in xmlTextReaderGetParserLineNumber",
31119 xmlMemBlocks() - mem_base);
31121 printf(" %d", n_reader);
31133 test_xmlTextReaderGetParserProp(void) {
31136 #if defined(LIBXML_READER_ENABLED)
31139 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31141 int prop; /* the xmlParserProperties to get */
31144 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31145 for (n_prop = 0;n_prop < gen_nb_int;n_prop++) {
31146 mem_base = xmlMemBlocks();
31147 reader = gen_xmlTextReaderPtr(n_reader, 0);
31148 prop = gen_int(n_prop, 1);
31150 ret_val = xmlTextReaderGetParserProp(reader, prop);
31151 desret_int(ret_val);
31153 des_xmlTextReaderPtr(n_reader, reader, 0);
31154 des_int(n_prop, prop, 1);
31155 xmlResetLastError();
31156 if (mem_base != xmlMemBlocks()) {
31157 printf("Leak of %d blocks found in xmlTextReaderGetParserProp",
31158 xmlMemBlocks() - mem_base);
31160 printf(" %d", n_reader);
31161 printf(" %d", n_prop);
31174 test_xmlTextReaderGetRemainder(void) {
31177 #if defined(LIBXML_READER_ENABLED)
31179 xmlParserInputBufferPtr ret_val;
31180 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31183 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31184 mem_base = xmlMemBlocks();
31185 reader = gen_xmlTextReaderPtr(n_reader, 0);
31187 ret_val = xmlTextReaderGetRemainder(reader);
31188 desret_xmlParserInputBufferPtr(ret_val);
31190 des_xmlTextReaderPtr(n_reader, reader, 0);
31191 xmlResetLastError();
31192 if (mem_base != xmlMemBlocks()) {
31193 printf("Leak of %d blocks found in xmlTextReaderGetRemainder",
31194 xmlMemBlocks() - mem_base);
31196 printf(" %d", n_reader);
31208 test_xmlTextReaderHasAttributes(void) {
31211 #if defined(LIBXML_READER_ENABLED)
31214 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31217 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31218 mem_base = xmlMemBlocks();
31219 reader = gen_xmlTextReaderPtr(n_reader, 0);
31221 ret_val = xmlTextReaderHasAttributes(reader);
31222 desret_int(ret_val);
31224 des_xmlTextReaderPtr(n_reader, reader, 0);
31225 xmlResetLastError();
31226 if (mem_base != xmlMemBlocks()) {
31227 printf("Leak of %d blocks found in xmlTextReaderHasAttributes",
31228 xmlMemBlocks() - mem_base);
31230 printf(" %d", n_reader);
31242 test_xmlTextReaderHasValue(void) {
31245 #if defined(LIBXML_READER_ENABLED)
31248 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31251 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31252 mem_base = xmlMemBlocks();
31253 reader = gen_xmlTextReaderPtr(n_reader, 0);
31255 ret_val = xmlTextReaderHasValue(reader);
31256 desret_int(ret_val);
31258 des_xmlTextReaderPtr(n_reader, reader, 0);
31259 xmlResetLastError();
31260 if (mem_base != xmlMemBlocks()) {
31261 printf("Leak of %d blocks found in xmlTextReaderHasValue",
31262 xmlMemBlocks() - mem_base);
31264 printf(" %d", n_reader);
31276 test_xmlTextReaderIsDefault(void) {
31279 #if defined(LIBXML_READER_ENABLED)
31282 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31285 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31286 mem_base = xmlMemBlocks();
31287 reader = gen_xmlTextReaderPtr(n_reader, 0);
31289 ret_val = xmlTextReaderIsDefault(reader);
31290 desret_int(ret_val);
31292 des_xmlTextReaderPtr(n_reader, reader, 0);
31293 xmlResetLastError();
31294 if (mem_base != xmlMemBlocks()) {
31295 printf("Leak of %d blocks found in xmlTextReaderIsDefault",
31296 xmlMemBlocks() - mem_base);
31298 printf(" %d", n_reader);
31310 test_xmlTextReaderIsEmptyElement(void) {
31313 #if defined(LIBXML_READER_ENABLED)
31316 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31319 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31320 mem_base = xmlMemBlocks();
31321 reader = gen_xmlTextReaderPtr(n_reader, 0);
31323 ret_val = xmlTextReaderIsEmptyElement(reader);
31324 desret_int(ret_val);
31326 des_xmlTextReaderPtr(n_reader, reader, 0);
31327 xmlResetLastError();
31328 if (mem_base != xmlMemBlocks()) {
31329 printf("Leak of %d blocks found in xmlTextReaderIsEmptyElement",
31330 xmlMemBlocks() - mem_base);
31332 printf(" %d", n_reader);
31344 test_xmlTextReaderIsNamespaceDecl(void) {
31347 #if defined(LIBXML_READER_ENABLED)
31350 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31353 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31354 mem_base = xmlMemBlocks();
31355 reader = gen_xmlTextReaderPtr(n_reader, 0);
31357 ret_val = xmlTextReaderIsNamespaceDecl(reader);
31358 desret_int(ret_val);
31360 des_xmlTextReaderPtr(n_reader, reader, 0);
31361 xmlResetLastError();
31362 if (mem_base != xmlMemBlocks()) {
31363 printf("Leak of %d blocks found in xmlTextReaderIsNamespaceDecl",
31364 xmlMemBlocks() - mem_base);
31366 printf(" %d", n_reader);
31378 test_xmlTextReaderIsValid(void) {
31381 #if defined(LIBXML_READER_ENABLED)
31384 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31387 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31388 mem_base = xmlMemBlocks();
31389 reader = gen_xmlTextReaderPtr(n_reader, 0);
31391 ret_val = xmlTextReaderIsValid(reader);
31392 desret_int(ret_val);
31394 des_xmlTextReaderPtr(n_reader, reader, 0);
31395 xmlResetLastError();
31396 if (mem_base != xmlMemBlocks()) {
31397 printf("Leak of %d blocks found in xmlTextReaderIsValid",
31398 xmlMemBlocks() - mem_base);
31400 printf(" %d", n_reader);
31412 test_xmlTextReaderLocalName(void) {
31415 #if defined(LIBXML_READER_ENABLED)
31418 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31421 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31422 mem_base = xmlMemBlocks();
31423 reader = gen_xmlTextReaderPtr(n_reader, 0);
31425 ret_val = xmlTextReaderLocalName(reader);
31426 desret_xmlChar_ptr(ret_val);
31428 des_xmlTextReaderPtr(n_reader, reader, 0);
31429 xmlResetLastError();
31430 if (mem_base != xmlMemBlocks()) {
31431 printf("Leak of %d blocks found in xmlTextReaderLocalName",
31432 xmlMemBlocks() - mem_base);
31434 printf(" %d", n_reader);
31444 #ifdef LIBXML_READER_ENABLED
31446 #define gen_nb_xmlTextReaderLocatorPtr 1
31447 static xmlTextReaderLocatorPtr gen_xmlTextReaderLocatorPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
31450 static void des_xmlTextReaderLocatorPtr(int no ATTRIBUTE_UNUSED, xmlTextReaderLocatorPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
31456 test_xmlTextReaderLocatorBaseURI(void) {
31459 #if defined(LIBXML_READER_ENABLED)
31462 xmlTextReaderLocatorPtr locator; /* the xmlTextReaderLocatorPtr used */
31465 for (n_locator = 0;n_locator < gen_nb_xmlTextReaderLocatorPtr;n_locator++) {
31466 mem_base = xmlMemBlocks();
31467 locator = gen_xmlTextReaderLocatorPtr(n_locator, 0);
31469 ret_val = xmlTextReaderLocatorBaseURI(locator);
31470 desret_xmlChar_ptr(ret_val);
31472 des_xmlTextReaderLocatorPtr(n_locator, locator, 0);
31473 xmlResetLastError();
31474 if (mem_base != xmlMemBlocks()) {
31475 printf("Leak of %d blocks found in xmlTextReaderLocatorBaseURI",
31476 xmlMemBlocks() - mem_base);
31478 printf(" %d", n_locator);
31490 test_xmlTextReaderLocatorLineNumber(void) {
31493 #if defined(LIBXML_READER_ENABLED)
31496 xmlTextReaderLocatorPtr locator; /* the xmlTextReaderLocatorPtr used */
31499 for (n_locator = 0;n_locator < gen_nb_xmlTextReaderLocatorPtr;n_locator++) {
31500 mem_base = xmlMemBlocks();
31501 locator = gen_xmlTextReaderLocatorPtr(n_locator, 0);
31503 ret_val = xmlTextReaderLocatorLineNumber(locator);
31504 desret_int(ret_val);
31506 des_xmlTextReaderLocatorPtr(n_locator, locator, 0);
31507 xmlResetLastError();
31508 if (mem_base != xmlMemBlocks()) {
31509 printf("Leak of %d blocks found in xmlTextReaderLocatorLineNumber",
31510 xmlMemBlocks() - mem_base);
31512 printf(" %d", n_locator);
31524 test_xmlTextReaderLookupNamespace(void) {
31527 #if defined(LIBXML_READER_ENABLED)
31530 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31532 xmlChar * prefix; /* the prefix whose namespace URI is to be resolved. To return the default namespace, specify NULL */
31535 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31536 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
31537 mem_base = xmlMemBlocks();
31538 reader = gen_xmlTextReaderPtr(n_reader, 0);
31539 prefix = gen_const_xmlChar_ptr(n_prefix, 1);
31541 ret_val = xmlTextReaderLookupNamespace(reader, (const xmlChar *)prefix);
31542 desret_xmlChar_ptr(ret_val);
31544 des_xmlTextReaderPtr(n_reader, reader, 0);
31545 des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
31546 xmlResetLastError();
31547 if (mem_base != xmlMemBlocks()) {
31548 printf("Leak of %d blocks found in xmlTextReaderLookupNamespace",
31549 xmlMemBlocks() - mem_base);
31551 printf(" %d", n_reader);
31552 printf(" %d", n_prefix);
31565 test_xmlTextReaderMoveToAttribute(void) {
31568 #if defined(LIBXML_READER_ENABLED)
31571 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31573 xmlChar * name; /* the qualified name of the attribute. */
31576 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31577 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
31578 mem_base = xmlMemBlocks();
31579 reader = gen_xmlTextReaderPtr(n_reader, 0);
31580 name = gen_const_xmlChar_ptr(n_name, 1);
31582 ret_val = xmlTextReaderMoveToAttribute(reader, (const xmlChar *)name);
31583 desret_int(ret_val);
31585 des_xmlTextReaderPtr(n_reader, reader, 0);
31586 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
31587 xmlResetLastError();
31588 if (mem_base != xmlMemBlocks()) {
31589 printf("Leak of %d blocks found in xmlTextReaderMoveToAttribute",
31590 xmlMemBlocks() - mem_base);
31592 printf(" %d", n_reader);
31593 printf(" %d", n_name);
31606 test_xmlTextReaderMoveToAttributeNo(void) {
31609 #if defined(LIBXML_READER_ENABLED)
31612 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31614 int no; /* the zero-based index of the attribute relative to the containing element. */
31617 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31618 for (n_no = 0;n_no < gen_nb_int;n_no++) {
31619 mem_base = xmlMemBlocks();
31620 reader = gen_xmlTextReaderPtr(n_reader, 0);
31621 no = gen_int(n_no, 1);
31623 ret_val = xmlTextReaderMoveToAttributeNo(reader, no);
31624 desret_int(ret_val);
31626 des_xmlTextReaderPtr(n_reader, reader, 0);
31627 des_int(n_no, no, 1);
31628 xmlResetLastError();
31629 if (mem_base != xmlMemBlocks()) {
31630 printf("Leak of %d blocks found in xmlTextReaderMoveToAttributeNo",
31631 xmlMemBlocks() - mem_base);
31633 printf(" %d", n_reader);
31634 printf(" %d", n_no);
31647 test_xmlTextReaderMoveToAttributeNs(void) {
31650 #if defined(LIBXML_READER_ENABLED)
31653 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31655 xmlChar * localName; /* the local name of the attribute. */
31657 xmlChar * namespaceURI; /* the namespace URI of the attribute. */
31658 int n_namespaceURI;
31660 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31661 for (n_localName = 0;n_localName < gen_nb_const_xmlChar_ptr;n_localName++) {
31662 for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
31663 mem_base = xmlMemBlocks();
31664 reader = gen_xmlTextReaderPtr(n_reader, 0);
31665 localName = gen_const_xmlChar_ptr(n_localName, 1);
31666 namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 2);
31668 ret_val = xmlTextReaderMoveToAttributeNs(reader, (const xmlChar *)localName, (const xmlChar *)namespaceURI);
31669 desret_int(ret_val);
31671 des_xmlTextReaderPtr(n_reader, reader, 0);
31672 des_const_xmlChar_ptr(n_localName, (const xmlChar *)localName, 1);
31673 des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 2);
31674 xmlResetLastError();
31675 if (mem_base != xmlMemBlocks()) {
31676 printf("Leak of %d blocks found in xmlTextReaderMoveToAttributeNs",
31677 xmlMemBlocks() - mem_base);
31679 printf(" %d", n_reader);
31680 printf(" %d", n_localName);
31681 printf(" %d", n_namespaceURI);
31695 test_xmlTextReaderMoveToElement(void) {
31698 #if defined(LIBXML_READER_ENABLED)
31701 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31704 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31705 mem_base = xmlMemBlocks();
31706 reader = gen_xmlTextReaderPtr(n_reader, 0);
31708 ret_val = xmlTextReaderMoveToElement(reader);
31709 desret_int(ret_val);
31711 des_xmlTextReaderPtr(n_reader, reader, 0);
31712 xmlResetLastError();
31713 if (mem_base != xmlMemBlocks()) {
31714 printf("Leak of %d blocks found in xmlTextReaderMoveToElement",
31715 xmlMemBlocks() - mem_base);
31717 printf(" %d", n_reader);
31729 test_xmlTextReaderMoveToFirstAttribute(void) {
31732 #if defined(LIBXML_READER_ENABLED)
31735 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31738 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31739 mem_base = xmlMemBlocks();
31740 reader = gen_xmlTextReaderPtr(n_reader, 0);
31742 ret_val = xmlTextReaderMoveToFirstAttribute(reader);
31743 desret_int(ret_val);
31745 des_xmlTextReaderPtr(n_reader, reader, 0);
31746 xmlResetLastError();
31747 if (mem_base != xmlMemBlocks()) {
31748 printf("Leak of %d blocks found in xmlTextReaderMoveToFirstAttribute",
31749 xmlMemBlocks() - mem_base);
31751 printf(" %d", n_reader);
31763 test_xmlTextReaderMoveToNextAttribute(void) {
31766 #if defined(LIBXML_READER_ENABLED)
31769 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31772 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31773 mem_base = xmlMemBlocks();
31774 reader = gen_xmlTextReaderPtr(n_reader, 0);
31776 ret_val = xmlTextReaderMoveToNextAttribute(reader);
31777 desret_int(ret_val);
31779 des_xmlTextReaderPtr(n_reader, reader, 0);
31780 xmlResetLastError();
31781 if (mem_base != xmlMemBlocks()) {
31782 printf("Leak of %d blocks found in xmlTextReaderMoveToNextAttribute",
31783 xmlMemBlocks() - mem_base);
31785 printf(" %d", n_reader);
31797 test_xmlTextReaderName(void) {
31800 #if defined(LIBXML_READER_ENABLED)
31803 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31806 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31807 mem_base = xmlMemBlocks();
31808 reader = gen_xmlTextReaderPtr(n_reader, 0);
31810 ret_val = xmlTextReaderName(reader);
31811 desret_xmlChar_ptr(ret_val);
31813 des_xmlTextReaderPtr(n_reader, reader, 0);
31814 xmlResetLastError();
31815 if (mem_base != xmlMemBlocks()) {
31816 printf("Leak of %d blocks found in xmlTextReaderName",
31817 xmlMemBlocks() - mem_base);
31819 printf(" %d", n_reader);
31831 test_xmlTextReaderNamespaceUri(void) {
31834 #if defined(LIBXML_READER_ENABLED)
31837 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31840 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31841 mem_base = xmlMemBlocks();
31842 reader = gen_xmlTextReaderPtr(n_reader, 0);
31844 ret_val = xmlTextReaderNamespaceUri(reader);
31845 desret_xmlChar_ptr(ret_val);
31847 des_xmlTextReaderPtr(n_reader, reader, 0);
31848 xmlResetLastError();
31849 if (mem_base != xmlMemBlocks()) {
31850 printf("Leak of %d blocks found in xmlTextReaderNamespaceUri",
31851 xmlMemBlocks() - mem_base);
31853 printf(" %d", n_reader);
31865 test_xmlTextReaderNext(void) {
31868 #if defined(LIBXML_READER_ENABLED)
31871 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31874 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31875 mem_base = xmlMemBlocks();
31876 reader = gen_xmlTextReaderPtr(n_reader, 0);
31878 ret_val = xmlTextReaderNext(reader);
31879 desret_int(ret_val);
31881 des_xmlTextReaderPtr(n_reader, reader, 0);
31882 xmlResetLastError();
31883 if (mem_base != xmlMemBlocks()) {
31884 printf("Leak of %d blocks found in xmlTextReaderNext",
31885 xmlMemBlocks() - mem_base);
31887 printf(" %d", n_reader);
31899 test_xmlTextReaderNextSibling(void) {
31902 #if defined(LIBXML_READER_ENABLED)
31905 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31908 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31909 mem_base = xmlMemBlocks();
31910 reader = gen_xmlTextReaderPtr(n_reader, 0);
31912 ret_val = xmlTextReaderNextSibling(reader);
31913 desret_int(ret_val);
31915 des_xmlTextReaderPtr(n_reader, reader, 0);
31916 xmlResetLastError();
31917 if (mem_base != xmlMemBlocks()) {
31918 printf("Leak of %d blocks found in xmlTextReaderNextSibling",
31919 xmlMemBlocks() - mem_base);
31921 printf(" %d", n_reader);
31933 test_xmlTextReaderNodeType(void) {
31936 #if defined(LIBXML_READER_ENABLED)
31939 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31942 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31943 mem_base = xmlMemBlocks();
31944 reader = gen_xmlTextReaderPtr(n_reader, 0);
31946 ret_val = xmlTextReaderNodeType(reader);
31947 desret_int(ret_val);
31949 des_xmlTextReaderPtr(n_reader, reader, 0);
31950 xmlResetLastError();
31951 if (mem_base != xmlMemBlocks()) {
31952 printf("Leak of %d blocks found in xmlTextReaderNodeType",
31953 xmlMemBlocks() - mem_base);
31955 printf(" %d", n_reader);
31967 test_xmlTextReaderNormalization(void) {
31970 #if defined(LIBXML_READER_ENABLED)
31973 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31976 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31977 mem_base = xmlMemBlocks();
31978 reader = gen_xmlTextReaderPtr(n_reader, 0);
31980 ret_val = xmlTextReaderNormalization(reader);
31981 desret_int(ret_val);
31983 des_xmlTextReaderPtr(n_reader, reader, 0);
31984 xmlResetLastError();
31985 if (mem_base != xmlMemBlocks()) {
31986 printf("Leak of %d blocks found in xmlTextReaderNormalization",
31987 xmlMemBlocks() - mem_base);
31989 printf(" %d", n_reader);
32001 test_xmlTextReaderPrefix(void) {
32004 #if defined(LIBXML_READER_ENABLED)
32007 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32010 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32011 mem_base = xmlMemBlocks();
32012 reader = gen_xmlTextReaderPtr(n_reader, 0);
32014 ret_val = xmlTextReaderPrefix(reader);
32015 desret_xmlChar_ptr(ret_val);
32017 des_xmlTextReaderPtr(n_reader, reader, 0);
32018 xmlResetLastError();
32019 if (mem_base != xmlMemBlocks()) {
32020 printf("Leak of %d blocks found in xmlTextReaderPrefix",
32021 xmlMemBlocks() - mem_base);
32023 printf(" %d", n_reader);
32035 test_xmlTextReaderPreserve(void) {
32038 #if defined(LIBXML_READER_ENABLED)
32040 xmlNodePtr ret_val;
32041 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32044 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32045 mem_base = xmlMemBlocks();
32046 reader = gen_xmlTextReaderPtr(n_reader, 0);
32048 ret_val = xmlTextReaderPreserve(reader);
32049 desret_xmlNodePtr(ret_val);
32051 des_xmlTextReaderPtr(n_reader, reader, 0);
32052 xmlResetLastError();
32053 if (mem_base != xmlMemBlocks()) {
32054 printf("Leak of %d blocks found in xmlTextReaderPreserve",
32055 xmlMemBlocks() - mem_base);
32057 printf(" %d", n_reader);
32069 test_xmlTextReaderPreservePattern(void) {
32072 #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_PATTERN_ENABLED)
32073 #ifdef LIBXML_PATTERN_ENABLED
32076 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32078 xmlChar * pattern; /* an XPath subset pattern */
32080 xmlChar ** namespaces; /* the prefix definitions, array of [URI, prefix] or NULL */
32083 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32084 for (n_pattern = 0;n_pattern < gen_nb_const_xmlChar_ptr;n_pattern++) {
32085 for (n_namespaces = 0;n_namespaces < gen_nb_const_xmlChar_ptr_ptr;n_namespaces++) {
32086 mem_base = xmlMemBlocks();
32087 reader = gen_xmlTextReaderPtr(n_reader, 0);
32088 pattern = gen_const_xmlChar_ptr(n_pattern, 1);
32089 namespaces = gen_const_xmlChar_ptr_ptr(n_namespaces, 2);
32091 ret_val = xmlTextReaderPreservePattern(reader, (const xmlChar *)pattern, (const xmlChar **)namespaces);
32092 desret_int(ret_val);
32094 des_xmlTextReaderPtr(n_reader, reader, 0);
32095 des_const_xmlChar_ptr(n_pattern, (const xmlChar *)pattern, 1);
32096 des_const_xmlChar_ptr_ptr(n_namespaces, (const xmlChar **)namespaces, 2);
32097 xmlResetLastError();
32098 if (mem_base != xmlMemBlocks()) {
32099 printf("Leak of %d blocks found in xmlTextReaderPreservePattern",
32100 xmlMemBlocks() - mem_base);
32102 printf(" %d", n_reader);
32103 printf(" %d", n_pattern);
32104 printf(" %d", n_namespaces);
32119 test_xmlTextReaderQuoteChar(void) {
32122 #if defined(LIBXML_READER_ENABLED)
32125 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32128 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32129 mem_base = xmlMemBlocks();
32130 reader = gen_xmlTextReaderPtr(n_reader, 0);
32132 ret_val = xmlTextReaderQuoteChar(reader);
32133 desret_int(ret_val);
32135 des_xmlTextReaderPtr(n_reader, reader, 0);
32136 xmlResetLastError();
32137 if (mem_base != xmlMemBlocks()) {
32138 printf("Leak of %d blocks found in xmlTextReaderQuoteChar",
32139 xmlMemBlocks() - mem_base);
32141 printf(" %d", n_reader);
32153 test_xmlTextReaderRead(void) {
32156 #if defined(LIBXML_READER_ENABLED)
32159 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32162 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32163 mem_base = xmlMemBlocks();
32164 reader = gen_xmlTextReaderPtr(n_reader, 0);
32166 ret_val = xmlTextReaderRead(reader);
32167 desret_int(ret_val);
32169 des_xmlTextReaderPtr(n_reader, reader, 0);
32170 xmlResetLastError();
32171 if (mem_base != xmlMemBlocks()) {
32172 printf("Leak of %d blocks found in xmlTextReaderRead",
32173 xmlMemBlocks() - mem_base);
32175 printf(" %d", n_reader);
32187 test_xmlTextReaderReadAttributeValue(void) {
32190 #if defined(LIBXML_READER_ENABLED)
32193 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32196 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32197 mem_base = xmlMemBlocks();
32198 reader = gen_xmlTextReaderPtr(n_reader, 0);
32200 ret_val = xmlTextReaderReadAttributeValue(reader);
32201 desret_int(ret_val);
32203 des_xmlTextReaderPtr(n_reader, reader, 0);
32204 xmlResetLastError();
32205 if (mem_base != xmlMemBlocks()) {
32206 printf("Leak of %d blocks found in xmlTextReaderReadAttributeValue",
32207 xmlMemBlocks() - mem_base);
32209 printf(" %d", n_reader);
32221 test_xmlTextReaderReadState(void) {
32224 #if defined(LIBXML_READER_ENABLED)
32227 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32230 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32231 mem_base = xmlMemBlocks();
32232 reader = gen_xmlTextReaderPtr(n_reader, 0);
32234 ret_val = xmlTextReaderReadState(reader);
32235 desret_int(ret_val);
32237 des_xmlTextReaderPtr(n_reader, reader, 0);
32238 xmlResetLastError();
32239 if (mem_base != xmlMemBlocks()) {
32240 printf("Leak of %d blocks found in xmlTextReaderReadState",
32241 xmlMemBlocks() - mem_base);
32243 printf(" %d", n_reader);
32255 test_xmlTextReaderRelaxNGSetSchema(void) {
32258 #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
32261 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32263 xmlRelaxNGPtr schema; /* a precompiled RelaxNG schema */
32266 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32267 for (n_schema = 0;n_schema < gen_nb_xmlRelaxNGPtr;n_schema++) {
32268 mem_base = xmlMemBlocks();
32269 reader = gen_xmlTextReaderPtr(n_reader, 0);
32270 schema = gen_xmlRelaxNGPtr(n_schema, 1);
32272 ret_val = xmlTextReaderRelaxNGSetSchema(reader, schema);
32273 desret_int(ret_val);
32275 des_xmlTextReaderPtr(n_reader, reader, 0);
32276 des_xmlRelaxNGPtr(n_schema, schema, 1);
32277 xmlResetLastError();
32278 if (mem_base != xmlMemBlocks()) {
32279 printf("Leak of %d blocks found in xmlTextReaderRelaxNGSetSchema",
32280 xmlMemBlocks() - mem_base);
32282 printf(" %d", n_reader);
32283 printf(" %d", n_schema);
32296 test_xmlTextReaderRelaxNGValidate(void) {
32299 #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
32302 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32304 char * rng; /* the path to a RelaxNG schema or NULL */
32307 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32308 for (n_rng = 0;n_rng < gen_nb_const_char_ptr;n_rng++) {
32309 mem_base = xmlMemBlocks();
32310 reader = gen_xmlTextReaderPtr(n_reader, 0);
32311 rng = gen_const_char_ptr(n_rng, 1);
32313 ret_val = xmlTextReaderRelaxNGValidate(reader, (const char *)rng);
32314 desret_int(ret_val);
32316 des_xmlTextReaderPtr(n_reader, reader, 0);
32317 des_const_char_ptr(n_rng, (const char *)rng, 1);
32318 xmlResetLastError();
32319 if (mem_base != xmlMemBlocks()) {
32320 printf("Leak of %d blocks found in xmlTextReaderRelaxNGValidate",
32321 xmlMemBlocks() - mem_base);
32323 printf(" %d", n_reader);
32324 printf(" %d", n_rng);
32337 test_xmlTextReaderRelaxNGValidateCtxt(void) {
32340 #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
32343 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32345 xmlRelaxNGValidCtxtPtr ctxt; /* the RelaxNG schema validation context or NULL */
32347 int options; /* options (not used yet) */
32350 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32351 for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
32352 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
32353 mem_base = xmlMemBlocks();
32354 reader = gen_xmlTextReaderPtr(n_reader, 0);
32355 ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 1);
32356 options = gen_parseroptions(n_options, 2);
32358 ret_val = xmlTextReaderRelaxNGValidateCtxt(reader, ctxt, options);
32359 desret_int(ret_val);
32361 des_xmlTextReaderPtr(n_reader, reader, 0);
32362 des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 1);
32363 des_parseroptions(n_options, options, 2);
32364 xmlResetLastError();
32365 if (mem_base != xmlMemBlocks()) {
32366 printf("Leak of %d blocks found in xmlTextReaderRelaxNGValidateCtxt",
32367 xmlMemBlocks() - mem_base);
32369 printf(" %d", n_reader);
32370 printf(" %d", n_ctxt);
32371 printf(" %d", n_options);
32385 test_xmlTextReaderSchemaValidate(void) {
32388 #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
32390 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32392 char * xsd; /* the path to a W3C XSD schema or NULL */
32395 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32396 for (n_xsd = 0;n_xsd < gen_nb_const_char_ptr;n_xsd++) {
32397 reader = gen_xmlTextReaderPtr(n_reader, 0);
32398 xsd = gen_const_char_ptr(n_xsd, 1);
32400 ret_val = xmlTextReaderSchemaValidate(reader, (const char *)xsd);
32401 desret_int(ret_val);
32403 des_xmlTextReaderPtr(n_reader, reader, 0);
32404 des_const_char_ptr(n_xsd, (const char *)xsd, 1);
32405 xmlResetLastError();
32416 test_xmlTextReaderSchemaValidateCtxt(void) {
32419 #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
32422 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32424 xmlSchemaValidCtxtPtr ctxt; /* the XML Schema validation context or NULL */
32426 int options; /* options (not used yet) */
32429 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32430 for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
32431 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
32432 mem_base = xmlMemBlocks();
32433 reader = gen_xmlTextReaderPtr(n_reader, 0);
32434 ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 1);
32435 options = gen_parseroptions(n_options, 2);
32437 ret_val = xmlTextReaderSchemaValidateCtxt(reader, ctxt, options);
32438 desret_int(ret_val);
32440 des_xmlTextReaderPtr(n_reader, reader, 0);
32441 des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 1);
32442 des_parseroptions(n_options, options, 2);
32443 xmlResetLastError();
32444 if (mem_base != xmlMemBlocks()) {
32445 printf("Leak of %d blocks found in xmlTextReaderSchemaValidateCtxt",
32446 xmlMemBlocks() - mem_base);
32448 printf(" %d", n_reader);
32449 printf(" %d", n_ctxt);
32450 printf(" %d", n_options);
32464 test_xmlTextReaderSetErrorHandler(void) {
32468 /* missing type support */
32474 test_xmlTextReaderSetParserProp(void) {
32477 #if defined(LIBXML_READER_ENABLED)
32480 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32482 int prop; /* the xmlParserProperties to set */
32484 int value; /* usually 0 or 1 to (de)activate it */
32487 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32488 for (n_prop = 0;n_prop < gen_nb_int;n_prop++) {
32489 for (n_value = 0;n_value < gen_nb_int;n_value++) {
32490 mem_base = xmlMemBlocks();
32491 reader = gen_xmlTextReaderPtr(n_reader, 0);
32492 prop = gen_int(n_prop, 1);
32493 value = gen_int(n_value, 2);
32495 ret_val = xmlTextReaderSetParserProp(reader, prop, value);
32496 desret_int(ret_val);
32498 des_xmlTextReaderPtr(n_reader, reader, 0);
32499 des_int(n_prop, prop, 1);
32500 des_int(n_value, value, 2);
32501 xmlResetLastError();
32502 if (mem_base != xmlMemBlocks()) {
32503 printf("Leak of %d blocks found in xmlTextReaderSetParserProp",
32504 xmlMemBlocks() - mem_base);
32506 printf(" %d", n_reader);
32507 printf(" %d", n_prop);
32508 printf(" %d", n_value);
32522 test_xmlTextReaderSetSchema(void) {
32525 #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
32528 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32530 xmlSchemaPtr schema; /* a precompiled Schema schema */
32533 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32534 for (n_schema = 0;n_schema < gen_nb_xmlSchemaPtr;n_schema++) {
32535 mem_base = xmlMemBlocks();
32536 reader = gen_xmlTextReaderPtr(n_reader, 0);
32537 schema = gen_xmlSchemaPtr(n_schema, 1);
32539 ret_val = xmlTextReaderSetSchema(reader, schema);
32540 desret_int(ret_val);
32542 des_xmlTextReaderPtr(n_reader, reader, 0);
32543 des_xmlSchemaPtr(n_schema, schema, 1);
32544 xmlResetLastError();
32545 if (mem_base != xmlMemBlocks()) {
32546 printf("Leak of %d blocks found in xmlTextReaderSetSchema",
32547 xmlMemBlocks() - mem_base);
32549 printf(" %d", n_reader);
32550 printf(" %d", n_schema);
32563 test_xmlTextReaderSetStructuredErrorHandler(void) {
32567 /* missing type support */
32573 test_xmlTextReaderSetup(void) {
32576 #if defined(LIBXML_READER_ENABLED)
32579 xmlTextReaderPtr reader; /* an XML reader */
32581 xmlParserInputBufferPtr input; /* xmlParserInputBufferPtr used to feed the reader, will be destroyed with it. */
32583 const char * URL; /* the base URL to use for the document */
32585 char * encoding; /* the document encoding, or NULL */
32587 int options; /* a combination of xmlParserOption */
32590 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32591 for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
32592 for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
32593 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
32594 for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
32595 mem_base = xmlMemBlocks();
32596 reader = gen_xmlTextReaderPtr(n_reader, 0);
32597 input = gen_xmlParserInputBufferPtr(n_input, 1);
32598 URL = gen_filepath(n_URL, 2);
32599 encoding = gen_const_char_ptr(n_encoding, 3);
32600 options = gen_parseroptions(n_options, 4);
32602 ret_val = xmlTextReaderSetup(reader, input, URL, (const char *)encoding, options);
32603 desret_int(ret_val);
32605 des_xmlTextReaderPtr(n_reader, reader, 0);
32606 des_filepath(n_URL, URL, 2);
32607 des_const_char_ptr(n_encoding, (const char *)encoding, 3);
32608 des_parseroptions(n_options, options, 4);
32609 xmlResetLastError();
32610 if (mem_base != xmlMemBlocks()) {
32611 printf("Leak of %d blocks found in xmlTextReaderSetup",
32612 xmlMemBlocks() - mem_base);
32614 printf(" %d", n_reader);
32615 printf(" %d", n_input);
32616 printf(" %d", n_URL);
32617 printf(" %d", n_encoding);
32618 printf(" %d", n_options);
32634 test_xmlTextReaderStandalone(void) {
32637 #if defined(LIBXML_READER_ENABLED)
32640 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32643 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32644 mem_base = xmlMemBlocks();
32645 reader = gen_xmlTextReaderPtr(n_reader, 0);
32647 ret_val = xmlTextReaderStandalone(reader);
32648 desret_int(ret_val);
32650 des_xmlTextReaderPtr(n_reader, reader, 0);
32651 xmlResetLastError();
32652 if (mem_base != xmlMemBlocks()) {
32653 printf("Leak of %d blocks found in xmlTextReaderStandalone",
32654 xmlMemBlocks() - mem_base);
32656 printf(" %d", n_reader);
32668 test_xmlTextReaderValue(void) {
32671 #if defined(LIBXML_READER_ENABLED)
32674 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32677 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32678 mem_base = xmlMemBlocks();
32679 reader = gen_xmlTextReaderPtr(n_reader, 0);
32681 ret_val = xmlTextReaderValue(reader);
32682 desret_xmlChar_ptr(ret_val);
32684 des_xmlTextReaderPtr(n_reader, reader, 0);
32685 xmlResetLastError();
32686 if (mem_base != xmlMemBlocks()) {
32687 printf("Leak of %d blocks found in xmlTextReaderValue",
32688 xmlMemBlocks() - mem_base);
32690 printf(" %d", n_reader);
32702 test_xmlTextReaderXmlLang(void) {
32705 #if defined(LIBXML_READER_ENABLED)
32708 xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32711 for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32712 mem_base = xmlMemBlocks();
32713 reader = gen_xmlTextReaderPtr(n_reader, 0);
32715 ret_val = xmlTextReaderXmlLang(reader);
32716 desret_xmlChar_ptr(ret_val);
32718 des_xmlTextReaderPtr(n_reader, reader, 0);
32719 xmlResetLastError();
32720 if (mem_base != xmlMemBlocks()) {
32721 printf("Leak of %d blocks found in xmlTextReaderXmlLang",
32722 xmlMemBlocks() - mem_base);
32724 printf(" %d", n_reader);
32735 test_xmlreader(void) {
32738 if (quiet == 0) printf("Testing xmlreader : 76 of 86 functions ...\n");
32739 test_ret += test_xmlNewTextReader();
32740 test_ret += test_xmlNewTextReaderFilename();
32741 test_ret += test_xmlReaderForDoc();
32742 test_ret += test_xmlReaderForFile();
32743 test_ret += test_xmlReaderForMemory();
32744 test_ret += test_xmlReaderNewDoc();
32745 test_ret += test_xmlReaderNewFile();
32746 test_ret += test_xmlReaderNewMemory();
32747 test_ret += test_xmlReaderNewWalker();
32748 test_ret += test_xmlReaderWalker();
32749 test_ret += test_xmlTextReaderAttributeCount();
32750 test_ret += test_xmlTextReaderBaseUri();
32751 test_ret += test_xmlTextReaderByteConsumed();
32752 test_ret += test_xmlTextReaderClose();
32753 test_ret += test_xmlTextReaderConstBaseUri();
32754 test_ret += test_xmlTextReaderConstEncoding();
32755 test_ret += test_xmlTextReaderConstLocalName();
32756 test_ret += test_xmlTextReaderConstName();
32757 test_ret += test_xmlTextReaderConstNamespaceUri();
32758 test_ret += test_xmlTextReaderConstPrefix();
32759 test_ret += test_xmlTextReaderConstString();
32760 test_ret += test_xmlTextReaderConstValue();
32761 test_ret += test_xmlTextReaderConstXmlLang();
32762 test_ret += test_xmlTextReaderConstXmlVersion();
32763 test_ret += test_xmlTextReaderCurrentDoc();
32764 test_ret += test_xmlTextReaderCurrentNode();
32765 test_ret += test_xmlTextReaderDepth();
32766 test_ret += test_xmlTextReaderExpand();
32767 test_ret += test_xmlTextReaderGetAttribute();
32768 test_ret += test_xmlTextReaderGetAttributeNo();
32769 test_ret += test_xmlTextReaderGetAttributeNs();
32770 test_ret += test_xmlTextReaderGetErrorHandler();
32771 test_ret += test_xmlTextReaderGetParserColumnNumber();
32772 test_ret += test_xmlTextReaderGetParserLineNumber();
32773 test_ret += test_xmlTextReaderGetParserProp();
32774 test_ret += test_xmlTextReaderGetRemainder();
32775 test_ret += test_xmlTextReaderHasAttributes();
32776 test_ret += test_xmlTextReaderHasValue();
32777 test_ret += test_xmlTextReaderIsDefault();
32778 test_ret += test_xmlTextReaderIsEmptyElement();
32779 test_ret += test_xmlTextReaderIsNamespaceDecl();
32780 test_ret += test_xmlTextReaderIsValid();
32781 test_ret += test_xmlTextReaderLocalName();
32782 test_ret += test_xmlTextReaderLocatorBaseURI();
32783 test_ret += test_xmlTextReaderLocatorLineNumber();
32784 test_ret += test_xmlTextReaderLookupNamespace();
32785 test_ret += test_xmlTextReaderMoveToAttribute();
32786 test_ret += test_xmlTextReaderMoveToAttributeNo();
32787 test_ret += test_xmlTextReaderMoveToAttributeNs();
32788 test_ret += test_xmlTextReaderMoveToElement();
32789 test_ret += test_xmlTextReaderMoveToFirstAttribute();
32790 test_ret += test_xmlTextReaderMoveToNextAttribute();
32791 test_ret += test_xmlTextReaderName();
32792 test_ret += test_xmlTextReaderNamespaceUri();
32793 test_ret += test_xmlTextReaderNext();
32794 test_ret += test_xmlTextReaderNextSibling();
32795 test_ret += test_xmlTextReaderNodeType();
32796 test_ret += test_xmlTextReaderNormalization();
32797 test_ret += test_xmlTextReaderPrefix();
32798 test_ret += test_xmlTextReaderPreserve();
32799 test_ret += test_xmlTextReaderPreservePattern();
32800 test_ret += test_xmlTextReaderQuoteChar();
32801 test_ret += test_xmlTextReaderRead();
32802 test_ret += test_xmlTextReaderReadAttributeValue();
32803 test_ret += test_xmlTextReaderReadState();
32804 test_ret += test_xmlTextReaderRelaxNGSetSchema();
32805 test_ret += test_xmlTextReaderRelaxNGValidate();
32806 test_ret += test_xmlTextReaderRelaxNGValidateCtxt();
32807 test_ret += test_xmlTextReaderSchemaValidate();
32808 test_ret += test_xmlTextReaderSchemaValidateCtxt();
32809 test_ret += test_xmlTextReaderSetErrorHandler();
32810 test_ret += test_xmlTextReaderSetParserProp();
32811 test_ret += test_xmlTextReaderSetSchema();
32812 test_ret += test_xmlTextReaderSetStructuredErrorHandler();
32813 test_ret += test_xmlTextReaderSetup();
32814 test_ret += test_xmlTextReaderStandalone();
32815 test_ret += test_xmlTextReaderValue();
32816 test_ret += test_xmlTextReaderXmlLang();
32819 printf("Module xmlreader: %d errors\n", test_ret);
32824 test_xmlExpCtxtNbCons(void) {
32827 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
32830 xmlExpCtxtPtr ctxt; /* an expression context */
32833 for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
32834 mem_base = xmlMemBlocks();
32835 ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
32837 ret_val = xmlExpCtxtNbCons(ctxt);
32838 desret_int(ret_val);
32840 des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
32841 xmlResetLastError();
32842 if (mem_base != xmlMemBlocks()) {
32843 printf("Leak of %d blocks found in xmlExpCtxtNbCons",
32844 xmlMemBlocks() - mem_base);
32846 printf(" %d", n_ctxt);
32858 test_xmlExpCtxtNbNodes(void) {
32861 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
32864 xmlExpCtxtPtr ctxt; /* an expression context */
32867 for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
32868 mem_base = xmlMemBlocks();
32869 ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
32871 ret_val = xmlExpCtxtNbNodes(ctxt);
32872 desret_int(ret_val);
32874 des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
32875 xmlResetLastError();
32876 if (mem_base != xmlMemBlocks()) {
32877 printf("Leak of %d blocks found in xmlExpCtxtNbNodes",
32878 xmlMemBlocks() - mem_base);
32880 printf(" %d", n_ctxt);
32892 test_xmlExpDump(void) {
32895 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
32897 xmlBufferPtr buf; /* a buffer to receive the output */
32899 xmlExpNodePtr expr; /* the compiled expression */
32902 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
32903 for (n_expr = 0;n_expr < gen_nb_xmlExpNodePtr;n_expr++) {
32904 mem_base = xmlMemBlocks();
32905 buf = gen_xmlBufferPtr(n_buf, 0);
32906 expr = gen_xmlExpNodePtr(n_expr, 1);
32908 xmlExpDump(buf, expr);
32910 des_xmlBufferPtr(n_buf, buf, 0);
32911 des_xmlExpNodePtr(n_expr, expr, 1);
32912 xmlResetLastError();
32913 if (mem_base != xmlMemBlocks()) {
32914 printf("Leak of %d blocks found in xmlExpDump",
32915 xmlMemBlocks() - mem_base);
32917 printf(" %d", n_buf);
32918 printf(" %d", n_expr);
32931 test_xmlExpExpDerive(void) {
32935 /* missing type support */
32941 test_xmlExpGetLanguage(void) {
32944 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
32947 xmlExpCtxtPtr ctxt; /* the expression context */
32949 xmlExpNodePtr exp; /* the expression */
32951 xmlChar ** langList; /* where to store the tokens */
32953 int len; /* the allocated lenght of @list */
32956 for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
32957 for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
32958 for (n_langList = 0;n_langList < gen_nb_const_xmlChar_ptr_ptr;n_langList++) {
32959 for (n_len = 0;n_len < gen_nb_int;n_len++) {
32960 mem_base = xmlMemBlocks();
32961 ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
32962 exp = gen_xmlExpNodePtr(n_exp, 1);
32963 langList = gen_const_xmlChar_ptr_ptr(n_langList, 2);
32964 len = gen_int(n_len, 3);
32966 ret_val = xmlExpGetLanguage(ctxt, exp, (const xmlChar **)langList, len);
32967 desret_int(ret_val);
32969 des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
32970 des_xmlExpNodePtr(n_exp, exp, 1);
32971 des_const_xmlChar_ptr_ptr(n_langList, (const xmlChar **)langList, 2);
32972 des_int(n_len, len, 3);
32973 xmlResetLastError();
32974 if (mem_base != xmlMemBlocks()) {
32975 printf("Leak of %d blocks found in xmlExpGetLanguage",
32976 xmlMemBlocks() - mem_base);
32978 printf(" %d", n_ctxt);
32979 printf(" %d", n_exp);
32980 printf(" %d", n_langList);
32981 printf(" %d", n_len);
32996 test_xmlExpGetStart(void) {
32999 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
33002 xmlExpCtxtPtr ctxt; /* the expression context */
33004 xmlExpNodePtr exp; /* the expression */
33006 xmlChar ** tokList; /* where to store the tokens */
33008 int len; /* the allocated lenght of @list */
33011 for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
33012 for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
33013 for (n_tokList = 0;n_tokList < gen_nb_const_xmlChar_ptr_ptr;n_tokList++) {
33014 for (n_len = 0;n_len < gen_nb_int;n_len++) {
33015 mem_base = xmlMemBlocks();
33016 ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
33017 exp = gen_xmlExpNodePtr(n_exp, 1);
33018 tokList = gen_const_xmlChar_ptr_ptr(n_tokList, 2);
33019 len = gen_int(n_len, 3);
33021 ret_val = xmlExpGetStart(ctxt, exp, (const xmlChar **)tokList, len);
33022 desret_int(ret_val);
33024 des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
33025 des_xmlExpNodePtr(n_exp, exp, 1);
33026 des_const_xmlChar_ptr_ptr(n_tokList, (const xmlChar **)tokList, 2);
33027 des_int(n_len, len, 3);
33028 xmlResetLastError();
33029 if (mem_base != xmlMemBlocks()) {
33030 printf("Leak of %d blocks found in xmlExpGetStart",
33031 xmlMemBlocks() - mem_base);
33033 printf(" %d", n_ctxt);
33034 printf(" %d", n_exp);
33035 printf(" %d", n_tokList);
33036 printf(" %d", n_len);
33051 test_xmlExpIsNillable(void) {
33054 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
33057 xmlExpNodePtr exp; /* the expression */
33060 for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
33061 mem_base = xmlMemBlocks();
33062 exp = gen_xmlExpNodePtr(n_exp, 0);
33064 ret_val = xmlExpIsNillable(exp);
33065 desret_int(ret_val);
33067 des_xmlExpNodePtr(n_exp, exp, 0);
33068 xmlResetLastError();
33069 if (mem_base != xmlMemBlocks()) {
33070 printf("Leak of %d blocks found in xmlExpIsNillable",
33071 xmlMemBlocks() - mem_base);
33073 printf(" %d", n_exp);
33085 test_xmlExpMaxToken(void) {
33088 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
33091 xmlExpNodePtr expr; /* a compiled expression */
33094 for (n_expr = 0;n_expr < gen_nb_xmlExpNodePtr;n_expr++) {
33095 mem_base = xmlMemBlocks();
33096 expr = gen_xmlExpNodePtr(n_expr, 0);
33098 ret_val = xmlExpMaxToken(expr);
33099 desret_int(ret_val);
33101 des_xmlExpNodePtr(n_expr, expr, 0);
33102 xmlResetLastError();
33103 if (mem_base != xmlMemBlocks()) {
33104 printf("Leak of %d blocks found in xmlExpMaxToken",
33105 xmlMemBlocks() - mem_base);
33107 printf(" %d", n_expr);
33119 test_xmlExpNewAtom(void) {
33123 /* missing type support */
33129 test_xmlExpNewCtxt(void) {
33133 /* missing type support */
33139 test_xmlExpNewOr(void) {
33143 /* missing type support */
33149 test_xmlExpNewRange(void) {
33153 /* missing type support */
33159 test_xmlExpNewSeq(void) {
33163 /* missing type support */
33169 test_xmlExpParse(void) {
33173 /* missing type support */
33179 test_xmlExpRef(void) {
33182 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
33184 xmlExpNodePtr exp; /* the expression */
33187 for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
33188 mem_base = xmlMemBlocks();
33189 exp = gen_xmlExpNodePtr(n_exp, 0);
33193 des_xmlExpNodePtr(n_exp, exp, 0);
33194 xmlResetLastError();
33195 if (mem_base != xmlMemBlocks()) {
33196 printf("Leak of %d blocks found in xmlExpRef",
33197 xmlMemBlocks() - mem_base);
33199 printf(" %d", n_exp);
33211 test_xmlExpStringDerive(void) {
33215 /* missing type support */
33221 test_xmlExpSubsume(void) {
33224 #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
33227 xmlExpCtxtPtr ctxt; /* the expressions context */
33229 xmlExpNodePtr exp; /* the englobing expression */
33231 xmlExpNodePtr sub; /* the subexpression */
33234 for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
33235 for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
33236 for (n_sub = 0;n_sub < gen_nb_xmlExpNodePtr;n_sub++) {
33237 mem_base = xmlMemBlocks();
33238 ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
33239 exp = gen_xmlExpNodePtr(n_exp, 1);
33240 sub = gen_xmlExpNodePtr(n_sub, 2);
33242 ret_val = xmlExpSubsume(ctxt, exp, sub);
33243 desret_int(ret_val);
33245 des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
33246 des_xmlExpNodePtr(n_exp, exp, 1);
33247 des_xmlExpNodePtr(n_sub, sub, 2);
33248 xmlResetLastError();
33249 if (mem_base != xmlMemBlocks()) {
33250 printf("Leak of %d blocks found in xmlExpSubsume",
33251 xmlMemBlocks() - mem_base);
33253 printf(" %d", n_ctxt);
33254 printf(" %d", n_exp);
33255 printf(" %d", n_sub);
33267 #ifdef LIBXML_REGEXP_ENABLED
33269 #define gen_nb_xmlRegExecCtxtPtr 1
33270 static xmlRegExecCtxtPtr gen_xmlRegExecCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33273 static void des_xmlRegExecCtxtPtr(int no ATTRIBUTE_UNUSED, xmlRegExecCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33279 test_xmlRegExecErrInfo(void) {
33282 #if defined(LIBXML_REGEXP_ENABLED)
33285 xmlRegExecCtxtPtr exec; /* a regexp execution context generating an error */
33287 xmlChar ** string; /* return value for the error string */
33289 int * nbval; /* pointer to the number of accepted values IN/OUT */
33291 int * nbneg; /* return number of negative transitions */
33293 xmlChar ** values; /* pointer to the array of acceptable values */
33295 int * terminal; /* return value if this was a terminal state */
33298 for (n_exec = 0;n_exec < gen_nb_xmlRegExecCtxtPtr;n_exec++) {
33299 for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr_ptr;n_string++) {
33300 for (n_nbval = 0;n_nbval < gen_nb_int_ptr;n_nbval++) {
33301 for (n_nbneg = 0;n_nbneg < gen_nb_int_ptr;n_nbneg++) {
33302 for (n_values = 0;n_values < gen_nb_xmlChar_ptr_ptr;n_values++) {
33303 for (n_terminal = 0;n_terminal < gen_nb_int_ptr;n_terminal++) {
33304 mem_base = xmlMemBlocks();
33305 exec = gen_xmlRegExecCtxtPtr(n_exec, 0);
33306 string = gen_const_xmlChar_ptr_ptr(n_string, 1);
33307 nbval = gen_int_ptr(n_nbval, 2);
33308 nbneg = gen_int_ptr(n_nbneg, 3);
33309 values = gen_xmlChar_ptr_ptr(n_values, 4);
33310 terminal = gen_int_ptr(n_terminal, 5);
33312 ret_val = xmlRegExecErrInfo(exec, (const xmlChar **)string, nbval, nbneg, values, terminal);
33313 desret_int(ret_val);
33315 des_xmlRegExecCtxtPtr(n_exec, exec, 0);
33316 des_const_xmlChar_ptr_ptr(n_string, (const xmlChar **)string, 1);
33317 des_int_ptr(n_nbval, nbval, 2);
33318 des_int_ptr(n_nbneg, nbneg, 3);
33319 des_xmlChar_ptr_ptr(n_values, values, 4);
33320 des_int_ptr(n_terminal, terminal, 5);
33321 xmlResetLastError();
33322 if (mem_base != xmlMemBlocks()) {
33323 printf("Leak of %d blocks found in xmlRegExecErrInfo",
33324 xmlMemBlocks() - mem_base);
33326 printf(" %d", n_exec);
33327 printf(" %d", n_string);
33328 printf(" %d", n_nbval);
33329 printf(" %d", n_nbneg);
33330 printf(" %d", n_values);
33331 printf(" %d", n_terminal);
33348 test_xmlRegExecNextValues(void) {
33351 #if defined(LIBXML_REGEXP_ENABLED)
33354 xmlRegExecCtxtPtr exec; /* a regexp execution context */
33356 int * nbval; /* pointer to the number of accepted values IN/OUT */
33358 int * nbneg; /* return number of negative transitions */
33360 xmlChar ** values; /* pointer to the array of acceptable values */
33362 int * terminal; /* return value if this was a terminal state */
33365 for (n_exec = 0;n_exec < gen_nb_xmlRegExecCtxtPtr;n_exec++) {
33366 for (n_nbval = 0;n_nbval < gen_nb_int_ptr;n_nbval++) {
33367 for (n_nbneg = 0;n_nbneg < gen_nb_int_ptr;n_nbneg++) {
33368 for (n_values = 0;n_values < gen_nb_xmlChar_ptr_ptr;n_values++) {
33369 for (n_terminal = 0;n_terminal < gen_nb_int_ptr;n_terminal++) {
33370 mem_base = xmlMemBlocks();
33371 exec = gen_xmlRegExecCtxtPtr(n_exec, 0);
33372 nbval = gen_int_ptr(n_nbval, 1);
33373 nbneg = gen_int_ptr(n_nbneg, 2);
33374 values = gen_xmlChar_ptr_ptr(n_values, 3);
33375 terminal = gen_int_ptr(n_terminal, 4);
33377 ret_val = xmlRegExecNextValues(exec, nbval, nbneg, values, terminal);
33378 desret_int(ret_val);
33380 des_xmlRegExecCtxtPtr(n_exec, exec, 0);
33381 des_int_ptr(n_nbval, nbval, 1);
33382 des_int_ptr(n_nbneg, nbneg, 2);
33383 des_xmlChar_ptr_ptr(n_values, values, 3);
33384 des_int_ptr(n_terminal, terminal, 4);
33385 xmlResetLastError();
33386 if (mem_base != xmlMemBlocks()) {
33387 printf("Leak of %d blocks found in xmlRegExecNextValues",
33388 xmlMemBlocks() - mem_base);
33390 printf(" %d", n_exec);
33391 printf(" %d", n_nbval);
33392 printf(" %d", n_nbneg);
33393 printf(" %d", n_values);
33394 printf(" %d", n_terminal);
33410 test_xmlRegExecPushString(void) {
33413 #if defined(LIBXML_REGEXP_ENABLED)
33416 xmlRegExecCtxtPtr exec; /* a regexp execution context or NULL to indicate the end */
33418 xmlChar * value; /* a string token input */
33420 void * data; /* data associated to the token to reuse in callbacks */
33423 for (n_exec = 0;n_exec < gen_nb_xmlRegExecCtxtPtr;n_exec++) {
33424 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
33425 for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
33426 mem_base = xmlMemBlocks();
33427 exec = gen_xmlRegExecCtxtPtr(n_exec, 0);
33428 value = gen_const_xmlChar_ptr(n_value, 1);
33429 data = gen_userdata(n_data, 2);
33431 ret_val = xmlRegExecPushString(exec, (const xmlChar *)value, data);
33432 desret_int(ret_val);
33434 des_xmlRegExecCtxtPtr(n_exec, exec, 0);
33435 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
33436 des_userdata(n_data, data, 2);
33437 xmlResetLastError();
33438 if (mem_base != xmlMemBlocks()) {
33439 printf("Leak of %d blocks found in xmlRegExecPushString",
33440 xmlMemBlocks() - mem_base);
33442 printf(" %d", n_exec);
33443 printf(" %d", n_value);
33444 printf(" %d", n_data);
33458 test_xmlRegExecPushString2(void) {
33461 #if defined(LIBXML_REGEXP_ENABLED)
33464 xmlRegExecCtxtPtr exec; /* a regexp execution context or NULL to indicate the end */
33466 xmlChar * value; /* the first string token input */
33468 xmlChar * value2; /* the second string token input */
33470 void * data; /* data associated to the token to reuse in callbacks */
33473 for (n_exec = 0;n_exec < gen_nb_xmlRegExecCtxtPtr;n_exec++) {
33474 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
33475 for (n_value2 = 0;n_value2 < gen_nb_const_xmlChar_ptr;n_value2++) {
33476 for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
33477 mem_base = xmlMemBlocks();
33478 exec = gen_xmlRegExecCtxtPtr(n_exec, 0);
33479 value = gen_const_xmlChar_ptr(n_value, 1);
33480 value2 = gen_const_xmlChar_ptr(n_value2, 2);
33481 data = gen_userdata(n_data, 3);
33483 ret_val = xmlRegExecPushString2(exec, (const xmlChar *)value, (const xmlChar *)value2, data);
33484 desret_int(ret_val);
33486 des_xmlRegExecCtxtPtr(n_exec, exec, 0);
33487 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
33488 des_const_xmlChar_ptr(n_value2, (const xmlChar *)value2, 2);
33489 des_userdata(n_data, data, 3);
33490 xmlResetLastError();
33491 if (mem_base != xmlMemBlocks()) {
33492 printf("Leak of %d blocks found in xmlRegExecPushString2",
33493 xmlMemBlocks() - mem_base);
33495 printf(" %d", n_exec);
33496 printf(" %d", n_value);
33497 printf(" %d", n_value2);
33498 printf(" %d", n_data);
33511 #ifdef LIBXML_REGEXP_ENABLED
33513 #define gen_nb_xmlRegexpPtr 1
33514 static xmlRegexpPtr gen_xmlRegexpPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33517 static void des_xmlRegexpPtr(int no ATTRIBUTE_UNUSED, xmlRegexpPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33523 test_xmlRegNewExecCtxt(void) {
33527 /* missing type support */
33533 test_xmlRegexpCompile(void) {
33537 /* missing type support */
33543 test_xmlRegexpExec(void) {
33546 #if defined(LIBXML_REGEXP_ENABLED)
33549 xmlRegexpPtr comp; /* the compiled regular expression */
33551 xmlChar * content; /* the value to check against the regular expression */
33554 for (n_comp = 0;n_comp < gen_nb_xmlRegexpPtr;n_comp++) {
33555 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
33556 mem_base = xmlMemBlocks();
33557 comp = gen_xmlRegexpPtr(n_comp, 0);
33558 content = gen_const_xmlChar_ptr(n_content, 1);
33560 ret_val = xmlRegexpExec(comp, (const xmlChar *)content);
33561 desret_int(ret_val);
33563 des_xmlRegexpPtr(n_comp, comp, 0);
33564 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
33565 xmlResetLastError();
33566 if (mem_base != xmlMemBlocks()) {
33567 printf("Leak of %d blocks found in xmlRegexpExec",
33568 xmlMemBlocks() - mem_base);
33570 printf(" %d", n_comp);
33571 printf(" %d", n_content);
33584 test_xmlRegexpIsDeterminist(void) {
33587 #if defined(LIBXML_REGEXP_ENABLED)
33590 xmlRegexpPtr comp; /* the compiled regular expression */
33593 for (n_comp = 0;n_comp < gen_nb_xmlRegexpPtr;n_comp++) {
33594 mem_base = xmlMemBlocks();
33595 comp = gen_xmlRegexpPtr(n_comp, 0);
33597 ret_val = xmlRegexpIsDeterminist(comp);
33598 desret_int(ret_val);
33600 des_xmlRegexpPtr(n_comp, comp, 0);
33601 xmlResetLastError();
33602 if (mem_base != xmlMemBlocks()) {
33603 printf("Leak of %d blocks found in xmlRegexpIsDeterminist",
33604 xmlMemBlocks() - mem_base);
33606 printf(" %d", n_comp);
33618 test_xmlRegexpPrint(void) {
33621 #if defined(LIBXML_REGEXP_ENABLED)
33623 FILE * output; /* the file for the output debug */
33625 xmlRegexpPtr regexp; /* the compiled regexp */
33628 for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
33629 for (n_regexp = 0;n_regexp < gen_nb_xmlRegexpPtr;n_regexp++) {
33630 mem_base = xmlMemBlocks();
33631 output = gen_FILE_ptr(n_output, 0);
33632 regexp = gen_xmlRegexpPtr(n_regexp, 1);
33634 xmlRegexpPrint(output, regexp);
33636 des_FILE_ptr(n_output, output, 0);
33637 des_xmlRegexpPtr(n_regexp, regexp, 1);
33638 xmlResetLastError();
33639 if (mem_base != xmlMemBlocks()) {
33640 printf("Leak of %d blocks found in xmlRegexpPrint",
33641 xmlMemBlocks() - mem_base);
33643 printf(" %d", n_output);
33644 printf(" %d", n_regexp);
33656 test_xmlregexp(void) {
33659 if (quiet == 0) printf("Testing xmlregexp : 16 of 30 functions ...\n");
33660 test_ret += test_xmlExpCtxtNbCons();
33661 test_ret += test_xmlExpCtxtNbNodes();
33662 test_ret += test_xmlExpDump();
33663 test_ret += test_xmlExpExpDerive();
33664 test_ret += test_xmlExpGetLanguage();
33665 test_ret += test_xmlExpGetStart();
33666 test_ret += test_xmlExpIsNillable();
33667 test_ret += test_xmlExpMaxToken();
33668 test_ret += test_xmlExpNewAtom();
33669 test_ret += test_xmlExpNewCtxt();
33670 test_ret += test_xmlExpNewOr();
33671 test_ret += test_xmlExpNewRange();
33672 test_ret += test_xmlExpNewSeq();
33673 test_ret += test_xmlExpParse();
33674 test_ret += test_xmlExpRef();
33675 test_ret += test_xmlExpStringDerive();
33676 test_ret += test_xmlExpSubsume();
33677 test_ret += test_xmlRegExecErrInfo();
33678 test_ret += test_xmlRegExecNextValues();
33679 test_ret += test_xmlRegExecPushString();
33680 test_ret += test_xmlRegExecPushString2();
33681 test_ret += test_xmlRegNewExecCtxt();
33682 test_ret += test_xmlRegexpCompile();
33683 test_ret += test_xmlRegexpExec();
33684 test_ret += test_xmlRegexpIsDeterminist();
33685 test_ret += test_xmlRegexpPrint();
33688 printf("Module xmlregexp: %d errors\n", test_ret);
33691 #ifdef LIBXML_OUTPUT_ENABLED
33693 #define gen_nb_xmlSaveCtxtPtr 1
33694 static xmlSaveCtxtPtr gen_xmlSaveCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33697 static void des_xmlSaveCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSaveCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33703 test_xmlSaveClose(void) {
33706 #if defined(LIBXML_OUTPUT_ENABLED)
33709 xmlSaveCtxtPtr ctxt; /* a document saving context */
33712 for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) {
33713 mem_base = xmlMemBlocks();
33714 ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0);
33716 ret_val = xmlSaveClose(ctxt);
33717 desret_int(ret_val);
33719 des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0);
33720 xmlResetLastError();
33721 if (mem_base != xmlMemBlocks()) {
33722 printf("Leak of %d blocks found in xmlSaveClose",
33723 xmlMemBlocks() - mem_base);
33725 printf(" %d", n_ctxt);
33737 test_xmlSaveDoc(void) {
33740 #if defined(LIBXML_OUTPUT_ENABLED)
33743 xmlSaveCtxtPtr ctxt; /* a document saving context */
33745 xmlDocPtr doc; /* a document */
33748 for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) {
33749 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
33750 mem_base = xmlMemBlocks();
33751 ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0);
33752 doc = gen_xmlDocPtr(n_doc, 1);
33754 ret_val = xmlSaveDoc(ctxt, doc);
33755 desret_long(ret_val);
33757 des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0);
33758 des_xmlDocPtr(n_doc, doc, 1);
33759 xmlResetLastError();
33760 if (mem_base != xmlMemBlocks()) {
33761 printf("Leak of %d blocks found in xmlSaveDoc",
33762 xmlMemBlocks() - mem_base);
33764 printf(" %d", n_ctxt);
33765 printf(" %d", n_doc);
33778 test_xmlSaveFlush(void) {
33781 #if defined(LIBXML_OUTPUT_ENABLED)
33784 xmlSaveCtxtPtr ctxt; /* a document saving context */
33787 for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) {
33788 mem_base = xmlMemBlocks();
33789 ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0);
33791 ret_val = xmlSaveFlush(ctxt);
33792 desret_int(ret_val);
33794 des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0);
33795 xmlResetLastError();
33796 if (mem_base != xmlMemBlocks()) {
33797 printf("Leak of %d blocks found in xmlSaveFlush",
33798 xmlMemBlocks() - mem_base);
33800 printf(" %d", n_ctxt);
33812 test_xmlSaveSetAttrEscape(void) {
33816 /* missing type support */
33822 test_xmlSaveSetEscape(void) {
33826 /* missing type support */
33832 test_xmlSaveToBuffer(void) {
33836 /* missing type support */
33842 test_xmlSaveToFd(void) {
33846 /* missing type support */
33852 test_xmlSaveToFilename(void) {
33856 /* missing type support */
33862 test_xmlSaveTree(void) {
33865 #if defined(LIBXML_OUTPUT_ENABLED)
33868 xmlSaveCtxtPtr ctxt; /* a document saving context */
33870 xmlNodePtr node; /* the top node of the subtree to save */
33873 for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) {
33874 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
33875 mem_base = xmlMemBlocks();
33876 ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0);
33877 node = gen_xmlNodePtr(n_node, 1);
33879 ret_val = xmlSaveTree(ctxt, node);
33880 desret_long(ret_val);
33882 des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0);
33883 des_xmlNodePtr(n_node, node, 1);
33884 xmlResetLastError();
33885 if (mem_base != xmlMemBlocks()) {
33886 printf("Leak of %d blocks found in xmlSaveTree",
33887 xmlMemBlocks() - mem_base);
33889 printf(" %d", n_ctxt);
33890 printf(" %d", n_node);
33902 test_xmlsave(void) {
33905 if (quiet == 0) printf("Testing xmlsave : 4 of 10 functions ...\n");
33906 test_ret += test_xmlSaveClose();
33907 test_ret += test_xmlSaveDoc();
33908 test_ret += test_xmlSaveFlush();
33909 test_ret += test_xmlSaveSetAttrEscape();
33910 test_ret += test_xmlSaveSetEscape();
33911 test_ret += test_xmlSaveToBuffer();
33912 test_ret += test_xmlSaveToFd();
33913 test_ret += test_xmlSaveToFilename();
33914 test_ret += test_xmlSaveTree();
33917 printf("Module xmlsave: %d errors\n", test_ret);
33922 test_xmlSchemaDump(void) {
33925 #if defined(LIBXML_SCHEMAS_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
33927 FILE * output; /* the file output */
33929 xmlSchemaPtr schema; /* a schema structure */
33932 for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
33933 for (n_schema = 0;n_schema < gen_nb_xmlSchemaPtr;n_schema++) {
33934 mem_base = xmlMemBlocks();
33935 output = gen_FILE_ptr(n_output, 0);
33936 schema = gen_xmlSchemaPtr(n_schema, 1);
33938 xmlSchemaDump(output, schema);
33940 des_FILE_ptr(n_output, output, 0);
33941 des_xmlSchemaPtr(n_schema, schema, 1);
33942 xmlResetLastError();
33943 if (mem_base != xmlMemBlocks()) {
33944 printf("Leak of %d blocks found in xmlSchemaDump",
33945 xmlMemBlocks() - mem_base);
33947 printf(" %d", n_output);
33948 printf(" %d", n_schema);
33959 #ifdef LIBXML_SCHEMAS_ENABLED
33961 #define gen_nb_xmlSchemaParserCtxtPtr 1
33962 static xmlSchemaParserCtxtPtr gen_xmlSchemaParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33965 static void des_xmlSchemaParserCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSchemaParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33969 #ifdef LIBXML_SCHEMAS_ENABLED
33971 #define gen_nb_xmlSchemaValidityErrorFunc_ptr 1
33972 static xmlSchemaValidityErrorFunc * gen_xmlSchemaValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33975 static void des_xmlSchemaValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED, xmlSchemaValidityErrorFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33979 #ifdef LIBXML_SCHEMAS_ENABLED
33981 #define gen_nb_xmlSchemaValidityWarningFunc_ptr 1
33982 static xmlSchemaValidityWarningFunc * gen_xmlSchemaValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33985 static void des_xmlSchemaValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED, xmlSchemaValidityWarningFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33991 test_xmlSchemaGetParserErrors(void) {
33994 #if defined(LIBXML_SCHEMAS_ENABLED)
33997 xmlSchemaParserCtxtPtr ctxt; /* a XMl-Schema parser context */
33999 xmlSchemaValidityErrorFunc * err; /* the error callback result */
34001 xmlSchemaValidityWarningFunc * warn; /* the warning callback result */
34003 void ** ctx; /* contextual data for the callbacks result */
34006 for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaParserCtxtPtr;n_ctxt++) {
34007 for (n_err = 0;n_err < gen_nb_xmlSchemaValidityErrorFunc_ptr;n_err++) {
34008 for (n_warn = 0;n_warn < gen_nb_xmlSchemaValidityWarningFunc_ptr;n_warn++) {
34009 for (n_ctx = 0;n_ctx < gen_nb_void_ptr_ptr;n_ctx++) {
34010 mem_base = xmlMemBlocks();
34011 ctxt = gen_xmlSchemaParserCtxtPtr(n_ctxt, 0);
34012 err = gen_xmlSchemaValidityErrorFunc_ptr(n_err, 1);
34013 warn = gen_xmlSchemaValidityWarningFunc_ptr(n_warn, 2);
34014 ctx = gen_void_ptr_ptr(n_ctx, 3);
34016 ret_val = xmlSchemaGetParserErrors(ctxt, err, warn, ctx);
34017 desret_int(ret_val);
34019 des_xmlSchemaParserCtxtPtr(n_ctxt, ctxt, 0);
34020 des_xmlSchemaValidityErrorFunc_ptr(n_err, err, 1);
34021 des_xmlSchemaValidityWarningFunc_ptr(n_warn, warn, 2);
34022 des_void_ptr_ptr(n_ctx, ctx, 3);
34023 xmlResetLastError();
34024 if (mem_base != xmlMemBlocks()) {
34025 printf("Leak of %d blocks found in xmlSchemaGetParserErrors",
34026 xmlMemBlocks() - mem_base);
34028 printf(" %d", n_ctxt);
34029 printf(" %d", n_err);
34030 printf(" %d", n_warn);
34031 printf(" %d", n_ctx);
34046 test_xmlSchemaGetValidErrors(void) {
34049 #if defined(LIBXML_SCHEMAS_ENABLED)
34052 xmlSchemaValidCtxtPtr ctxt; /* a XML-Schema validation context */
34054 xmlSchemaValidityErrorFunc * err; /* the error function result */
34056 xmlSchemaValidityWarningFunc * warn; /* the warning function result */
34058 void ** ctx; /* the functions context result */
34061 for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34062 for (n_err = 0;n_err < gen_nb_xmlSchemaValidityErrorFunc_ptr;n_err++) {
34063 for (n_warn = 0;n_warn < gen_nb_xmlSchemaValidityWarningFunc_ptr;n_warn++) {
34064 for (n_ctx = 0;n_ctx < gen_nb_void_ptr_ptr;n_ctx++) {
34065 mem_base = xmlMemBlocks();
34066 ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34067 err = gen_xmlSchemaValidityErrorFunc_ptr(n_err, 1);
34068 warn = gen_xmlSchemaValidityWarningFunc_ptr(n_warn, 2);
34069 ctx = gen_void_ptr_ptr(n_ctx, 3);
34071 ret_val = xmlSchemaGetValidErrors(ctxt, err, warn, ctx);
34072 desret_int(ret_val);
34074 des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34075 des_xmlSchemaValidityErrorFunc_ptr(n_err, err, 1);
34076 des_xmlSchemaValidityWarningFunc_ptr(n_warn, warn, 2);
34077 des_void_ptr_ptr(n_ctx, ctx, 3);
34078 xmlResetLastError();
34079 if (mem_base != xmlMemBlocks()) {
34080 printf("Leak of %d blocks found in xmlSchemaGetValidErrors",
34081 xmlMemBlocks() - mem_base);
34083 printf(" %d", n_ctxt);
34084 printf(" %d", n_err);
34085 printf(" %d", n_warn);
34086 printf(" %d", n_ctx);
34101 test_xmlSchemaIsValid(void) {
34104 #if defined(LIBXML_SCHEMAS_ENABLED)
34107 xmlSchemaValidCtxtPtr ctxt; /* the schema validation context */
34110 for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34111 mem_base = xmlMemBlocks();
34112 ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34114 ret_val = xmlSchemaIsValid(ctxt);
34115 desret_int(ret_val);
34117 des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34118 xmlResetLastError();
34119 if (mem_base != xmlMemBlocks()) {
34120 printf("Leak of %d blocks found in xmlSchemaIsValid",
34121 xmlMemBlocks() - mem_base);
34123 printf(" %d", n_ctxt);
34135 test_xmlSchemaNewDocParserCtxt(void) {
34138 #if defined(LIBXML_SCHEMAS_ENABLED)
34140 xmlSchemaParserCtxtPtr ret_val;
34141 xmlDocPtr doc; /* a preparsed document tree */
34144 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
34145 mem_base = xmlMemBlocks();
34146 doc = gen_xmlDocPtr(n_doc, 0);
34148 ret_val = xmlSchemaNewDocParserCtxt(doc);
34149 desret_xmlSchemaParserCtxtPtr(ret_val);
34151 des_xmlDocPtr(n_doc, doc, 0);
34152 xmlResetLastError();
34153 if (mem_base != xmlMemBlocks()) {
34154 printf("Leak of %d blocks found in xmlSchemaNewDocParserCtxt",
34155 xmlMemBlocks() - mem_base);
34157 printf(" %d", n_doc);
34169 test_xmlSchemaNewMemParserCtxt(void) {
34172 #if defined(LIBXML_SCHEMAS_ENABLED)
34174 xmlSchemaParserCtxtPtr ret_val;
34175 char * buffer; /* a pointer to a char array containing the schemas */
34177 int size; /* the size of the array */
34180 for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
34181 for (n_size = 0;n_size < gen_nb_int;n_size++) {
34182 mem_base = xmlMemBlocks();
34183 buffer = gen_const_char_ptr(n_buffer, 0);
34184 size = gen_int(n_size, 1);
34186 ret_val = xmlSchemaNewMemParserCtxt((const char *)buffer, size);
34187 desret_xmlSchemaParserCtxtPtr(ret_val);
34189 des_const_char_ptr(n_buffer, (const char *)buffer, 0);
34190 des_int(n_size, size, 1);
34191 xmlResetLastError();
34192 if (mem_base != xmlMemBlocks()) {
34193 printf("Leak of %d blocks found in xmlSchemaNewMemParserCtxt",
34194 xmlMemBlocks() - mem_base);
34196 printf(" %d", n_buffer);
34197 printf(" %d", n_size);
34210 test_xmlSchemaNewParserCtxt(void) {
34213 #if defined(LIBXML_SCHEMAS_ENABLED)
34215 xmlSchemaParserCtxtPtr ret_val;
34216 char * URL; /* the location of the schema */
34219 for (n_URL = 0;n_URL < gen_nb_const_char_ptr;n_URL++) {
34220 mem_base = xmlMemBlocks();
34221 URL = gen_const_char_ptr(n_URL, 0);
34223 ret_val = xmlSchemaNewParserCtxt((const char *)URL);
34224 desret_xmlSchemaParserCtxtPtr(ret_val);
34226 des_const_char_ptr(n_URL, (const char *)URL, 0);
34227 xmlResetLastError();
34228 if (mem_base != xmlMemBlocks()) {
34229 printf("Leak of %d blocks found in xmlSchemaNewParserCtxt",
34230 xmlMemBlocks() - mem_base);
34232 printf(" %d", n_URL);
34244 test_xmlSchemaNewValidCtxt(void) {
34248 /* missing type support */
34254 test_xmlSchemaParse(void) {
34258 /* missing type support */
34262 #ifdef LIBXML_SCHEMAS_ENABLED
34264 #define gen_nb_xmlSAXHandlerPtr_ptr 1
34265 static xmlSAXHandlerPtr * gen_xmlSAXHandlerPtr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34268 static void des_xmlSAXHandlerPtr_ptr(int no ATTRIBUTE_UNUSED, xmlSAXHandlerPtr * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34274 test_xmlSchemaSAXPlug(void) {
34278 /* missing type support */
34282 #ifdef LIBXML_SCHEMAS_ENABLED
34284 #define gen_nb_xmlSchemaSAXPlugPtr 1
34285 static xmlSchemaSAXPlugPtr gen_xmlSchemaSAXPlugPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34288 static void des_xmlSchemaSAXPlugPtr(int no ATTRIBUTE_UNUSED, xmlSchemaSAXPlugPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34294 test_xmlSchemaSAXUnplug(void) {
34297 #if defined(LIBXML_SCHEMAS_ENABLED)
34300 xmlSchemaSAXPlugPtr plug; /* a data structure returned by xmlSchemaSAXPlug */
34303 for (n_plug = 0;n_plug < gen_nb_xmlSchemaSAXPlugPtr;n_plug++) {
34304 mem_base = xmlMemBlocks();
34305 plug = gen_xmlSchemaSAXPlugPtr(n_plug, 0);
34307 ret_val = xmlSchemaSAXUnplug(plug);
34308 desret_int(ret_val);
34310 des_xmlSchemaSAXPlugPtr(n_plug, plug, 0);
34311 xmlResetLastError();
34312 if (mem_base != xmlMemBlocks()) {
34313 printf("Leak of %d blocks found in xmlSchemaSAXUnplug",
34314 xmlMemBlocks() - mem_base);
34316 printf(" %d", n_plug);
34328 test_xmlSchemaSetParserErrors(void) {
34332 /* missing type support */
34338 test_xmlSchemaSetParserStructuredErrors(void) {
34342 /* missing type support */
34348 test_xmlSchemaSetValidErrors(void) {
34352 /* missing type support */
34358 test_xmlSchemaSetValidOptions(void) {
34361 #if defined(LIBXML_SCHEMAS_ENABLED)
34364 xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
34366 int options; /* a combination of xmlSchemaValidOption */
34369 for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34370 for (n_options = 0;n_options < gen_nb_int;n_options++) {
34371 mem_base = xmlMemBlocks();
34372 ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34373 options = gen_int(n_options, 1);
34375 ret_val = xmlSchemaSetValidOptions(ctxt, options);
34376 desret_int(ret_val);
34378 des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34379 des_int(n_options, options, 1);
34380 xmlResetLastError();
34381 if (mem_base != xmlMemBlocks()) {
34382 printf("Leak of %d blocks found in xmlSchemaSetValidOptions",
34383 xmlMemBlocks() - mem_base);
34385 printf(" %d", n_ctxt);
34386 printf(" %d", n_options);
34399 test_xmlSchemaSetValidStructuredErrors(void) {
34403 /* missing type support */
34409 test_xmlSchemaValidCtxtGetOptions(void) {
34412 #if defined(LIBXML_SCHEMAS_ENABLED)
34415 xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
34418 for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34419 mem_base = xmlMemBlocks();
34420 ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34422 ret_val = xmlSchemaValidCtxtGetOptions(ctxt);
34423 desret_int(ret_val);
34425 des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34426 xmlResetLastError();
34427 if (mem_base != xmlMemBlocks()) {
34428 printf("Leak of %d blocks found in xmlSchemaValidCtxtGetOptions",
34429 xmlMemBlocks() - mem_base);
34431 printf(" %d", n_ctxt);
34443 test_xmlSchemaValidCtxtGetParserCtxt(void) {
34446 #if defined(LIBXML_SCHEMAS_ENABLED)
34448 xmlParserCtxtPtr ret_val;
34449 xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
34452 for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34453 mem_base = xmlMemBlocks();
34454 ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34456 ret_val = xmlSchemaValidCtxtGetParserCtxt(ctxt);
34457 desret_xmlParserCtxtPtr(ret_val);
34459 des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34460 xmlResetLastError();
34461 if (mem_base != xmlMemBlocks()) {
34462 printf("Leak of %d blocks found in xmlSchemaValidCtxtGetParserCtxt",
34463 xmlMemBlocks() - mem_base);
34465 printf(" %d", n_ctxt);
34477 test_xmlSchemaValidateDoc(void) {
34480 #if defined(LIBXML_SCHEMAS_ENABLED)
34483 xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
34485 xmlDocPtr doc; /* a parsed document tree */
34488 for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34489 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
34490 mem_base = xmlMemBlocks();
34491 ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34492 doc = gen_xmlDocPtr(n_doc, 1);
34494 ret_val = xmlSchemaValidateDoc(ctxt, doc);
34495 desret_int(ret_val);
34497 des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34498 des_xmlDocPtr(n_doc, doc, 1);
34499 xmlResetLastError();
34500 if (mem_base != xmlMemBlocks()) {
34501 printf("Leak of %d blocks found in xmlSchemaValidateDoc",
34502 xmlMemBlocks() - mem_base);
34504 printf(" %d", n_ctxt);
34505 printf(" %d", n_doc);
34518 test_xmlSchemaValidateFile(void) {
34521 #if defined(LIBXML_SCHEMAS_ENABLED)
34524 xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
34526 const char * filename; /* the URI of the instance */
34528 int options; /* a future set of options, currently unused */
34531 for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34532 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
34533 for (n_options = 0;n_options < gen_nb_int;n_options++) {
34534 mem_base = xmlMemBlocks();
34535 ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34536 filename = gen_filepath(n_filename, 1);
34537 options = gen_int(n_options, 2);
34539 ret_val = xmlSchemaValidateFile(ctxt, filename, options);
34540 desret_int(ret_val);
34542 des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34543 des_filepath(n_filename, filename, 1);
34544 des_int(n_options, options, 2);
34545 xmlResetLastError();
34546 if (mem_base != xmlMemBlocks()) {
34547 printf("Leak of %d blocks found in xmlSchemaValidateFile",
34548 xmlMemBlocks() - mem_base);
34550 printf(" %d", n_ctxt);
34551 printf(" %d", n_filename);
34552 printf(" %d", n_options);
34566 test_xmlSchemaValidateOneElement(void) {
34569 #if defined(LIBXML_SCHEMAS_ENABLED)
34572 xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
34574 xmlNodePtr elem; /* an element node */
34577 for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34578 for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
34579 mem_base = xmlMemBlocks();
34580 ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34581 elem = gen_xmlNodePtr(n_elem, 1);
34583 ret_val = xmlSchemaValidateOneElement(ctxt, elem);
34584 desret_int(ret_val);
34586 des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34587 des_xmlNodePtr(n_elem, elem, 1);
34588 xmlResetLastError();
34589 if (mem_base != xmlMemBlocks()) {
34590 printf("Leak of %d blocks found in xmlSchemaValidateOneElement",
34591 xmlMemBlocks() - mem_base);
34593 printf(" %d", n_ctxt);
34594 printf(" %d", n_elem);
34607 test_xmlSchemaValidateStream(void) {
34610 #if defined(LIBXML_SCHEMAS_ENABLED)
34613 xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
34615 xmlParserInputBufferPtr input; /* the input to use for reading the data */
34617 xmlCharEncoding enc; /* an optional encoding information */
34619 xmlSAXHandlerPtr sax; /* a SAX handler for the resulting events */
34621 void * user_data; /* the context to provide to the SAX handler. */
34624 for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34625 for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
34626 for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
34627 for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
34628 for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
34629 mem_base = xmlMemBlocks();
34630 ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34631 input = gen_xmlParserInputBufferPtr(n_input, 1);
34632 enc = gen_xmlCharEncoding(n_enc, 2);
34633 sax = gen_xmlSAXHandlerPtr(n_sax, 3);
34634 user_data = gen_userdata(n_user_data, 4);
34636 ret_val = xmlSchemaValidateStream(ctxt, input, enc, sax, user_data);
34637 desret_int(ret_val);
34639 des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34640 des_xmlParserInputBufferPtr(n_input, input, 1);
34641 des_xmlCharEncoding(n_enc, enc, 2);
34642 des_xmlSAXHandlerPtr(n_sax, sax, 3);
34643 des_userdata(n_user_data, user_data, 4);
34644 xmlResetLastError();
34645 if (mem_base != xmlMemBlocks()) {
34646 printf("Leak of %d blocks found in xmlSchemaValidateStream",
34647 xmlMemBlocks() - mem_base);
34649 printf(" %d", n_ctxt);
34650 printf(" %d", n_input);
34651 printf(" %d", n_enc);
34652 printf(" %d", n_sax);
34653 printf(" %d", n_user_data);
34668 test_xmlschemas(void) {
34671 if (quiet == 0) printf("Testing xmlschemas : 15 of 25 functions ...\n");
34672 test_ret += test_xmlSchemaDump();
34673 test_ret += test_xmlSchemaGetParserErrors();
34674 test_ret += test_xmlSchemaGetValidErrors();
34675 test_ret += test_xmlSchemaIsValid();
34676 test_ret += test_xmlSchemaNewDocParserCtxt();
34677 test_ret += test_xmlSchemaNewMemParserCtxt();
34678 test_ret += test_xmlSchemaNewParserCtxt();
34679 test_ret += test_xmlSchemaNewValidCtxt();
34680 test_ret += test_xmlSchemaParse();
34681 test_ret += test_xmlSchemaSAXPlug();
34682 test_ret += test_xmlSchemaSAXUnplug();
34683 test_ret += test_xmlSchemaSetParserErrors();
34684 test_ret += test_xmlSchemaSetParserStructuredErrors();
34685 test_ret += test_xmlSchemaSetValidErrors();
34686 test_ret += test_xmlSchemaSetValidOptions();
34687 test_ret += test_xmlSchemaSetValidStructuredErrors();
34688 test_ret += test_xmlSchemaValidCtxtGetOptions();
34689 test_ret += test_xmlSchemaValidCtxtGetParserCtxt();
34690 test_ret += test_xmlSchemaValidateDoc();
34691 test_ret += test_xmlSchemaValidateFile();
34692 test_ret += test_xmlSchemaValidateOneElement();
34693 test_ret += test_xmlSchemaValidateStream();
34696 printf("Module xmlschemas: %d errors\n", test_ret);
34699 #ifdef LIBXML_SCHEMAS_ENABLED
34701 #define gen_nb_xmlSchemaFacetPtr 1
34702 static xmlSchemaFacetPtr gen_xmlSchemaFacetPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34705 static void des_xmlSchemaFacetPtr(int no ATTRIBUTE_UNUSED, xmlSchemaFacetPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34709 #ifdef LIBXML_SCHEMAS_ENABLED
34711 #define gen_nb_xmlSchemaTypePtr 1
34712 static xmlSchemaTypePtr gen_xmlSchemaTypePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34715 static void des_xmlSchemaTypePtr(int no ATTRIBUTE_UNUSED, xmlSchemaTypePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34721 test_xmlSchemaCheckFacet(void) {
34724 #if defined(LIBXML_SCHEMAS_ENABLED)
34727 xmlSchemaFacetPtr facet; /* the facet */
34729 xmlSchemaTypePtr typeDecl; /* the schema type definition */
34731 xmlSchemaParserCtxtPtr pctxt; /* the schema parser context or NULL */
34733 xmlChar * name; /* the optional name of the type */
34736 for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
34737 for (n_typeDecl = 0;n_typeDecl < gen_nb_xmlSchemaTypePtr;n_typeDecl++) {
34738 for (n_pctxt = 0;n_pctxt < gen_nb_xmlSchemaParserCtxtPtr;n_pctxt++) {
34739 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
34740 mem_base = xmlMemBlocks();
34741 facet = gen_xmlSchemaFacetPtr(n_facet, 0);
34742 typeDecl = gen_xmlSchemaTypePtr(n_typeDecl, 1);
34743 pctxt = gen_xmlSchemaParserCtxtPtr(n_pctxt, 2);
34744 name = gen_const_xmlChar_ptr(n_name, 3);
34746 ret_val = xmlSchemaCheckFacet(facet, typeDecl, pctxt, (const xmlChar *)name);
34747 desret_int(ret_val);
34749 des_xmlSchemaFacetPtr(n_facet, facet, 0);
34750 des_xmlSchemaTypePtr(n_typeDecl, typeDecl, 1);
34751 des_xmlSchemaParserCtxtPtr(n_pctxt, pctxt, 2);
34752 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 3);
34753 xmlResetLastError();
34754 if (mem_base != xmlMemBlocks()) {
34755 printf("Leak of %d blocks found in xmlSchemaCheckFacet",
34756 xmlMemBlocks() - mem_base);
34758 printf(" %d", n_facet);
34759 printf(" %d", n_typeDecl);
34760 printf(" %d", n_pctxt);
34761 printf(" %d", n_name);
34776 test_xmlSchemaCleanupTypes(void) {
34779 #if defined(LIBXML_SCHEMAS_ENABLED)
34782 xmlSchemaCleanupTypes();
34784 xmlResetLastError();
34793 test_xmlSchemaCollapseString(void) {
34796 #if defined(LIBXML_SCHEMAS_ENABLED)
34799 xmlChar * value; /* a value */
34802 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
34803 mem_base = xmlMemBlocks();
34804 value = gen_const_xmlChar_ptr(n_value, 0);
34806 ret_val = xmlSchemaCollapseString((const xmlChar *)value);
34807 desret_xmlChar_ptr(ret_val);
34809 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
34810 xmlResetLastError();
34811 if (mem_base != xmlMemBlocks()) {
34812 printf("Leak of %d blocks found in xmlSchemaCollapseString",
34813 xmlMemBlocks() - mem_base);
34815 printf(" %d", n_value);
34825 #ifdef LIBXML_SCHEMAS_ENABLED
34827 #define gen_nb_xmlSchemaValPtr 1
34828 static xmlSchemaValPtr gen_xmlSchemaValPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34831 static void des_xmlSchemaValPtr(int no ATTRIBUTE_UNUSED, xmlSchemaValPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34837 test_xmlSchemaCompareValues(void) {
34840 #if defined(LIBXML_SCHEMAS_ENABLED)
34843 xmlSchemaValPtr x; /* a first value */
34845 xmlSchemaValPtr y; /* a second value */
34848 for (n_x = 0;n_x < gen_nb_xmlSchemaValPtr;n_x++) {
34849 for (n_y = 0;n_y < gen_nb_xmlSchemaValPtr;n_y++) {
34850 mem_base = xmlMemBlocks();
34851 x = gen_xmlSchemaValPtr(n_x, 0);
34852 y = gen_xmlSchemaValPtr(n_y, 1);
34854 ret_val = xmlSchemaCompareValues(x, y);
34855 desret_int(ret_val);
34857 des_xmlSchemaValPtr(n_x, x, 0);
34858 des_xmlSchemaValPtr(n_y, y, 1);
34859 xmlResetLastError();
34860 if (mem_base != xmlMemBlocks()) {
34861 printf("Leak of %d blocks found in xmlSchemaCompareValues",
34862 xmlMemBlocks() - mem_base);
34864 printf(" %d", n_x);
34865 printf(" %d", n_y);
34878 test_xmlSchemaCompareValuesWhtsp(void) {
34881 #if defined(LIBXML_SCHEMAS_ENABLED)
34884 xmlSchemaValPtr x; /* a first value */
34886 xmlSchemaWhitespaceValueType xws; /* the whitespace value of x */
34888 xmlSchemaValPtr y; /* a second value */
34890 xmlSchemaWhitespaceValueType yws; /* the whitespace value of y */
34893 for (n_x = 0;n_x < gen_nb_xmlSchemaValPtr;n_x++) {
34894 for (n_xws = 0;n_xws < gen_nb_xmlSchemaWhitespaceValueType;n_xws++) {
34895 for (n_y = 0;n_y < gen_nb_xmlSchemaValPtr;n_y++) {
34896 for (n_yws = 0;n_yws < gen_nb_xmlSchemaWhitespaceValueType;n_yws++) {
34897 mem_base = xmlMemBlocks();
34898 x = gen_xmlSchemaValPtr(n_x, 0);
34899 xws = gen_xmlSchemaWhitespaceValueType(n_xws, 1);
34900 y = gen_xmlSchemaValPtr(n_y, 2);
34901 yws = gen_xmlSchemaWhitespaceValueType(n_yws, 3);
34903 ret_val = xmlSchemaCompareValuesWhtsp(x, xws, y, yws);
34904 desret_int(ret_val);
34906 des_xmlSchemaValPtr(n_x, x, 0);
34907 des_xmlSchemaWhitespaceValueType(n_xws, xws, 1);
34908 des_xmlSchemaValPtr(n_y, y, 2);
34909 des_xmlSchemaWhitespaceValueType(n_yws, yws, 3);
34910 xmlResetLastError();
34911 if (mem_base != xmlMemBlocks()) {
34912 printf("Leak of %d blocks found in xmlSchemaCompareValuesWhtsp",
34913 xmlMemBlocks() - mem_base);
34915 printf(" %d", n_x);
34916 printf(" %d", n_xws);
34917 printf(" %d", n_y);
34918 printf(" %d", n_yws);
34933 test_xmlSchemaCopyValue(void) {
34937 /* missing type support */
34943 test_xmlSchemaGetBuiltInListSimpleTypeItemType(void) {
34946 #if defined(LIBXML_SCHEMAS_ENABLED)
34948 xmlSchemaTypePtr ret_val;
34949 xmlSchemaTypePtr type; /* the built-in simple type. */
34952 for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
34953 mem_base = xmlMemBlocks();
34954 type = gen_xmlSchemaTypePtr(n_type, 0);
34956 ret_val = xmlSchemaGetBuiltInListSimpleTypeItemType(type);
34957 desret_xmlSchemaTypePtr(ret_val);
34959 des_xmlSchemaTypePtr(n_type, type, 0);
34960 xmlResetLastError();
34961 if (mem_base != xmlMemBlocks()) {
34962 printf("Leak of %d blocks found in xmlSchemaGetBuiltInListSimpleTypeItemType",
34963 xmlMemBlocks() - mem_base);
34965 printf(" %d", n_type);
34977 test_xmlSchemaGetBuiltInType(void) {
34980 #if defined(LIBXML_SCHEMAS_ENABLED)
34981 xmlSchemaTypePtr ret_val;
34982 xmlSchemaValType type; /* the type of the built in type */
34985 for (n_type = 0;n_type < gen_nb_xmlSchemaValType;n_type++) {
34986 type = gen_xmlSchemaValType(n_type, 0);
34988 ret_val = xmlSchemaGetBuiltInType(type);
34989 desret_xmlSchemaTypePtr(ret_val);
34991 des_xmlSchemaValType(n_type, type, 0);
34992 xmlResetLastError();
35002 test_xmlSchemaGetCanonValue(void) {
35005 #if defined(LIBXML_SCHEMAS_ENABLED)
35008 xmlSchemaValPtr val; /* the precomputed value */
35010 xmlChar ** retValue; /* the returned value */
35013 for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35014 for (n_retValue = 0;n_retValue < gen_nb_const_xmlChar_ptr_ptr;n_retValue++) {
35015 mem_base = xmlMemBlocks();
35016 val = gen_xmlSchemaValPtr(n_val, 0);
35017 retValue = gen_const_xmlChar_ptr_ptr(n_retValue, 1);
35019 ret_val = xmlSchemaGetCanonValue(val, (const xmlChar **)retValue);
35020 desret_int(ret_val);
35022 des_xmlSchemaValPtr(n_val, val, 0);
35023 des_const_xmlChar_ptr_ptr(n_retValue, (const xmlChar **)retValue, 1);
35024 xmlResetLastError();
35025 if (mem_base != xmlMemBlocks()) {
35026 printf("Leak of %d blocks found in xmlSchemaGetCanonValue",
35027 xmlMemBlocks() - mem_base);
35029 printf(" %d", n_val);
35030 printf(" %d", n_retValue);
35043 test_xmlSchemaGetCanonValueWhtsp(void) {
35046 #if defined(LIBXML_SCHEMAS_ENABLED)
35049 xmlSchemaValPtr val; /* the precomputed value */
35051 xmlChar ** retValue; /* the returned value */
35053 xmlSchemaWhitespaceValueType ws; /* the whitespace type of the value */
35056 for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35057 for (n_retValue = 0;n_retValue < gen_nb_const_xmlChar_ptr_ptr;n_retValue++) {
35058 for (n_ws = 0;n_ws < gen_nb_xmlSchemaWhitespaceValueType;n_ws++) {
35059 mem_base = xmlMemBlocks();
35060 val = gen_xmlSchemaValPtr(n_val, 0);
35061 retValue = gen_const_xmlChar_ptr_ptr(n_retValue, 1);
35062 ws = gen_xmlSchemaWhitespaceValueType(n_ws, 2);
35064 ret_val = xmlSchemaGetCanonValueWhtsp(val, (const xmlChar **)retValue, ws);
35065 desret_int(ret_val);
35067 des_xmlSchemaValPtr(n_val, val, 0);
35068 des_const_xmlChar_ptr_ptr(n_retValue, (const xmlChar **)retValue, 1);
35069 des_xmlSchemaWhitespaceValueType(n_ws, ws, 2);
35070 xmlResetLastError();
35071 if (mem_base != xmlMemBlocks()) {
35072 printf("Leak of %d blocks found in xmlSchemaGetCanonValueWhtsp",
35073 xmlMemBlocks() - mem_base);
35075 printf(" %d", n_val);
35076 printf(" %d", n_retValue);
35077 printf(" %d", n_ws);
35091 test_xmlSchemaGetFacetValueAsULong(void) {
35094 #if defined(LIBXML_SCHEMAS_ENABLED)
35096 unsigned long ret_val;
35097 xmlSchemaFacetPtr facet; /* an schemas type facet */
35100 for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
35101 mem_base = xmlMemBlocks();
35102 facet = gen_xmlSchemaFacetPtr(n_facet, 0);
35104 ret_val = xmlSchemaGetFacetValueAsULong(facet);
35105 desret_unsigned_long(ret_val);
35107 des_xmlSchemaFacetPtr(n_facet, facet, 0);
35108 xmlResetLastError();
35109 if (mem_base != xmlMemBlocks()) {
35110 printf("Leak of %d blocks found in xmlSchemaGetFacetValueAsULong",
35111 xmlMemBlocks() - mem_base);
35113 printf(" %d", n_facet);
35125 test_xmlSchemaGetPredefinedType(void) {
35128 #if defined(LIBXML_SCHEMAS_ENABLED)
35130 xmlSchemaTypePtr ret_val;
35131 xmlChar * name; /* the type name */
35133 xmlChar * ns; /* the URI of the namespace usually "http://www.w3.org/2001/XMLSchema" */
35136 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
35137 for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
35138 mem_base = xmlMemBlocks();
35139 name = gen_const_xmlChar_ptr(n_name, 0);
35140 ns = gen_const_xmlChar_ptr(n_ns, 1);
35142 ret_val = xmlSchemaGetPredefinedType((const xmlChar *)name, (const xmlChar *)ns);
35143 desret_xmlSchemaTypePtr(ret_val);
35145 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
35146 des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 1);
35147 xmlResetLastError();
35148 if (mem_base != xmlMemBlocks()) {
35149 printf("Leak of %d blocks found in xmlSchemaGetPredefinedType",
35150 xmlMemBlocks() - mem_base);
35152 printf(" %d", n_name);
35153 printf(" %d", n_ns);
35166 test_xmlSchemaGetValType(void) {
35169 #if defined(LIBXML_SCHEMAS_ENABLED)
35171 xmlSchemaValType ret_val;
35172 xmlSchemaValPtr val; /* a schemas value */
35175 for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35176 mem_base = xmlMemBlocks();
35177 val = gen_xmlSchemaValPtr(n_val, 0);
35179 ret_val = xmlSchemaGetValType(val);
35180 desret_xmlSchemaValType(ret_val);
35182 des_xmlSchemaValPtr(n_val, val, 0);
35183 xmlResetLastError();
35184 if (mem_base != xmlMemBlocks()) {
35185 printf("Leak of %d blocks found in xmlSchemaGetValType",
35186 xmlMemBlocks() - mem_base);
35188 printf(" %d", n_val);
35200 test_xmlSchemaInitTypes(void) {
35203 #if defined(LIBXML_SCHEMAS_ENABLED)
35206 xmlSchemaInitTypes();
35208 xmlResetLastError();
35217 test_xmlSchemaIsBuiltInTypeFacet(void) {
35220 #if defined(LIBXML_SCHEMAS_ENABLED)
35223 xmlSchemaTypePtr type; /* the built-in type */
35225 int facetType; /* the facet type */
35228 for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
35229 for (n_facetType = 0;n_facetType < gen_nb_int;n_facetType++) {
35230 mem_base = xmlMemBlocks();
35231 type = gen_xmlSchemaTypePtr(n_type, 0);
35232 facetType = gen_int(n_facetType, 1);
35234 ret_val = xmlSchemaIsBuiltInTypeFacet(type, facetType);
35235 desret_int(ret_val);
35237 des_xmlSchemaTypePtr(n_type, type, 0);
35238 des_int(n_facetType, facetType, 1);
35239 xmlResetLastError();
35240 if (mem_base != xmlMemBlocks()) {
35241 printf("Leak of %d blocks found in xmlSchemaIsBuiltInTypeFacet",
35242 xmlMemBlocks() - mem_base);
35244 printf(" %d", n_type);
35245 printf(" %d", n_facetType);
35258 test_xmlSchemaNewFacet(void) {
35262 /* missing type support */
35268 test_xmlSchemaNewNOTATIONValue(void) {
35272 /* missing type support */
35278 test_xmlSchemaNewQNameValue(void) {
35282 /* missing type support */
35288 test_xmlSchemaNewStringValue(void) {
35292 /* missing type support */
35296 #ifdef LIBXML_SCHEMAS_ENABLED
35298 #define gen_nb_xmlSchemaValPtr_ptr 1
35299 static xmlSchemaValPtr * gen_xmlSchemaValPtr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
35302 static void des_xmlSchemaValPtr_ptr(int no ATTRIBUTE_UNUSED, xmlSchemaValPtr * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
35308 test_xmlSchemaValPredefTypeNode(void) {
35311 #if defined(LIBXML_SCHEMAS_ENABLED)
35314 xmlSchemaTypePtr type; /* the predefined type */
35316 xmlChar * value; /* the value to check */
35318 xmlSchemaValPtr * val; /* the return computed value */
35320 xmlNodePtr node; /* the node containing the value */
35323 for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
35324 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35325 for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr_ptr;n_val++) {
35326 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
35327 mem_base = xmlMemBlocks();
35328 type = gen_xmlSchemaTypePtr(n_type, 0);
35329 value = gen_const_xmlChar_ptr(n_value, 1);
35330 val = gen_xmlSchemaValPtr_ptr(n_val, 2);
35331 node = gen_xmlNodePtr(n_node, 3);
35333 ret_val = xmlSchemaValPredefTypeNode(type, (const xmlChar *)value, val, node);
35334 desret_int(ret_val);
35336 des_xmlSchemaTypePtr(n_type, type, 0);
35337 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
35338 des_xmlSchemaValPtr_ptr(n_val, val, 2);
35339 des_xmlNodePtr(n_node, node, 3);
35340 xmlResetLastError();
35341 if (mem_base != xmlMemBlocks()) {
35342 printf("Leak of %d blocks found in xmlSchemaValPredefTypeNode",
35343 xmlMemBlocks() - mem_base);
35345 printf(" %d", n_type);
35346 printf(" %d", n_value);
35347 printf(" %d", n_val);
35348 printf(" %d", n_node);
35363 test_xmlSchemaValPredefTypeNodeNoNorm(void) {
35366 #if defined(LIBXML_SCHEMAS_ENABLED)
35369 xmlSchemaTypePtr type; /* the predefined type */
35371 xmlChar * value; /* the value to check */
35373 xmlSchemaValPtr * val; /* the return computed value */
35375 xmlNodePtr node; /* the node containing the value */
35378 for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
35379 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35380 for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr_ptr;n_val++) {
35381 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
35382 mem_base = xmlMemBlocks();
35383 type = gen_xmlSchemaTypePtr(n_type, 0);
35384 value = gen_const_xmlChar_ptr(n_value, 1);
35385 val = gen_xmlSchemaValPtr_ptr(n_val, 2);
35386 node = gen_xmlNodePtr(n_node, 3);
35388 ret_val = xmlSchemaValPredefTypeNodeNoNorm(type, (const xmlChar *)value, val, node);
35389 desret_int(ret_val);
35391 des_xmlSchemaTypePtr(n_type, type, 0);
35392 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
35393 des_xmlSchemaValPtr_ptr(n_val, val, 2);
35394 des_xmlNodePtr(n_node, node, 3);
35395 xmlResetLastError();
35396 if (mem_base != xmlMemBlocks()) {
35397 printf("Leak of %d blocks found in xmlSchemaValPredefTypeNodeNoNorm",
35398 xmlMemBlocks() - mem_base);
35400 printf(" %d", n_type);
35401 printf(" %d", n_value);
35402 printf(" %d", n_val);
35403 printf(" %d", n_node);
35418 test_xmlSchemaValidateFacet(void) {
35421 #if defined(LIBXML_SCHEMAS_ENABLED)
35424 xmlSchemaTypePtr base; /* the base type */
35426 xmlSchemaFacetPtr facet; /* the facet to check */
35428 xmlChar * value; /* the lexical repr of the value to validate */
35430 xmlSchemaValPtr val; /* the precomputed value */
35433 for (n_base = 0;n_base < gen_nb_xmlSchemaTypePtr;n_base++) {
35434 for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
35435 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35436 for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35437 mem_base = xmlMemBlocks();
35438 base = gen_xmlSchemaTypePtr(n_base, 0);
35439 facet = gen_xmlSchemaFacetPtr(n_facet, 1);
35440 value = gen_const_xmlChar_ptr(n_value, 2);
35441 val = gen_xmlSchemaValPtr(n_val, 3);
35443 ret_val = xmlSchemaValidateFacet(base, facet, (const xmlChar *)value, val);
35444 desret_int(ret_val);
35446 des_xmlSchemaTypePtr(n_base, base, 0);
35447 des_xmlSchemaFacetPtr(n_facet, facet, 1);
35448 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
35449 des_xmlSchemaValPtr(n_val, val, 3);
35450 xmlResetLastError();
35451 if (mem_base != xmlMemBlocks()) {
35452 printf("Leak of %d blocks found in xmlSchemaValidateFacet",
35453 xmlMemBlocks() - mem_base);
35455 printf(" %d", n_base);
35456 printf(" %d", n_facet);
35457 printf(" %d", n_value);
35458 printf(" %d", n_val);
35473 test_xmlSchemaValidateFacetWhtsp(void) {
35476 #if defined(LIBXML_SCHEMAS_ENABLED)
35479 xmlSchemaFacetPtr facet; /* the facet to check */
35481 xmlSchemaWhitespaceValueType fws; /* the whitespace type of the facet's value */
35483 xmlSchemaValType valType; /* the built-in type of the value */
35485 xmlChar * value; /* the lexical (or normalized for pattern) repr of the value to validate */
35487 xmlSchemaValPtr val; /* the precomputed value */
35489 xmlSchemaWhitespaceValueType ws; /* the whitespace type of the value */
35492 for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
35493 for (n_fws = 0;n_fws < gen_nb_xmlSchemaWhitespaceValueType;n_fws++) {
35494 for (n_valType = 0;n_valType < gen_nb_xmlSchemaValType;n_valType++) {
35495 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35496 for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35497 for (n_ws = 0;n_ws < gen_nb_xmlSchemaWhitespaceValueType;n_ws++) {
35498 mem_base = xmlMemBlocks();
35499 facet = gen_xmlSchemaFacetPtr(n_facet, 0);
35500 fws = gen_xmlSchemaWhitespaceValueType(n_fws, 1);
35501 valType = gen_xmlSchemaValType(n_valType, 2);
35502 value = gen_const_xmlChar_ptr(n_value, 3);
35503 val = gen_xmlSchemaValPtr(n_val, 4);
35504 ws = gen_xmlSchemaWhitespaceValueType(n_ws, 5);
35506 ret_val = xmlSchemaValidateFacetWhtsp(facet, fws, valType, (const xmlChar *)value, val, ws);
35507 desret_int(ret_val);
35509 des_xmlSchemaFacetPtr(n_facet, facet, 0);
35510 des_xmlSchemaWhitespaceValueType(n_fws, fws, 1);
35511 des_xmlSchemaValType(n_valType, valType, 2);
35512 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
35513 des_xmlSchemaValPtr(n_val, val, 4);
35514 des_xmlSchemaWhitespaceValueType(n_ws, ws, 5);
35515 xmlResetLastError();
35516 if (mem_base != xmlMemBlocks()) {
35517 printf("Leak of %d blocks found in xmlSchemaValidateFacetWhtsp",
35518 xmlMemBlocks() - mem_base);
35520 printf(" %d", n_facet);
35521 printf(" %d", n_fws);
35522 printf(" %d", n_valType);
35523 printf(" %d", n_value);
35524 printf(" %d", n_val);
35525 printf(" %d", n_ws);
35542 test_xmlSchemaValidateLengthFacet(void) {
35545 #if defined(LIBXML_SCHEMAS_ENABLED)
35548 xmlSchemaTypePtr type; /* the built-in type */
35550 xmlSchemaFacetPtr facet; /* the facet to check */
35552 xmlChar * value; /* the lexical repr. of the value to be validated */
35554 xmlSchemaValPtr val; /* the precomputed value */
35556 unsigned long * length; /* the actual length of the value */
35559 for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
35560 for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
35561 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35562 for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35563 for (n_length = 0;n_length < gen_nb_unsigned_long_ptr;n_length++) {
35564 mem_base = xmlMemBlocks();
35565 type = gen_xmlSchemaTypePtr(n_type, 0);
35566 facet = gen_xmlSchemaFacetPtr(n_facet, 1);
35567 value = gen_const_xmlChar_ptr(n_value, 2);
35568 val = gen_xmlSchemaValPtr(n_val, 3);
35569 length = gen_unsigned_long_ptr(n_length, 4);
35571 ret_val = xmlSchemaValidateLengthFacet(type, facet, (const xmlChar *)value, val, length);
35572 desret_int(ret_val);
35574 des_xmlSchemaTypePtr(n_type, type, 0);
35575 des_xmlSchemaFacetPtr(n_facet, facet, 1);
35576 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
35577 des_xmlSchemaValPtr(n_val, val, 3);
35578 des_unsigned_long_ptr(n_length, length, 4);
35579 xmlResetLastError();
35580 if (mem_base != xmlMemBlocks()) {
35581 printf("Leak of %d blocks found in xmlSchemaValidateLengthFacet",
35582 xmlMemBlocks() - mem_base);
35584 printf(" %d", n_type);
35585 printf(" %d", n_facet);
35586 printf(" %d", n_value);
35587 printf(" %d", n_val);
35588 printf(" %d", n_length);
35604 test_xmlSchemaValidateLengthFacetWhtsp(void) {
35607 #if defined(LIBXML_SCHEMAS_ENABLED)
35610 xmlSchemaFacetPtr facet; /* the facet to check */
35612 xmlSchemaValType valType; /* the built-in type */
35614 xmlChar * value; /* the lexical repr. of the value to be validated */
35616 xmlSchemaValPtr val; /* the precomputed value */
35618 unsigned long * length; /* the actual length of the value */
35620 xmlSchemaWhitespaceValueType ws; /* the whitespace type of the value */
35623 for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
35624 for (n_valType = 0;n_valType < gen_nb_xmlSchemaValType;n_valType++) {
35625 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35626 for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35627 for (n_length = 0;n_length < gen_nb_unsigned_long_ptr;n_length++) {
35628 for (n_ws = 0;n_ws < gen_nb_xmlSchemaWhitespaceValueType;n_ws++) {
35629 mem_base = xmlMemBlocks();
35630 facet = gen_xmlSchemaFacetPtr(n_facet, 0);
35631 valType = gen_xmlSchemaValType(n_valType, 1);
35632 value = gen_const_xmlChar_ptr(n_value, 2);
35633 val = gen_xmlSchemaValPtr(n_val, 3);
35634 length = gen_unsigned_long_ptr(n_length, 4);
35635 ws = gen_xmlSchemaWhitespaceValueType(n_ws, 5);
35637 ret_val = xmlSchemaValidateLengthFacetWhtsp(facet, valType, (const xmlChar *)value, val, length, ws);
35638 desret_int(ret_val);
35640 des_xmlSchemaFacetPtr(n_facet, facet, 0);
35641 des_xmlSchemaValType(n_valType, valType, 1);
35642 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
35643 des_xmlSchemaValPtr(n_val, val, 3);
35644 des_unsigned_long_ptr(n_length, length, 4);
35645 des_xmlSchemaWhitespaceValueType(n_ws, ws, 5);
35646 xmlResetLastError();
35647 if (mem_base != xmlMemBlocks()) {
35648 printf("Leak of %d blocks found in xmlSchemaValidateLengthFacetWhtsp",
35649 xmlMemBlocks() - mem_base);
35651 printf(" %d", n_facet);
35652 printf(" %d", n_valType);
35653 printf(" %d", n_value);
35654 printf(" %d", n_val);
35655 printf(" %d", n_length);
35656 printf(" %d", n_ws);
35673 test_xmlSchemaValidateListSimpleTypeFacet(void) {
35676 #if defined(LIBXML_SCHEMAS_ENABLED)
35679 xmlSchemaFacetPtr facet; /* the facet to check */
35681 xmlChar * value; /* the lexical repr of the value to validate */
35683 unsigned long actualLen; /* the number of list items */
35685 unsigned long * expectedLen; /* the resulting expected number of list items */
35688 for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
35689 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35690 for (n_actualLen = 0;n_actualLen < gen_nb_unsigned_long;n_actualLen++) {
35691 for (n_expectedLen = 0;n_expectedLen < gen_nb_unsigned_long_ptr;n_expectedLen++) {
35692 mem_base = xmlMemBlocks();
35693 facet = gen_xmlSchemaFacetPtr(n_facet, 0);
35694 value = gen_const_xmlChar_ptr(n_value, 1);
35695 actualLen = gen_unsigned_long(n_actualLen, 2);
35696 expectedLen = gen_unsigned_long_ptr(n_expectedLen, 3);
35698 ret_val = xmlSchemaValidateListSimpleTypeFacet(facet, (const xmlChar *)value, actualLen, expectedLen);
35699 desret_int(ret_val);
35701 des_xmlSchemaFacetPtr(n_facet, facet, 0);
35702 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
35703 des_unsigned_long(n_actualLen, actualLen, 2);
35704 des_unsigned_long_ptr(n_expectedLen, expectedLen, 3);
35705 xmlResetLastError();
35706 if (mem_base != xmlMemBlocks()) {
35707 printf("Leak of %d blocks found in xmlSchemaValidateListSimpleTypeFacet",
35708 xmlMemBlocks() - mem_base);
35710 printf(" %d", n_facet);
35711 printf(" %d", n_value);
35712 printf(" %d", n_actualLen);
35713 printf(" %d", n_expectedLen);
35728 test_xmlSchemaValidatePredefinedType(void) {
35731 #if defined(LIBXML_SCHEMAS_ENABLED)
35734 xmlSchemaTypePtr type; /* the predefined type */
35736 xmlChar * value; /* the value to check */
35738 xmlSchemaValPtr * val; /* the return computed value */
35741 for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
35742 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35743 for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr_ptr;n_val++) {
35744 mem_base = xmlMemBlocks();
35745 type = gen_xmlSchemaTypePtr(n_type, 0);
35746 value = gen_const_xmlChar_ptr(n_value, 1);
35747 val = gen_xmlSchemaValPtr_ptr(n_val, 2);
35749 ret_val = xmlSchemaValidatePredefinedType(type, (const xmlChar *)value, val);
35750 desret_int(ret_val);
35752 des_xmlSchemaTypePtr(n_type, type, 0);
35753 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
35754 des_xmlSchemaValPtr_ptr(n_val, val, 2);
35755 xmlResetLastError();
35756 if (mem_base != xmlMemBlocks()) {
35757 printf("Leak of %d blocks found in xmlSchemaValidatePredefinedType",
35758 xmlMemBlocks() - mem_base);
35760 printf(" %d", n_type);
35761 printf(" %d", n_value);
35762 printf(" %d", n_val);
35776 test_xmlSchemaValueAppend(void) {
35779 #if defined(LIBXML_SCHEMAS_ENABLED)
35782 xmlSchemaValPtr prev; /* the value */
35784 xmlSchemaValPtr cur; /* the value to be appended */
35787 for (n_prev = 0;n_prev < gen_nb_xmlSchemaValPtr;n_prev++) {
35788 for (n_cur = 0;n_cur < gen_nb_xmlSchemaValPtr;n_cur++) {
35789 mem_base = xmlMemBlocks();
35790 prev = gen_xmlSchemaValPtr(n_prev, 0);
35791 cur = gen_xmlSchemaValPtr(n_cur, 1);
35793 ret_val = xmlSchemaValueAppend(prev, cur);
35794 desret_int(ret_val);
35796 des_xmlSchemaValPtr(n_prev, prev, 0);
35797 des_xmlSchemaValPtr(n_cur, cur, 1);
35798 xmlResetLastError();
35799 if (mem_base != xmlMemBlocks()) {
35800 printf("Leak of %d blocks found in xmlSchemaValueAppend",
35801 xmlMemBlocks() - mem_base);
35803 printf(" %d", n_prev);
35804 printf(" %d", n_cur);
35817 test_xmlSchemaValueGetAsBoolean(void) {
35820 #if defined(LIBXML_SCHEMAS_ENABLED)
35823 xmlSchemaValPtr val; /* the value */
35826 for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35827 mem_base = xmlMemBlocks();
35828 val = gen_xmlSchemaValPtr(n_val, 0);
35830 ret_val = xmlSchemaValueGetAsBoolean(val);
35831 desret_int(ret_val);
35833 des_xmlSchemaValPtr(n_val, val, 0);
35834 xmlResetLastError();
35835 if (mem_base != xmlMemBlocks()) {
35836 printf("Leak of %d blocks found in xmlSchemaValueGetAsBoolean",
35837 xmlMemBlocks() - mem_base);
35839 printf(" %d", n_val);
35851 test_xmlSchemaValueGetAsString(void) {
35854 #if defined(LIBXML_SCHEMAS_ENABLED)
35856 const xmlChar * ret_val;
35857 xmlSchemaValPtr val; /* the value */
35860 for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35861 mem_base = xmlMemBlocks();
35862 val = gen_xmlSchemaValPtr(n_val, 0);
35864 ret_val = xmlSchemaValueGetAsString(val);
35865 desret_const_xmlChar_ptr(ret_val);
35867 des_xmlSchemaValPtr(n_val, val, 0);
35868 xmlResetLastError();
35869 if (mem_base != xmlMemBlocks()) {
35870 printf("Leak of %d blocks found in xmlSchemaValueGetAsString",
35871 xmlMemBlocks() - mem_base);
35873 printf(" %d", n_val);
35885 test_xmlSchemaValueGetNext(void) {
35889 /* missing type support */
35895 test_xmlSchemaWhiteSpaceReplace(void) {
35898 #if defined(LIBXML_SCHEMAS_ENABLED)
35901 xmlChar * value; /* a value */
35904 for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35905 mem_base = xmlMemBlocks();
35906 value = gen_const_xmlChar_ptr(n_value, 0);
35908 ret_val = xmlSchemaWhiteSpaceReplace((const xmlChar *)value);
35909 desret_xmlChar_ptr(ret_val);
35911 des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
35912 xmlResetLastError();
35913 if (mem_base != xmlMemBlocks()) {
35914 printf("Leak of %d blocks found in xmlSchemaWhiteSpaceReplace",
35915 xmlMemBlocks() - mem_base);
35917 printf(" %d", n_value);
35928 test_xmlschemastypes(void) {
35931 if (quiet == 0) printf("Testing xmlschemastypes : 26 of 34 functions ...\n");
35932 test_ret += test_xmlSchemaCheckFacet();
35933 test_ret += test_xmlSchemaCleanupTypes();
35934 test_ret += test_xmlSchemaCollapseString();
35935 test_ret += test_xmlSchemaCompareValues();
35936 test_ret += test_xmlSchemaCompareValuesWhtsp();
35937 test_ret += test_xmlSchemaCopyValue();
35938 test_ret += test_xmlSchemaGetBuiltInListSimpleTypeItemType();
35939 test_ret += test_xmlSchemaGetBuiltInType();
35940 test_ret += test_xmlSchemaGetCanonValue();
35941 test_ret += test_xmlSchemaGetCanonValueWhtsp();
35942 test_ret += test_xmlSchemaGetFacetValueAsULong();
35943 test_ret += test_xmlSchemaGetPredefinedType();
35944 test_ret += test_xmlSchemaGetValType();
35945 test_ret += test_xmlSchemaInitTypes();
35946 test_ret += test_xmlSchemaIsBuiltInTypeFacet();
35947 test_ret += test_xmlSchemaNewFacet();
35948 test_ret += test_xmlSchemaNewNOTATIONValue();
35949 test_ret += test_xmlSchemaNewQNameValue();
35950 test_ret += test_xmlSchemaNewStringValue();
35951 test_ret += test_xmlSchemaValPredefTypeNode();
35952 test_ret += test_xmlSchemaValPredefTypeNodeNoNorm();
35953 test_ret += test_xmlSchemaValidateFacet();
35954 test_ret += test_xmlSchemaValidateFacetWhtsp();
35955 test_ret += test_xmlSchemaValidateLengthFacet();
35956 test_ret += test_xmlSchemaValidateLengthFacetWhtsp();
35957 test_ret += test_xmlSchemaValidateListSimpleTypeFacet();
35958 test_ret += test_xmlSchemaValidatePredefinedType();
35959 test_ret += test_xmlSchemaValueAppend();
35960 test_ret += test_xmlSchemaValueGetAsBoolean();
35961 test_ret += test_xmlSchemaValueGetAsString();
35962 test_ret += test_xmlSchemaValueGetNext();
35963 test_ret += test_xmlSchemaWhiteSpaceReplace();
35966 printf("Module xmlschemastypes: %d errors\n", test_ret);
35971 test_xmlCharStrdup(void) {
35976 char * cur; /* the input char * */
35979 for (n_cur = 0;n_cur < gen_nb_const_char_ptr;n_cur++) {
35980 mem_base = xmlMemBlocks();
35981 cur = gen_const_char_ptr(n_cur, 0);
35983 ret_val = xmlCharStrdup((const char *)cur);
35984 desret_xmlChar_ptr(ret_val);
35986 des_const_char_ptr(n_cur, (const char *)cur, 0);
35987 xmlResetLastError();
35988 if (mem_base != xmlMemBlocks()) {
35989 printf("Leak of %d blocks found in xmlCharStrdup",
35990 xmlMemBlocks() - mem_base);
35992 printf(" %d", n_cur);
36003 test_xmlCharStrndup(void) {
36008 char * cur; /* the input char * */
36010 int len; /* the len of @cur */
36013 for (n_cur = 0;n_cur < gen_nb_const_char_ptr;n_cur++) {
36014 for (n_len = 0;n_len < gen_nb_int;n_len++) {
36015 mem_base = xmlMemBlocks();
36016 cur = gen_const_char_ptr(n_cur, 0);
36017 len = gen_int(n_len, 1);
36019 ret_val = xmlCharStrndup((const char *)cur, len);
36020 desret_xmlChar_ptr(ret_val);
36022 des_const_char_ptr(n_cur, (const char *)cur, 0);
36023 des_int(n_len, len, 1);
36024 xmlResetLastError();
36025 if (mem_base != xmlMemBlocks()) {
36026 printf("Leak of %d blocks found in xmlCharStrndup",
36027 xmlMemBlocks() - mem_base);
36029 printf(" %d", n_cur);
36030 printf(" %d", n_len);
36042 test_xmlCheckUTF8(void) {
36047 unsigned char * utf; /* Pointer to putative UTF-8 encoded string. */
36050 for (n_utf = 0;n_utf < gen_nb_const_unsigned_char_ptr;n_utf++) {
36051 mem_base = xmlMemBlocks();
36052 utf = gen_const_unsigned_char_ptr(n_utf, 0);
36054 ret_val = xmlCheckUTF8((const unsigned char *)utf);
36055 desret_int(ret_val);
36057 des_const_unsigned_char_ptr(n_utf, (const unsigned char *)utf, 0);
36058 xmlResetLastError();
36059 if (mem_base != xmlMemBlocks()) {
36060 printf("Leak of %d blocks found in xmlCheckUTF8",
36061 xmlMemBlocks() - mem_base);
36063 printf(" %d", n_utf);
36074 test_xmlGetUTF8Char(void) {
36079 unsigned char * utf; /* a sequence of UTF-8 encoded bytes */
36081 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. */
36084 for (n_utf = 0;n_utf < gen_nb_const_unsigned_char_ptr;n_utf++) {
36085 for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
36086 mem_base = xmlMemBlocks();
36087 utf = gen_const_unsigned_char_ptr(n_utf, 0);
36088 len = gen_int_ptr(n_len, 1);
36090 ret_val = xmlGetUTF8Char((const unsigned char *)utf, len);
36091 desret_int(ret_val);
36093 des_const_unsigned_char_ptr(n_utf, (const unsigned char *)utf, 0);
36094 des_int_ptr(n_len, len, 1);
36095 xmlResetLastError();
36096 if (mem_base != xmlMemBlocks()) {
36097 printf("Leak of %d blocks found in xmlGetUTF8Char",
36098 xmlMemBlocks() - mem_base);
36100 printf(" %d", n_utf);
36101 printf(" %d", n_len);
36113 test_xmlStrEqual(void) {
36118 xmlChar * str1; /* the first xmlChar * */
36120 xmlChar * str2; /* the second xmlChar * */
36123 for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
36124 for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
36125 mem_base = xmlMemBlocks();
36126 str1 = gen_const_xmlChar_ptr(n_str1, 0);
36127 str2 = gen_const_xmlChar_ptr(n_str2, 1);
36129 ret_val = xmlStrEqual((const xmlChar *)str1, (const xmlChar *)str2);
36130 desret_int(ret_val);
36132 des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
36133 des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
36134 xmlResetLastError();
36135 if (mem_base != xmlMemBlocks()) {
36136 printf("Leak of %d blocks found in xmlStrEqual",
36137 xmlMemBlocks() - mem_base);
36139 printf(" %d", n_str1);
36140 printf(" %d", n_str2);
36152 test_xmlStrPrintf(void) {
36156 /* missing type support */
36162 test_xmlStrQEqual(void) {
36167 xmlChar * pref; /* the prefix of the QName */
36169 xmlChar * name; /* the localname of the QName */
36171 xmlChar * str; /* the second xmlChar * */
36174 for (n_pref = 0;n_pref < gen_nb_const_xmlChar_ptr;n_pref++) {
36175 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
36176 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
36177 mem_base = xmlMemBlocks();
36178 pref = gen_const_xmlChar_ptr(n_pref, 0);
36179 name = gen_const_xmlChar_ptr(n_name, 1);
36180 str = gen_const_xmlChar_ptr(n_str, 2);
36182 ret_val = xmlStrQEqual((const xmlChar *)pref, (const xmlChar *)name, (const xmlChar *)str);
36183 desret_int(ret_val);
36185 des_const_xmlChar_ptr(n_pref, (const xmlChar *)pref, 0);
36186 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
36187 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 2);
36188 xmlResetLastError();
36189 if (mem_base != xmlMemBlocks()) {
36190 printf("Leak of %d blocks found in xmlStrQEqual",
36191 xmlMemBlocks() - mem_base);
36193 printf(" %d", n_pref);
36194 printf(" %d", n_name);
36195 printf(" %d", n_str);
36208 test_xmlStrVPrintf(void) {
36212 /* missing type support */
36218 test_xmlStrcasecmp(void) {
36223 xmlChar * str1; /* the first xmlChar * */
36225 xmlChar * str2; /* the second xmlChar * */
36228 for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
36229 for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
36230 mem_base = xmlMemBlocks();
36231 str1 = gen_const_xmlChar_ptr(n_str1, 0);
36232 str2 = gen_const_xmlChar_ptr(n_str2, 1);
36234 ret_val = xmlStrcasecmp((const xmlChar *)str1, (const xmlChar *)str2);
36235 desret_int(ret_val);
36237 des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
36238 des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
36239 xmlResetLastError();
36240 if (mem_base != xmlMemBlocks()) {
36241 printf("Leak of %d blocks found in xmlStrcasecmp",
36242 xmlMemBlocks() - mem_base);
36244 printf(" %d", n_str1);
36245 printf(" %d", n_str2);
36257 test_xmlStrcasestr(void) {
36261 const xmlChar * ret_val;
36262 xmlChar * str; /* the xmlChar * array (haystack) */
36264 xmlChar * val; /* the xmlChar to search (needle) */
36267 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
36268 for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
36269 mem_base = xmlMemBlocks();
36270 str = gen_const_xmlChar_ptr(n_str, 0);
36271 val = gen_const_xmlChar_ptr(n_val, 1);
36273 ret_val = xmlStrcasestr((const xmlChar *)str, (const xmlChar *)val);
36274 desret_const_xmlChar_ptr(ret_val);
36276 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
36277 des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 1);
36278 xmlResetLastError();
36279 if (mem_base != xmlMemBlocks()) {
36280 printf("Leak of %d blocks found in xmlStrcasestr",
36281 xmlMemBlocks() - mem_base);
36283 printf(" %d", n_str);
36284 printf(" %d", n_val);
36296 test_xmlStrchr(void) {
36300 const xmlChar * ret_val;
36301 xmlChar * str; /* the xmlChar * array */
36303 xmlChar val; /* the xmlChar to search */
36306 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
36307 for (n_val = 0;n_val < gen_nb_xmlChar;n_val++) {
36308 mem_base = xmlMemBlocks();
36309 str = gen_const_xmlChar_ptr(n_str, 0);
36310 val = gen_xmlChar(n_val, 1);
36312 ret_val = xmlStrchr((const xmlChar *)str, val);
36313 desret_const_xmlChar_ptr(ret_val);
36315 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
36316 des_xmlChar(n_val, val, 1);
36317 xmlResetLastError();
36318 if (mem_base != xmlMemBlocks()) {
36319 printf("Leak of %d blocks found in xmlStrchr",
36320 xmlMemBlocks() - mem_base);
36322 printf(" %d", n_str);
36323 printf(" %d", n_val);
36335 test_xmlStrcmp(void) {
36340 xmlChar * str1; /* the first xmlChar * */
36342 xmlChar * str2; /* the second xmlChar * */
36345 for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
36346 for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
36347 mem_base = xmlMemBlocks();
36348 str1 = gen_const_xmlChar_ptr(n_str1, 0);
36349 str2 = gen_const_xmlChar_ptr(n_str2, 1);
36351 ret_val = xmlStrcmp((const xmlChar *)str1, (const xmlChar *)str2);
36352 desret_int(ret_val);
36354 des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
36355 des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
36356 xmlResetLastError();
36357 if (mem_base != xmlMemBlocks()) {
36358 printf("Leak of %d blocks found in xmlStrcmp",
36359 xmlMemBlocks() - mem_base);
36361 printf(" %d", n_str1);
36362 printf(" %d", n_str2);
36374 test_xmlStrdup(void) {
36379 xmlChar * cur; /* the input xmlChar * */
36382 for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
36383 mem_base = xmlMemBlocks();
36384 cur = gen_const_xmlChar_ptr(n_cur, 0);
36386 ret_val = xmlStrdup((const xmlChar *)cur);
36387 desret_xmlChar_ptr(ret_val);
36389 des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
36390 xmlResetLastError();
36391 if (mem_base != xmlMemBlocks()) {
36392 printf("Leak of %d blocks found in xmlStrdup",
36393 xmlMemBlocks() - mem_base);
36395 printf(" %d", n_cur);
36406 test_xmlStrlen(void) {
36411 xmlChar * str; /* the xmlChar * array */
36414 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
36415 mem_base = xmlMemBlocks();
36416 str = gen_const_xmlChar_ptr(n_str, 0);
36418 ret_val = xmlStrlen((const xmlChar *)str);
36419 desret_int(ret_val);
36421 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
36422 xmlResetLastError();
36423 if (mem_base != xmlMemBlocks()) {
36424 printf("Leak of %d blocks found in xmlStrlen",
36425 xmlMemBlocks() - mem_base);
36427 printf(" %d", n_str);
36438 test_xmlStrncasecmp(void) {
36443 xmlChar * str1; /* the first xmlChar * */
36445 xmlChar * str2; /* the second xmlChar * */
36447 int len; /* the max comparison length */
36450 for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
36451 for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
36452 for (n_len = 0;n_len < gen_nb_int;n_len++) {
36453 mem_base = xmlMemBlocks();
36454 str1 = gen_const_xmlChar_ptr(n_str1, 0);
36455 str2 = gen_const_xmlChar_ptr(n_str2, 1);
36456 len = gen_int(n_len, 2);
36458 ret_val = xmlStrncasecmp((const xmlChar *)str1, (const xmlChar *)str2, len);
36459 desret_int(ret_val);
36461 des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
36462 des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
36463 des_int(n_len, len, 2);
36464 xmlResetLastError();
36465 if (mem_base != xmlMemBlocks()) {
36466 printf("Leak of %d blocks found in xmlStrncasecmp",
36467 xmlMemBlocks() - mem_base);
36469 printf(" %d", n_str1);
36470 printf(" %d", n_str2);
36471 printf(" %d", n_len);
36484 test_xmlStrncatNew(void) {
36489 xmlChar * str1; /* first xmlChar string */
36491 xmlChar * str2; /* second xmlChar string */
36493 int len; /* the len of @str2 or < 0 */
36496 for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
36497 for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
36498 for (n_len = 0;n_len < gen_nb_int;n_len++) {
36499 mem_base = xmlMemBlocks();
36500 str1 = gen_const_xmlChar_ptr(n_str1, 0);
36501 str2 = gen_const_xmlChar_ptr(n_str2, 1);
36502 len = gen_int(n_len, 2);
36504 ret_val = xmlStrncatNew((const xmlChar *)str1, (const xmlChar *)str2, len);
36505 desret_xmlChar_ptr(ret_val);
36507 des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
36508 des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
36509 des_int(n_len, len, 2);
36510 xmlResetLastError();
36511 if (mem_base != xmlMemBlocks()) {
36512 printf("Leak of %d blocks found in xmlStrncatNew",
36513 xmlMemBlocks() - mem_base);
36515 printf(" %d", n_str1);
36516 printf(" %d", n_str2);
36517 printf(" %d", n_len);
36530 test_xmlStrncmp(void) {
36535 xmlChar * str1; /* the first xmlChar * */
36537 xmlChar * str2; /* the second xmlChar * */
36539 int len; /* the max comparison length */
36542 for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
36543 for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
36544 for (n_len = 0;n_len < gen_nb_int;n_len++) {
36545 mem_base = xmlMemBlocks();
36546 str1 = gen_const_xmlChar_ptr(n_str1, 0);
36547 str2 = gen_const_xmlChar_ptr(n_str2, 1);
36548 len = gen_int(n_len, 2);
36550 ret_val = xmlStrncmp((const xmlChar *)str1, (const xmlChar *)str2, len);
36551 desret_int(ret_val);
36553 des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
36554 des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
36555 des_int(n_len, len, 2);
36556 xmlResetLastError();
36557 if (mem_base != xmlMemBlocks()) {
36558 printf("Leak of %d blocks found in xmlStrncmp",
36559 xmlMemBlocks() - mem_base);
36561 printf(" %d", n_str1);
36562 printf(" %d", n_str2);
36563 printf(" %d", n_len);
36576 test_xmlStrndup(void) {
36581 xmlChar * cur; /* the input xmlChar * */
36583 int len; /* the len of @cur */
36586 for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
36587 for (n_len = 0;n_len < gen_nb_int;n_len++) {
36588 mem_base = xmlMemBlocks();
36589 cur = gen_const_xmlChar_ptr(n_cur, 0);
36590 len = gen_int(n_len, 1);
36592 ret_val = xmlStrndup((const xmlChar *)cur, len);
36593 desret_xmlChar_ptr(ret_val);
36595 des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
36596 des_int(n_len, len, 1);
36597 xmlResetLastError();
36598 if (mem_base != xmlMemBlocks()) {
36599 printf("Leak of %d blocks found in xmlStrndup",
36600 xmlMemBlocks() - mem_base);
36602 printf(" %d", n_cur);
36603 printf(" %d", n_len);
36615 test_xmlStrstr(void) {
36619 const xmlChar * ret_val;
36620 xmlChar * str; /* the xmlChar * array (haystack) */
36622 xmlChar * val; /* the xmlChar to search (needle) */
36625 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
36626 for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
36627 mem_base = xmlMemBlocks();
36628 str = gen_const_xmlChar_ptr(n_str, 0);
36629 val = gen_const_xmlChar_ptr(n_val, 1);
36631 ret_val = xmlStrstr((const xmlChar *)str, (const xmlChar *)val);
36632 desret_const_xmlChar_ptr(ret_val);
36634 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
36635 des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 1);
36636 xmlResetLastError();
36637 if (mem_base != xmlMemBlocks()) {
36638 printf("Leak of %d blocks found in xmlStrstr",
36639 xmlMemBlocks() - mem_base);
36641 printf(" %d", n_str);
36642 printf(" %d", n_val);
36654 test_xmlStrsub(void) {
36659 xmlChar * str; /* the xmlChar * array (haystack) */
36661 int start; /* the index of the first char (zero based) */
36663 int len; /* the length of the substring */
36666 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
36667 for (n_start = 0;n_start < gen_nb_int;n_start++) {
36668 for (n_len = 0;n_len < gen_nb_int;n_len++) {
36669 mem_base = xmlMemBlocks();
36670 str = gen_const_xmlChar_ptr(n_str, 0);
36671 start = gen_int(n_start, 1);
36672 len = gen_int(n_len, 2);
36674 ret_val = xmlStrsub((const xmlChar *)str, start, len);
36675 desret_xmlChar_ptr(ret_val);
36677 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
36678 des_int(n_start, start, 1);
36679 des_int(n_len, len, 2);
36680 xmlResetLastError();
36681 if (mem_base != xmlMemBlocks()) {
36682 printf("Leak of %d blocks found in xmlStrsub",
36683 xmlMemBlocks() - mem_base);
36685 printf(" %d", n_str);
36686 printf(" %d", n_start);
36687 printf(" %d", n_len);
36700 test_xmlUTF8Charcmp(void) {
36705 xmlChar * utf1; /* pointer to first UTF8 char */
36707 xmlChar * utf2; /* pointer to second UTF8 char */
36710 for (n_utf1 = 0;n_utf1 < gen_nb_const_xmlChar_ptr;n_utf1++) {
36711 for (n_utf2 = 0;n_utf2 < gen_nb_const_xmlChar_ptr;n_utf2++) {
36712 mem_base = xmlMemBlocks();
36713 utf1 = gen_const_xmlChar_ptr(n_utf1, 0);
36714 utf2 = gen_const_xmlChar_ptr(n_utf2, 1);
36716 ret_val = xmlUTF8Charcmp((const xmlChar *)utf1, (const xmlChar *)utf2);
36717 desret_int(ret_val);
36719 des_const_xmlChar_ptr(n_utf1, (const xmlChar *)utf1, 0);
36720 des_const_xmlChar_ptr(n_utf2, (const xmlChar *)utf2, 1);
36721 xmlResetLastError();
36722 if (mem_base != xmlMemBlocks()) {
36723 printf("Leak of %d blocks found in xmlUTF8Charcmp",
36724 xmlMemBlocks() - mem_base);
36726 printf(" %d", n_utf1);
36727 printf(" %d", n_utf2);
36739 test_xmlUTF8Size(void) {
36744 xmlChar * utf; /* pointer to the UTF8 character */
36747 for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
36748 mem_base = xmlMemBlocks();
36749 utf = gen_const_xmlChar_ptr(n_utf, 0);
36751 ret_val = xmlUTF8Size((const xmlChar *)utf);
36752 desret_int(ret_val);
36754 des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
36755 xmlResetLastError();
36756 if (mem_base != xmlMemBlocks()) {
36757 printf("Leak of %d blocks found in xmlUTF8Size",
36758 xmlMemBlocks() - mem_base);
36760 printf(" %d", n_utf);
36771 test_xmlUTF8Strlen(void) {
36776 xmlChar * utf; /* a sequence of UTF-8 encoded bytes */
36779 for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
36780 mem_base = xmlMemBlocks();
36781 utf = gen_const_xmlChar_ptr(n_utf, 0);
36783 ret_val = xmlUTF8Strlen((const xmlChar *)utf);
36784 desret_int(ret_val);
36786 des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
36787 xmlResetLastError();
36788 if (mem_base != xmlMemBlocks()) {
36789 printf("Leak of %d blocks found in xmlUTF8Strlen",
36790 xmlMemBlocks() - mem_base);
36792 printf(" %d", n_utf);
36803 test_xmlUTF8Strloc(void) {
36808 xmlChar * utf; /* the input UTF8 * */
36810 xmlChar * utfchar; /* the UTF8 character to be found */
36813 for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
36814 for (n_utfchar = 0;n_utfchar < gen_nb_const_xmlChar_ptr;n_utfchar++) {
36815 mem_base = xmlMemBlocks();
36816 utf = gen_const_xmlChar_ptr(n_utf, 0);
36817 utfchar = gen_const_xmlChar_ptr(n_utfchar, 1);
36819 ret_val = xmlUTF8Strloc((const xmlChar *)utf, (const xmlChar *)utfchar);
36820 desret_int(ret_val);
36822 des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
36823 des_const_xmlChar_ptr(n_utfchar, (const xmlChar *)utfchar, 1);
36824 xmlResetLastError();
36825 if (mem_base != xmlMemBlocks()) {
36826 printf("Leak of %d blocks found in xmlUTF8Strloc",
36827 xmlMemBlocks() - mem_base);
36829 printf(" %d", n_utf);
36830 printf(" %d", n_utfchar);
36842 test_xmlUTF8Strndup(void) {
36847 xmlChar * utf; /* the input UTF8 * */
36849 int len; /* the len of @utf (in chars) */
36852 for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
36853 for (n_len = 0;n_len < gen_nb_int;n_len++) {
36854 mem_base = xmlMemBlocks();
36855 utf = gen_const_xmlChar_ptr(n_utf, 0);
36856 len = gen_int(n_len, 1);
36858 ret_val = xmlUTF8Strndup((const xmlChar *)utf, len);
36859 desret_xmlChar_ptr(ret_val);
36861 des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
36862 des_int(n_len, len, 1);
36863 xmlResetLastError();
36864 if (mem_base != xmlMemBlocks()) {
36865 printf("Leak of %d blocks found in xmlUTF8Strndup",
36866 xmlMemBlocks() - mem_base);
36868 printf(" %d", n_utf);
36869 printf(" %d", n_len);
36881 test_xmlUTF8Strpos(void) {
36885 const xmlChar * ret_val;
36886 xmlChar * utf; /* the input UTF8 * */
36888 int pos; /* the position of the desired UTF8 char (in chars) */
36891 for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
36892 for (n_pos = 0;n_pos < gen_nb_int;n_pos++) {
36893 mem_base = xmlMemBlocks();
36894 utf = gen_const_xmlChar_ptr(n_utf, 0);
36895 pos = gen_int(n_pos, 1);
36897 ret_val = xmlUTF8Strpos((const xmlChar *)utf, pos);
36898 desret_const_xmlChar_ptr(ret_val);
36900 des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
36901 des_int(n_pos, pos, 1);
36902 xmlResetLastError();
36903 if (mem_base != xmlMemBlocks()) {
36904 printf("Leak of %d blocks found in xmlUTF8Strpos",
36905 xmlMemBlocks() - mem_base);
36907 printf(" %d", n_utf);
36908 printf(" %d", n_pos);
36920 test_xmlUTF8Strsize(void) {
36925 xmlChar * utf; /* a sequence of UTF-8 encoded bytes */
36927 int len; /* the number of characters in the array */
36930 for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
36931 for (n_len = 0;n_len < gen_nb_int;n_len++) {
36932 mem_base = xmlMemBlocks();
36933 utf = gen_const_xmlChar_ptr(n_utf, 0);
36934 len = gen_int(n_len, 1);
36936 ret_val = xmlUTF8Strsize((const xmlChar *)utf, len);
36937 desret_int(ret_val);
36939 des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
36940 des_int(n_len, len, 1);
36941 xmlResetLastError();
36942 if (mem_base != xmlMemBlocks()) {
36943 printf("Leak of %d blocks found in xmlUTF8Strsize",
36944 xmlMemBlocks() - mem_base);
36946 printf(" %d", n_utf);
36947 printf(" %d", n_len);
36959 test_xmlUTF8Strsub(void) {
36964 xmlChar * utf; /* a sequence of UTF-8 encoded bytes */
36966 int start; /* relative pos of first char */
36968 int len; /* total number to copy */
36971 for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
36972 for (n_start = 0;n_start < gen_nb_int;n_start++) {
36973 for (n_len = 0;n_len < gen_nb_int;n_len++) {
36974 mem_base = xmlMemBlocks();
36975 utf = gen_const_xmlChar_ptr(n_utf, 0);
36976 start = gen_int(n_start, 1);
36977 len = gen_int(n_len, 2);
36979 ret_val = xmlUTF8Strsub((const xmlChar *)utf, start, len);
36980 desret_xmlChar_ptr(ret_val);
36982 des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
36983 des_int(n_start, start, 1);
36984 des_int(n_len, len, 2);
36985 xmlResetLastError();
36986 if (mem_base != xmlMemBlocks()) {
36987 printf("Leak of %d blocks found in xmlUTF8Strsub",
36988 xmlMemBlocks() - mem_base);
36990 printf(" %d", n_utf);
36991 printf(" %d", n_start);
36992 printf(" %d", n_len);
37004 test_xmlstring(void) {
37007 if (quiet == 0) printf("Testing xmlstring : 26 of 30 functions ...\n");
37008 test_ret += test_xmlCharStrdup();
37009 test_ret += test_xmlCharStrndup();
37010 test_ret += test_xmlCheckUTF8();
37011 test_ret += test_xmlGetUTF8Char();
37012 test_ret += test_xmlStrEqual();
37013 test_ret += test_xmlStrPrintf();
37014 test_ret += test_xmlStrQEqual();
37015 test_ret += test_xmlStrVPrintf();
37016 test_ret += test_xmlStrcasecmp();
37017 test_ret += test_xmlStrcasestr();
37018 test_ret += test_xmlStrchr();
37019 test_ret += test_xmlStrcmp();
37020 test_ret += test_xmlStrdup();
37021 test_ret += test_xmlStrlen();
37022 test_ret += test_xmlStrncasecmp();
37023 test_ret += test_xmlStrncatNew();
37024 test_ret += test_xmlStrncmp();
37025 test_ret += test_xmlStrndup();
37026 test_ret += test_xmlStrstr();
37027 test_ret += test_xmlStrsub();
37028 test_ret += test_xmlUTF8Charcmp();
37029 test_ret += test_xmlUTF8Size();
37030 test_ret += test_xmlUTF8Strlen();
37031 test_ret += test_xmlUTF8Strloc();
37032 test_ret += test_xmlUTF8Strndup();
37033 test_ret += test_xmlUTF8Strpos();
37034 test_ret += test_xmlUTF8Strsize();
37035 test_ret += test_xmlUTF8Strsub();
37038 printf("Module xmlstring: %d errors\n", test_ret);
37043 test_xmlUCSIsAegeanNumbers(void) {
37046 #if defined(LIBXML_UNICODE_ENABLED)
37049 int code; /* UCS code point */
37052 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37053 mem_base = xmlMemBlocks();
37054 code = gen_int(n_code, 0);
37056 ret_val = xmlUCSIsAegeanNumbers(code);
37057 desret_int(ret_val);
37059 des_int(n_code, code, 0);
37060 xmlResetLastError();
37061 if (mem_base != xmlMemBlocks()) {
37062 printf("Leak of %d blocks found in xmlUCSIsAegeanNumbers",
37063 xmlMemBlocks() - mem_base);
37065 printf(" %d", n_code);
37077 test_xmlUCSIsAlphabeticPresentationForms(void) {
37080 #if defined(LIBXML_UNICODE_ENABLED)
37083 int code; /* UCS code point */
37086 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37087 mem_base = xmlMemBlocks();
37088 code = gen_int(n_code, 0);
37090 ret_val = xmlUCSIsAlphabeticPresentationForms(code);
37091 desret_int(ret_val);
37093 des_int(n_code, code, 0);
37094 xmlResetLastError();
37095 if (mem_base != xmlMemBlocks()) {
37096 printf("Leak of %d blocks found in xmlUCSIsAlphabeticPresentationForms",
37097 xmlMemBlocks() - mem_base);
37099 printf(" %d", n_code);
37111 test_xmlUCSIsArabic(void) {
37114 #if defined(LIBXML_UNICODE_ENABLED)
37117 int code; /* UCS code point */
37120 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37121 mem_base = xmlMemBlocks();
37122 code = gen_int(n_code, 0);
37124 ret_val = xmlUCSIsArabic(code);
37125 desret_int(ret_val);
37127 des_int(n_code, code, 0);
37128 xmlResetLastError();
37129 if (mem_base != xmlMemBlocks()) {
37130 printf("Leak of %d blocks found in xmlUCSIsArabic",
37131 xmlMemBlocks() - mem_base);
37133 printf(" %d", n_code);
37145 test_xmlUCSIsArabicPresentationFormsA(void) {
37148 #if defined(LIBXML_UNICODE_ENABLED)
37151 int code; /* UCS code point */
37154 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37155 mem_base = xmlMemBlocks();
37156 code = gen_int(n_code, 0);
37158 ret_val = xmlUCSIsArabicPresentationFormsA(code);
37159 desret_int(ret_val);
37161 des_int(n_code, code, 0);
37162 xmlResetLastError();
37163 if (mem_base != xmlMemBlocks()) {
37164 printf("Leak of %d blocks found in xmlUCSIsArabicPresentationFormsA",
37165 xmlMemBlocks() - mem_base);
37167 printf(" %d", n_code);
37179 test_xmlUCSIsArabicPresentationFormsB(void) {
37182 #if defined(LIBXML_UNICODE_ENABLED)
37185 int code; /* UCS code point */
37188 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37189 mem_base = xmlMemBlocks();
37190 code = gen_int(n_code, 0);
37192 ret_val = xmlUCSIsArabicPresentationFormsB(code);
37193 desret_int(ret_val);
37195 des_int(n_code, code, 0);
37196 xmlResetLastError();
37197 if (mem_base != xmlMemBlocks()) {
37198 printf("Leak of %d blocks found in xmlUCSIsArabicPresentationFormsB",
37199 xmlMemBlocks() - mem_base);
37201 printf(" %d", n_code);
37213 test_xmlUCSIsArmenian(void) {
37216 #if defined(LIBXML_UNICODE_ENABLED)
37219 int code; /* UCS code point */
37222 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37223 mem_base = xmlMemBlocks();
37224 code = gen_int(n_code, 0);
37226 ret_val = xmlUCSIsArmenian(code);
37227 desret_int(ret_val);
37229 des_int(n_code, code, 0);
37230 xmlResetLastError();
37231 if (mem_base != xmlMemBlocks()) {
37232 printf("Leak of %d blocks found in xmlUCSIsArmenian",
37233 xmlMemBlocks() - mem_base);
37235 printf(" %d", n_code);
37247 test_xmlUCSIsArrows(void) {
37250 #if defined(LIBXML_UNICODE_ENABLED)
37253 int code; /* UCS code point */
37256 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37257 mem_base = xmlMemBlocks();
37258 code = gen_int(n_code, 0);
37260 ret_val = xmlUCSIsArrows(code);
37261 desret_int(ret_val);
37263 des_int(n_code, code, 0);
37264 xmlResetLastError();
37265 if (mem_base != xmlMemBlocks()) {
37266 printf("Leak of %d blocks found in xmlUCSIsArrows",
37267 xmlMemBlocks() - mem_base);
37269 printf(" %d", n_code);
37281 test_xmlUCSIsBasicLatin(void) {
37284 #if defined(LIBXML_UNICODE_ENABLED)
37287 int code; /* UCS code point */
37290 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37291 mem_base = xmlMemBlocks();
37292 code = gen_int(n_code, 0);
37294 ret_val = xmlUCSIsBasicLatin(code);
37295 desret_int(ret_val);
37297 des_int(n_code, code, 0);
37298 xmlResetLastError();
37299 if (mem_base != xmlMemBlocks()) {
37300 printf("Leak of %d blocks found in xmlUCSIsBasicLatin",
37301 xmlMemBlocks() - mem_base);
37303 printf(" %d", n_code);
37315 test_xmlUCSIsBengali(void) {
37318 #if defined(LIBXML_UNICODE_ENABLED)
37321 int code; /* UCS code point */
37324 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37325 mem_base = xmlMemBlocks();
37326 code = gen_int(n_code, 0);
37328 ret_val = xmlUCSIsBengali(code);
37329 desret_int(ret_val);
37331 des_int(n_code, code, 0);
37332 xmlResetLastError();
37333 if (mem_base != xmlMemBlocks()) {
37334 printf("Leak of %d blocks found in xmlUCSIsBengali",
37335 xmlMemBlocks() - mem_base);
37337 printf(" %d", n_code);
37349 test_xmlUCSIsBlock(void) {
37352 #if defined(LIBXML_UNICODE_ENABLED)
37355 int code; /* UCS code point */
37357 char * block; /* UCS block name */
37360 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37361 for (n_block = 0;n_block < gen_nb_const_char_ptr;n_block++) {
37362 mem_base = xmlMemBlocks();
37363 code = gen_int(n_code, 0);
37364 block = gen_const_char_ptr(n_block, 1);
37366 ret_val = xmlUCSIsBlock(code, (const char *)block);
37367 desret_int(ret_val);
37369 des_int(n_code, code, 0);
37370 des_const_char_ptr(n_block, (const char *)block, 1);
37371 xmlResetLastError();
37372 if (mem_base != xmlMemBlocks()) {
37373 printf("Leak of %d blocks found in xmlUCSIsBlock",
37374 xmlMemBlocks() - mem_base);
37376 printf(" %d", n_code);
37377 printf(" %d", n_block);
37390 test_xmlUCSIsBlockElements(void) {
37393 #if defined(LIBXML_UNICODE_ENABLED)
37396 int code; /* UCS code point */
37399 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37400 mem_base = xmlMemBlocks();
37401 code = gen_int(n_code, 0);
37403 ret_val = xmlUCSIsBlockElements(code);
37404 desret_int(ret_val);
37406 des_int(n_code, code, 0);
37407 xmlResetLastError();
37408 if (mem_base != xmlMemBlocks()) {
37409 printf("Leak of %d blocks found in xmlUCSIsBlockElements",
37410 xmlMemBlocks() - mem_base);
37412 printf(" %d", n_code);
37424 test_xmlUCSIsBopomofo(void) {
37427 #if defined(LIBXML_UNICODE_ENABLED)
37430 int code; /* UCS code point */
37433 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37434 mem_base = xmlMemBlocks();
37435 code = gen_int(n_code, 0);
37437 ret_val = xmlUCSIsBopomofo(code);
37438 desret_int(ret_val);
37440 des_int(n_code, code, 0);
37441 xmlResetLastError();
37442 if (mem_base != xmlMemBlocks()) {
37443 printf("Leak of %d blocks found in xmlUCSIsBopomofo",
37444 xmlMemBlocks() - mem_base);
37446 printf(" %d", n_code);
37458 test_xmlUCSIsBopomofoExtended(void) {
37461 #if defined(LIBXML_UNICODE_ENABLED)
37464 int code; /* UCS code point */
37467 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37468 mem_base = xmlMemBlocks();
37469 code = gen_int(n_code, 0);
37471 ret_val = xmlUCSIsBopomofoExtended(code);
37472 desret_int(ret_val);
37474 des_int(n_code, code, 0);
37475 xmlResetLastError();
37476 if (mem_base != xmlMemBlocks()) {
37477 printf("Leak of %d blocks found in xmlUCSIsBopomofoExtended",
37478 xmlMemBlocks() - mem_base);
37480 printf(" %d", n_code);
37492 test_xmlUCSIsBoxDrawing(void) {
37495 #if defined(LIBXML_UNICODE_ENABLED)
37498 int code; /* UCS code point */
37501 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37502 mem_base = xmlMemBlocks();
37503 code = gen_int(n_code, 0);
37505 ret_val = xmlUCSIsBoxDrawing(code);
37506 desret_int(ret_val);
37508 des_int(n_code, code, 0);
37509 xmlResetLastError();
37510 if (mem_base != xmlMemBlocks()) {
37511 printf("Leak of %d blocks found in xmlUCSIsBoxDrawing",
37512 xmlMemBlocks() - mem_base);
37514 printf(" %d", n_code);
37526 test_xmlUCSIsBraillePatterns(void) {
37529 #if defined(LIBXML_UNICODE_ENABLED)
37532 int code; /* UCS code point */
37535 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37536 mem_base = xmlMemBlocks();
37537 code = gen_int(n_code, 0);
37539 ret_val = xmlUCSIsBraillePatterns(code);
37540 desret_int(ret_val);
37542 des_int(n_code, code, 0);
37543 xmlResetLastError();
37544 if (mem_base != xmlMemBlocks()) {
37545 printf("Leak of %d blocks found in xmlUCSIsBraillePatterns",
37546 xmlMemBlocks() - mem_base);
37548 printf(" %d", n_code);
37560 test_xmlUCSIsBuhid(void) {
37563 #if defined(LIBXML_UNICODE_ENABLED)
37566 int code; /* UCS code point */
37569 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37570 mem_base = xmlMemBlocks();
37571 code = gen_int(n_code, 0);
37573 ret_val = xmlUCSIsBuhid(code);
37574 desret_int(ret_val);
37576 des_int(n_code, code, 0);
37577 xmlResetLastError();
37578 if (mem_base != xmlMemBlocks()) {
37579 printf("Leak of %d blocks found in xmlUCSIsBuhid",
37580 xmlMemBlocks() - mem_base);
37582 printf(" %d", n_code);
37594 test_xmlUCSIsByzantineMusicalSymbols(void) {
37597 #if defined(LIBXML_UNICODE_ENABLED)
37600 int code; /* UCS code point */
37603 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37604 mem_base = xmlMemBlocks();
37605 code = gen_int(n_code, 0);
37607 ret_val = xmlUCSIsByzantineMusicalSymbols(code);
37608 desret_int(ret_val);
37610 des_int(n_code, code, 0);
37611 xmlResetLastError();
37612 if (mem_base != xmlMemBlocks()) {
37613 printf("Leak of %d blocks found in xmlUCSIsByzantineMusicalSymbols",
37614 xmlMemBlocks() - mem_base);
37616 printf(" %d", n_code);
37628 test_xmlUCSIsCJKCompatibility(void) {
37631 #if defined(LIBXML_UNICODE_ENABLED)
37634 int code; /* UCS code point */
37637 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37638 mem_base = xmlMemBlocks();
37639 code = gen_int(n_code, 0);
37641 ret_val = xmlUCSIsCJKCompatibility(code);
37642 desret_int(ret_val);
37644 des_int(n_code, code, 0);
37645 xmlResetLastError();
37646 if (mem_base != xmlMemBlocks()) {
37647 printf("Leak of %d blocks found in xmlUCSIsCJKCompatibility",
37648 xmlMemBlocks() - mem_base);
37650 printf(" %d", n_code);
37662 test_xmlUCSIsCJKCompatibilityForms(void) {
37665 #if defined(LIBXML_UNICODE_ENABLED)
37668 int code; /* UCS code point */
37671 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37672 mem_base = xmlMemBlocks();
37673 code = gen_int(n_code, 0);
37675 ret_val = xmlUCSIsCJKCompatibilityForms(code);
37676 desret_int(ret_val);
37678 des_int(n_code, code, 0);
37679 xmlResetLastError();
37680 if (mem_base != xmlMemBlocks()) {
37681 printf("Leak of %d blocks found in xmlUCSIsCJKCompatibilityForms",
37682 xmlMemBlocks() - mem_base);
37684 printf(" %d", n_code);
37696 test_xmlUCSIsCJKCompatibilityIdeographs(void) {
37699 #if defined(LIBXML_UNICODE_ENABLED)
37702 int code; /* UCS code point */
37705 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37706 mem_base = xmlMemBlocks();
37707 code = gen_int(n_code, 0);
37709 ret_val = xmlUCSIsCJKCompatibilityIdeographs(code);
37710 desret_int(ret_val);
37712 des_int(n_code, code, 0);
37713 xmlResetLastError();
37714 if (mem_base != xmlMemBlocks()) {
37715 printf("Leak of %d blocks found in xmlUCSIsCJKCompatibilityIdeographs",
37716 xmlMemBlocks() - mem_base);
37718 printf(" %d", n_code);
37730 test_xmlUCSIsCJKCompatibilityIdeographsSupplement(void) {
37733 #if defined(LIBXML_UNICODE_ENABLED)
37736 int code; /* UCS code point */
37739 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37740 mem_base = xmlMemBlocks();
37741 code = gen_int(n_code, 0);
37743 ret_val = xmlUCSIsCJKCompatibilityIdeographsSupplement(code);
37744 desret_int(ret_val);
37746 des_int(n_code, code, 0);
37747 xmlResetLastError();
37748 if (mem_base != xmlMemBlocks()) {
37749 printf("Leak of %d blocks found in xmlUCSIsCJKCompatibilityIdeographsSupplement",
37750 xmlMemBlocks() - mem_base);
37752 printf(" %d", n_code);
37764 test_xmlUCSIsCJKRadicalsSupplement(void) {
37767 #if defined(LIBXML_UNICODE_ENABLED)
37770 int code; /* UCS code point */
37773 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37774 mem_base = xmlMemBlocks();
37775 code = gen_int(n_code, 0);
37777 ret_val = xmlUCSIsCJKRadicalsSupplement(code);
37778 desret_int(ret_val);
37780 des_int(n_code, code, 0);
37781 xmlResetLastError();
37782 if (mem_base != xmlMemBlocks()) {
37783 printf("Leak of %d blocks found in xmlUCSIsCJKRadicalsSupplement",
37784 xmlMemBlocks() - mem_base);
37786 printf(" %d", n_code);
37798 test_xmlUCSIsCJKSymbolsandPunctuation(void) {
37801 #if defined(LIBXML_UNICODE_ENABLED)
37804 int code; /* UCS code point */
37807 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37808 mem_base = xmlMemBlocks();
37809 code = gen_int(n_code, 0);
37811 ret_val = xmlUCSIsCJKSymbolsandPunctuation(code);
37812 desret_int(ret_val);
37814 des_int(n_code, code, 0);
37815 xmlResetLastError();
37816 if (mem_base != xmlMemBlocks()) {
37817 printf("Leak of %d blocks found in xmlUCSIsCJKSymbolsandPunctuation",
37818 xmlMemBlocks() - mem_base);
37820 printf(" %d", n_code);
37832 test_xmlUCSIsCJKUnifiedIdeographs(void) {
37835 #if defined(LIBXML_UNICODE_ENABLED)
37838 int code; /* UCS code point */
37841 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37842 mem_base = xmlMemBlocks();
37843 code = gen_int(n_code, 0);
37845 ret_val = xmlUCSIsCJKUnifiedIdeographs(code);
37846 desret_int(ret_val);
37848 des_int(n_code, code, 0);
37849 xmlResetLastError();
37850 if (mem_base != xmlMemBlocks()) {
37851 printf("Leak of %d blocks found in xmlUCSIsCJKUnifiedIdeographs",
37852 xmlMemBlocks() - mem_base);
37854 printf(" %d", n_code);
37866 test_xmlUCSIsCJKUnifiedIdeographsExtensionA(void) {
37869 #if defined(LIBXML_UNICODE_ENABLED)
37872 int code; /* UCS code point */
37875 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37876 mem_base = xmlMemBlocks();
37877 code = gen_int(n_code, 0);
37879 ret_val = xmlUCSIsCJKUnifiedIdeographsExtensionA(code);
37880 desret_int(ret_val);
37882 des_int(n_code, code, 0);
37883 xmlResetLastError();
37884 if (mem_base != xmlMemBlocks()) {
37885 printf("Leak of %d blocks found in xmlUCSIsCJKUnifiedIdeographsExtensionA",
37886 xmlMemBlocks() - mem_base);
37888 printf(" %d", n_code);
37900 test_xmlUCSIsCJKUnifiedIdeographsExtensionB(void) {
37903 #if defined(LIBXML_UNICODE_ENABLED)
37906 int code; /* UCS code point */
37909 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37910 mem_base = xmlMemBlocks();
37911 code = gen_int(n_code, 0);
37913 ret_val = xmlUCSIsCJKUnifiedIdeographsExtensionB(code);
37914 desret_int(ret_val);
37916 des_int(n_code, code, 0);
37917 xmlResetLastError();
37918 if (mem_base != xmlMemBlocks()) {
37919 printf("Leak of %d blocks found in xmlUCSIsCJKUnifiedIdeographsExtensionB",
37920 xmlMemBlocks() - mem_base);
37922 printf(" %d", n_code);
37934 test_xmlUCSIsCat(void) {
37937 #if defined(LIBXML_UNICODE_ENABLED)
37940 int code; /* UCS code point */
37942 char * cat; /* UCS Category name */
37945 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37946 for (n_cat = 0;n_cat < gen_nb_const_char_ptr;n_cat++) {
37947 mem_base = xmlMemBlocks();
37948 code = gen_int(n_code, 0);
37949 cat = gen_const_char_ptr(n_cat, 1);
37951 ret_val = xmlUCSIsCat(code, (const char *)cat);
37952 desret_int(ret_val);
37954 des_int(n_code, code, 0);
37955 des_const_char_ptr(n_cat, (const char *)cat, 1);
37956 xmlResetLastError();
37957 if (mem_base != xmlMemBlocks()) {
37958 printf("Leak of %d blocks found in xmlUCSIsCat",
37959 xmlMemBlocks() - mem_base);
37961 printf(" %d", n_code);
37962 printf(" %d", n_cat);
37975 test_xmlUCSIsCatC(void) {
37978 #if defined(LIBXML_UNICODE_ENABLED)
37981 int code; /* UCS code point */
37984 for (n_code = 0;n_code < gen_nb_int;n_code++) {
37985 mem_base = xmlMemBlocks();
37986 code = gen_int(n_code, 0);
37988 ret_val = xmlUCSIsCatC(code);
37989 desret_int(ret_val);
37991 des_int(n_code, code, 0);
37992 xmlResetLastError();
37993 if (mem_base != xmlMemBlocks()) {
37994 printf("Leak of %d blocks found in xmlUCSIsCatC",
37995 xmlMemBlocks() - mem_base);
37997 printf(" %d", n_code);
38009 test_xmlUCSIsCatCc(void) {
38012 #if defined(LIBXML_UNICODE_ENABLED)
38015 int code; /* UCS code point */
38018 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38019 mem_base = xmlMemBlocks();
38020 code = gen_int(n_code, 0);
38022 ret_val = xmlUCSIsCatCc(code);
38023 desret_int(ret_val);
38025 des_int(n_code, code, 0);
38026 xmlResetLastError();
38027 if (mem_base != xmlMemBlocks()) {
38028 printf("Leak of %d blocks found in xmlUCSIsCatCc",
38029 xmlMemBlocks() - mem_base);
38031 printf(" %d", n_code);
38043 test_xmlUCSIsCatCf(void) {
38046 #if defined(LIBXML_UNICODE_ENABLED)
38049 int code; /* UCS code point */
38052 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38053 mem_base = xmlMemBlocks();
38054 code = gen_int(n_code, 0);
38056 ret_val = xmlUCSIsCatCf(code);
38057 desret_int(ret_val);
38059 des_int(n_code, code, 0);
38060 xmlResetLastError();
38061 if (mem_base != xmlMemBlocks()) {
38062 printf("Leak of %d blocks found in xmlUCSIsCatCf",
38063 xmlMemBlocks() - mem_base);
38065 printf(" %d", n_code);
38077 test_xmlUCSIsCatCo(void) {
38080 #if defined(LIBXML_UNICODE_ENABLED)
38083 int code; /* UCS code point */
38086 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38087 mem_base = xmlMemBlocks();
38088 code = gen_int(n_code, 0);
38090 ret_val = xmlUCSIsCatCo(code);
38091 desret_int(ret_val);
38093 des_int(n_code, code, 0);
38094 xmlResetLastError();
38095 if (mem_base != xmlMemBlocks()) {
38096 printf("Leak of %d blocks found in xmlUCSIsCatCo",
38097 xmlMemBlocks() - mem_base);
38099 printf(" %d", n_code);
38111 test_xmlUCSIsCatCs(void) {
38114 #if defined(LIBXML_UNICODE_ENABLED)
38117 int code; /* UCS code point */
38120 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38121 mem_base = xmlMemBlocks();
38122 code = gen_int(n_code, 0);
38124 ret_val = xmlUCSIsCatCs(code);
38125 desret_int(ret_val);
38127 des_int(n_code, code, 0);
38128 xmlResetLastError();
38129 if (mem_base != xmlMemBlocks()) {
38130 printf("Leak of %d blocks found in xmlUCSIsCatCs",
38131 xmlMemBlocks() - mem_base);
38133 printf(" %d", n_code);
38145 test_xmlUCSIsCatL(void) {
38148 #if defined(LIBXML_UNICODE_ENABLED)
38151 int code; /* UCS code point */
38154 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38155 mem_base = xmlMemBlocks();
38156 code = gen_int(n_code, 0);
38158 ret_val = xmlUCSIsCatL(code);
38159 desret_int(ret_val);
38161 des_int(n_code, code, 0);
38162 xmlResetLastError();
38163 if (mem_base != xmlMemBlocks()) {
38164 printf("Leak of %d blocks found in xmlUCSIsCatL",
38165 xmlMemBlocks() - mem_base);
38167 printf(" %d", n_code);
38179 test_xmlUCSIsCatLl(void) {
38182 #if defined(LIBXML_UNICODE_ENABLED)
38185 int code; /* UCS code point */
38188 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38189 mem_base = xmlMemBlocks();
38190 code = gen_int(n_code, 0);
38192 ret_val = xmlUCSIsCatLl(code);
38193 desret_int(ret_val);
38195 des_int(n_code, code, 0);
38196 xmlResetLastError();
38197 if (mem_base != xmlMemBlocks()) {
38198 printf("Leak of %d blocks found in xmlUCSIsCatLl",
38199 xmlMemBlocks() - mem_base);
38201 printf(" %d", n_code);
38213 test_xmlUCSIsCatLm(void) {
38216 #if defined(LIBXML_UNICODE_ENABLED)
38219 int code; /* UCS code point */
38222 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38223 mem_base = xmlMemBlocks();
38224 code = gen_int(n_code, 0);
38226 ret_val = xmlUCSIsCatLm(code);
38227 desret_int(ret_val);
38229 des_int(n_code, code, 0);
38230 xmlResetLastError();
38231 if (mem_base != xmlMemBlocks()) {
38232 printf("Leak of %d blocks found in xmlUCSIsCatLm",
38233 xmlMemBlocks() - mem_base);
38235 printf(" %d", n_code);
38247 test_xmlUCSIsCatLo(void) {
38250 #if defined(LIBXML_UNICODE_ENABLED)
38253 int code; /* UCS code point */
38256 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38257 mem_base = xmlMemBlocks();
38258 code = gen_int(n_code, 0);
38260 ret_val = xmlUCSIsCatLo(code);
38261 desret_int(ret_val);
38263 des_int(n_code, code, 0);
38264 xmlResetLastError();
38265 if (mem_base != xmlMemBlocks()) {
38266 printf("Leak of %d blocks found in xmlUCSIsCatLo",
38267 xmlMemBlocks() - mem_base);
38269 printf(" %d", n_code);
38281 test_xmlUCSIsCatLt(void) {
38284 #if defined(LIBXML_UNICODE_ENABLED)
38287 int code; /* UCS code point */
38290 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38291 mem_base = xmlMemBlocks();
38292 code = gen_int(n_code, 0);
38294 ret_val = xmlUCSIsCatLt(code);
38295 desret_int(ret_val);
38297 des_int(n_code, code, 0);
38298 xmlResetLastError();
38299 if (mem_base != xmlMemBlocks()) {
38300 printf("Leak of %d blocks found in xmlUCSIsCatLt",
38301 xmlMemBlocks() - mem_base);
38303 printf(" %d", n_code);
38315 test_xmlUCSIsCatLu(void) {
38318 #if defined(LIBXML_UNICODE_ENABLED)
38321 int code; /* UCS code point */
38324 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38325 mem_base = xmlMemBlocks();
38326 code = gen_int(n_code, 0);
38328 ret_val = xmlUCSIsCatLu(code);
38329 desret_int(ret_val);
38331 des_int(n_code, code, 0);
38332 xmlResetLastError();
38333 if (mem_base != xmlMemBlocks()) {
38334 printf("Leak of %d blocks found in xmlUCSIsCatLu",
38335 xmlMemBlocks() - mem_base);
38337 printf(" %d", n_code);
38349 test_xmlUCSIsCatM(void) {
38352 #if defined(LIBXML_UNICODE_ENABLED)
38355 int code; /* UCS code point */
38358 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38359 mem_base = xmlMemBlocks();
38360 code = gen_int(n_code, 0);
38362 ret_val = xmlUCSIsCatM(code);
38363 desret_int(ret_val);
38365 des_int(n_code, code, 0);
38366 xmlResetLastError();
38367 if (mem_base != xmlMemBlocks()) {
38368 printf("Leak of %d blocks found in xmlUCSIsCatM",
38369 xmlMemBlocks() - mem_base);
38371 printf(" %d", n_code);
38383 test_xmlUCSIsCatMc(void) {
38386 #if defined(LIBXML_UNICODE_ENABLED)
38389 int code; /* UCS code point */
38392 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38393 mem_base = xmlMemBlocks();
38394 code = gen_int(n_code, 0);
38396 ret_val = xmlUCSIsCatMc(code);
38397 desret_int(ret_val);
38399 des_int(n_code, code, 0);
38400 xmlResetLastError();
38401 if (mem_base != xmlMemBlocks()) {
38402 printf("Leak of %d blocks found in xmlUCSIsCatMc",
38403 xmlMemBlocks() - mem_base);
38405 printf(" %d", n_code);
38417 test_xmlUCSIsCatMe(void) {
38420 #if defined(LIBXML_UNICODE_ENABLED)
38423 int code; /* UCS code point */
38426 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38427 mem_base = xmlMemBlocks();
38428 code = gen_int(n_code, 0);
38430 ret_val = xmlUCSIsCatMe(code);
38431 desret_int(ret_val);
38433 des_int(n_code, code, 0);
38434 xmlResetLastError();
38435 if (mem_base != xmlMemBlocks()) {
38436 printf("Leak of %d blocks found in xmlUCSIsCatMe",
38437 xmlMemBlocks() - mem_base);
38439 printf(" %d", n_code);
38451 test_xmlUCSIsCatMn(void) {
38454 #if defined(LIBXML_UNICODE_ENABLED)
38457 int code; /* UCS code point */
38460 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38461 mem_base = xmlMemBlocks();
38462 code = gen_int(n_code, 0);
38464 ret_val = xmlUCSIsCatMn(code);
38465 desret_int(ret_val);
38467 des_int(n_code, code, 0);
38468 xmlResetLastError();
38469 if (mem_base != xmlMemBlocks()) {
38470 printf("Leak of %d blocks found in xmlUCSIsCatMn",
38471 xmlMemBlocks() - mem_base);
38473 printf(" %d", n_code);
38485 test_xmlUCSIsCatN(void) {
38488 #if defined(LIBXML_UNICODE_ENABLED)
38491 int code; /* UCS code point */
38494 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38495 mem_base = xmlMemBlocks();
38496 code = gen_int(n_code, 0);
38498 ret_val = xmlUCSIsCatN(code);
38499 desret_int(ret_val);
38501 des_int(n_code, code, 0);
38502 xmlResetLastError();
38503 if (mem_base != xmlMemBlocks()) {
38504 printf("Leak of %d blocks found in xmlUCSIsCatN",
38505 xmlMemBlocks() - mem_base);
38507 printf(" %d", n_code);
38519 test_xmlUCSIsCatNd(void) {
38522 #if defined(LIBXML_UNICODE_ENABLED)
38525 int code; /* UCS code point */
38528 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38529 mem_base = xmlMemBlocks();
38530 code = gen_int(n_code, 0);
38532 ret_val = xmlUCSIsCatNd(code);
38533 desret_int(ret_val);
38535 des_int(n_code, code, 0);
38536 xmlResetLastError();
38537 if (mem_base != xmlMemBlocks()) {
38538 printf("Leak of %d blocks found in xmlUCSIsCatNd",
38539 xmlMemBlocks() - mem_base);
38541 printf(" %d", n_code);
38553 test_xmlUCSIsCatNl(void) {
38556 #if defined(LIBXML_UNICODE_ENABLED)
38559 int code; /* UCS code point */
38562 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38563 mem_base = xmlMemBlocks();
38564 code = gen_int(n_code, 0);
38566 ret_val = xmlUCSIsCatNl(code);
38567 desret_int(ret_val);
38569 des_int(n_code, code, 0);
38570 xmlResetLastError();
38571 if (mem_base != xmlMemBlocks()) {
38572 printf("Leak of %d blocks found in xmlUCSIsCatNl",
38573 xmlMemBlocks() - mem_base);
38575 printf(" %d", n_code);
38587 test_xmlUCSIsCatNo(void) {
38590 #if defined(LIBXML_UNICODE_ENABLED)
38593 int code; /* UCS code point */
38596 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38597 mem_base = xmlMemBlocks();
38598 code = gen_int(n_code, 0);
38600 ret_val = xmlUCSIsCatNo(code);
38601 desret_int(ret_val);
38603 des_int(n_code, code, 0);
38604 xmlResetLastError();
38605 if (mem_base != xmlMemBlocks()) {
38606 printf("Leak of %d blocks found in xmlUCSIsCatNo",
38607 xmlMemBlocks() - mem_base);
38609 printf(" %d", n_code);
38621 test_xmlUCSIsCatP(void) {
38624 #if defined(LIBXML_UNICODE_ENABLED)
38627 int code; /* UCS code point */
38630 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38631 mem_base = xmlMemBlocks();
38632 code = gen_int(n_code, 0);
38634 ret_val = xmlUCSIsCatP(code);
38635 desret_int(ret_val);
38637 des_int(n_code, code, 0);
38638 xmlResetLastError();
38639 if (mem_base != xmlMemBlocks()) {
38640 printf("Leak of %d blocks found in xmlUCSIsCatP",
38641 xmlMemBlocks() - mem_base);
38643 printf(" %d", n_code);
38655 test_xmlUCSIsCatPc(void) {
38658 #if defined(LIBXML_UNICODE_ENABLED)
38661 int code; /* UCS code point */
38664 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38665 mem_base = xmlMemBlocks();
38666 code = gen_int(n_code, 0);
38668 ret_val = xmlUCSIsCatPc(code);
38669 desret_int(ret_val);
38671 des_int(n_code, code, 0);
38672 xmlResetLastError();
38673 if (mem_base != xmlMemBlocks()) {
38674 printf("Leak of %d blocks found in xmlUCSIsCatPc",
38675 xmlMemBlocks() - mem_base);
38677 printf(" %d", n_code);
38689 test_xmlUCSIsCatPd(void) {
38692 #if defined(LIBXML_UNICODE_ENABLED)
38695 int code; /* UCS code point */
38698 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38699 mem_base = xmlMemBlocks();
38700 code = gen_int(n_code, 0);
38702 ret_val = xmlUCSIsCatPd(code);
38703 desret_int(ret_val);
38705 des_int(n_code, code, 0);
38706 xmlResetLastError();
38707 if (mem_base != xmlMemBlocks()) {
38708 printf("Leak of %d blocks found in xmlUCSIsCatPd",
38709 xmlMemBlocks() - mem_base);
38711 printf(" %d", n_code);
38723 test_xmlUCSIsCatPe(void) {
38726 #if defined(LIBXML_UNICODE_ENABLED)
38729 int code; /* UCS code point */
38732 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38733 mem_base = xmlMemBlocks();
38734 code = gen_int(n_code, 0);
38736 ret_val = xmlUCSIsCatPe(code);
38737 desret_int(ret_val);
38739 des_int(n_code, code, 0);
38740 xmlResetLastError();
38741 if (mem_base != xmlMemBlocks()) {
38742 printf("Leak of %d blocks found in xmlUCSIsCatPe",
38743 xmlMemBlocks() - mem_base);
38745 printf(" %d", n_code);
38757 test_xmlUCSIsCatPf(void) {
38760 #if defined(LIBXML_UNICODE_ENABLED)
38763 int code; /* UCS code point */
38766 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38767 mem_base = xmlMemBlocks();
38768 code = gen_int(n_code, 0);
38770 ret_val = xmlUCSIsCatPf(code);
38771 desret_int(ret_val);
38773 des_int(n_code, code, 0);
38774 xmlResetLastError();
38775 if (mem_base != xmlMemBlocks()) {
38776 printf("Leak of %d blocks found in xmlUCSIsCatPf",
38777 xmlMemBlocks() - mem_base);
38779 printf(" %d", n_code);
38791 test_xmlUCSIsCatPi(void) {
38794 #if defined(LIBXML_UNICODE_ENABLED)
38797 int code; /* UCS code point */
38800 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38801 mem_base = xmlMemBlocks();
38802 code = gen_int(n_code, 0);
38804 ret_val = xmlUCSIsCatPi(code);
38805 desret_int(ret_val);
38807 des_int(n_code, code, 0);
38808 xmlResetLastError();
38809 if (mem_base != xmlMemBlocks()) {
38810 printf("Leak of %d blocks found in xmlUCSIsCatPi",
38811 xmlMemBlocks() - mem_base);
38813 printf(" %d", n_code);
38825 test_xmlUCSIsCatPo(void) {
38828 #if defined(LIBXML_UNICODE_ENABLED)
38831 int code; /* UCS code point */
38834 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38835 mem_base = xmlMemBlocks();
38836 code = gen_int(n_code, 0);
38838 ret_val = xmlUCSIsCatPo(code);
38839 desret_int(ret_val);
38841 des_int(n_code, code, 0);
38842 xmlResetLastError();
38843 if (mem_base != xmlMemBlocks()) {
38844 printf("Leak of %d blocks found in xmlUCSIsCatPo",
38845 xmlMemBlocks() - mem_base);
38847 printf(" %d", n_code);
38859 test_xmlUCSIsCatPs(void) {
38862 #if defined(LIBXML_UNICODE_ENABLED)
38865 int code; /* UCS code point */
38868 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38869 mem_base = xmlMemBlocks();
38870 code = gen_int(n_code, 0);
38872 ret_val = xmlUCSIsCatPs(code);
38873 desret_int(ret_val);
38875 des_int(n_code, code, 0);
38876 xmlResetLastError();
38877 if (mem_base != xmlMemBlocks()) {
38878 printf("Leak of %d blocks found in xmlUCSIsCatPs",
38879 xmlMemBlocks() - mem_base);
38881 printf(" %d", n_code);
38893 test_xmlUCSIsCatS(void) {
38896 #if defined(LIBXML_UNICODE_ENABLED)
38899 int code; /* UCS code point */
38902 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38903 mem_base = xmlMemBlocks();
38904 code = gen_int(n_code, 0);
38906 ret_val = xmlUCSIsCatS(code);
38907 desret_int(ret_val);
38909 des_int(n_code, code, 0);
38910 xmlResetLastError();
38911 if (mem_base != xmlMemBlocks()) {
38912 printf("Leak of %d blocks found in xmlUCSIsCatS",
38913 xmlMemBlocks() - mem_base);
38915 printf(" %d", n_code);
38927 test_xmlUCSIsCatSc(void) {
38930 #if defined(LIBXML_UNICODE_ENABLED)
38933 int code; /* UCS code point */
38936 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38937 mem_base = xmlMemBlocks();
38938 code = gen_int(n_code, 0);
38940 ret_val = xmlUCSIsCatSc(code);
38941 desret_int(ret_val);
38943 des_int(n_code, code, 0);
38944 xmlResetLastError();
38945 if (mem_base != xmlMemBlocks()) {
38946 printf("Leak of %d blocks found in xmlUCSIsCatSc",
38947 xmlMemBlocks() - mem_base);
38949 printf(" %d", n_code);
38961 test_xmlUCSIsCatSk(void) {
38964 #if defined(LIBXML_UNICODE_ENABLED)
38967 int code; /* UCS code point */
38970 for (n_code = 0;n_code < gen_nb_int;n_code++) {
38971 mem_base = xmlMemBlocks();
38972 code = gen_int(n_code, 0);
38974 ret_val = xmlUCSIsCatSk(code);
38975 desret_int(ret_val);
38977 des_int(n_code, code, 0);
38978 xmlResetLastError();
38979 if (mem_base != xmlMemBlocks()) {
38980 printf("Leak of %d blocks found in xmlUCSIsCatSk",
38981 xmlMemBlocks() - mem_base);
38983 printf(" %d", n_code);
38995 test_xmlUCSIsCatSm(void) {
38998 #if defined(LIBXML_UNICODE_ENABLED)
39001 int code; /* UCS code point */
39004 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39005 mem_base = xmlMemBlocks();
39006 code = gen_int(n_code, 0);
39008 ret_val = xmlUCSIsCatSm(code);
39009 desret_int(ret_val);
39011 des_int(n_code, code, 0);
39012 xmlResetLastError();
39013 if (mem_base != xmlMemBlocks()) {
39014 printf("Leak of %d blocks found in xmlUCSIsCatSm",
39015 xmlMemBlocks() - mem_base);
39017 printf(" %d", n_code);
39029 test_xmlUCSIsCatSo(void) {
39032 #if defined(LIBXML_UNICODE_ENABLED)
39035 int code; /* UCS code point */
39038 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39039 mem_base = xmlMemBlocks();
39040 code = gen_int(n_code, 0);
39042 ret_val = xmlUCSIsCatSo(code);
39043 desret_int(ret_val);
39045 des_int(n_code, code, 0);
39046 xmlResetLastError();
39047 if (mem_base != xmlMemBlocks()) {
39048 printf("Leak of %d blocks found in xmlUCSIsCatSo",
39049 xmlMemBlocks() - mem_base);
39051 printf(" %d", n_code);
39063 test_xmlUCSIsCatZ(void) {
39066 #if defined(LIBXML_UNICODE_ENABLED)
39069 int code; /* UCS code point */
39072 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39073 mem_base = xmlMemBlocks();
39074 code = gen_int(n_code, 0);
39076 ret_val = xmlUCSIsCatZ(code);
39077 desret_int(ret_val);
39079 des_int(n_code, code, 0);
39080 xmlResetLastError();
39081 if (mem_base != xmlMemBlocks()) {
39082 printf("Leak of %d blocks found in xmlUCSIsCatZ",
39083 xmlMemBlocks() - mem_base);
39085 printf(" %d", n_code);
39097 test_xmlUCSIsCatZl(void) {
39100 #if defined(LIBXML_UNICODE_ENABLED)
39103 int code; /* UCS code point */
39106 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39107 mem_base = xmlMemBlocks();
39108 code = gen_int(n_code, 0);
39110 ret_val = xmlUCSIsCatZl(code);
39111 desret_int(ret_val);
39113 des_int(n_code, code, 0);
39114 xmlResetLastError();
39115 if (mem_base != xmlMemBlocks()) {
39116 printf("Leak of %d blocks found in xmlUCSIsCatZl",
39117 xmlMemBlocks() - mem_base);
39119 printf(" %d", n_code);
39131 test_xmlUCSIsCatZp(void) {
39134 #if defined(LIBXML_UNICODE_ENABLED)
39137 int code; /* UCS code point */
39140 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39141 mem_base = xmlMemBlocks();
39142 code = gen_int(n_code, 0);
39144 ret_val = xmlUCSIsCatZp(code);
39145 desret_int(ret_val);
39147 des_int(n_code, code, 0);
39148 xmlResetLastError();
39149 if (mem_base != xmlMemBlocks()) {
39150 printf("Leak of %d blocks found in xmlUCSIsCatZp",
39151 xmlMemBlocks() - mem_base);
39153 printf(" %d", n_code);
39165 test_xmlUCSIsCatZs(void) {
39168 #if defined(LIBXML_UNICODE_ENABLED)
39171 int code; /* UCS code point */
39174 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39175 mem_base = xmlMemBlocks();
39176 code = gen_int(n_code, 0);
39178 ret_val = xmlUCSIsCatZs(code);
39179 desret_int(ret_val);
39181 des_int(n_code, code, 0);
39182 xmlResetLastError();
39183 if (mem_base != xmlMemBlocks()) {
39184 printf("Leak of %d blocks found in xmlUCSIsCatZs",
39185 xmlMemBlocks() - mem_base);
39187 printf(" %d", n_code);
39199 test_xmlUCSIsCherokee(void) {
39202 #if defined(LIBXML_UNICODE_ENABLED)
39205 int code; /* UCS code point */
39208 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39209 mem_base = xmlMemBlocks();
39210 code = gen_int(n_code, 0);
39212 ret_val = xmlUCSIsCherokee(code);
39213 desret_int(ret_val);
39215 des_int(n_code, code, 0);
39216 xmlResetLastError();
39217 if (mem_base != xmlMemBlocks()) {
39218 printf("Leak of %d blocks found in xmlUCSIsCherokee",
39219 xmlMemBlocks() - mem_base);
39221 printf(" %d", n_code);
39233 test_xmlUCSIsCombiningDiacriticalMarks(void) {
39236 #if defined(LIBXML_UNICODE_ENABLED)
39239 int code; /* UCS code point */
39242 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39243 mem_base = xmlMemBlocks();
39244 code = gen_int(n_code, 0);
39246 ret_val = xmlUCSIsCombiningDiacriticalMarks(code);
39247 desret_int(ret_val);
39249 des_int(n_code, code, 0);
39250 xmlResetLastError();
39251 if (mem_base != xmlMemBlocks()) {
39252 printf("Leak of %d blocks found in xmlUCSIsCombiningDiacriticalMarks",
39253 xmlMemBlocks() - mem_base);
39255 printf(" %d", n_code);
39267 test_xmlUCSIsCombiningDiacriticalMarksforSymbols(void) {
39270 #if defined(LIBXML_UNICODE_ENABLED)
39273 int code; /* UCS code point */
39276 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39277 mem_base = xmlMemBlocks();
39278 code = gen_int(n_code, 0);
39280 ret_val = xmlUCSIsCombiningDiacriticalMarksforSymbols(code);
39281 desret_int(ret_val);
39283 des_int(n_code, code, 0);
39284 xmlResetLastError();
39285 if (mem_base != xmlMemBlocks()) {
39286 printf("Leak of %d blocks found in xmlUCSIsCombiningDiacriticalMarksforSymbols",
39287 xmlMemBlocks() - mem_base);
39289 printf(" %d", n_code);
39301 test_xmlUCSIsCombiningHalfMarks(void) {
39304 #if defined(LIBXML_UNICODE_ENABLED)
39307 int code; /* UCS code point */
39310 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39311 mem_base = xmlMemBlocks();
39312 code = gen_int(n_code, 0);
39314 ret_val = xmlUCSIsCombiningHalfMarks(code);
39315 desret_int(ret_val);
39317 des_int(n_code, code, 0);
39318 xmlResetLastError();
39319 if (mem_base != xmlMemBlocks()) {
39320 printf("Leak of %d blocks found in xmlUCSIsCombiningHalfMarks",
39321 xmlMemBlocks() - mem_base);
39323 printf(" %d", n_code);
39335 test_xmlUCSIsCombiningMarksforSymbols(void) {
39338 #if defined(LIBXML_UNICODE_ENABLED)
39341 int code; /* UCS code point */
39344 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39345 mem_base = xmlMemBlocks();
39346 code = gen_int(n_code, 0);
39348 ret_val = xmlUCSIsCombiningMarksforSymbols(code);
39349 desret_int(ret_val);
39351 des_int(n_code, code, 0);
39352 xmlResetLastError();
39353 if (mem_base != xmlMemBlocks()) {
39354 printf("Leak of %d blocks found in xmlUCSIsCombiningMarksforSymbols",
39355 xmlMemBlocks() - mem_base);
39357 printf(" %d", n_code);
39369 test_xmlUCSIsControlPictures(void) {
39372 #if defined(LIBXML_UNICODE_ENABLED)
39375 int code; /* UCS code point */
39378 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39379 mem_base = xmlMemBlocks();
39380 code = gen_int(n_code, 0);
39382 ret_val = xmlUCSIsControlPictures(code);
39383 desret_int(ret_val);
39385 des_int(n_code, code, 0);
39386 xmlResetLastError();
39387 if (mem_base != xmlMemBlocks()) {
39388 printf("Leak of %d blocks found in xmlUCSIsControlPictures",
39389 xmlMemBlocks() - mem_base);
39391 printf(" %d", n_code);
39403 test_xmlUCSIsCurrencySymbols(void) {
39406 #if defined(LIBXML_UNICODE_ENABLED)
39409 int code; /* UCS code point */
39412 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39413 mem_base = xmlMemBlocks();
39414 code = gen_int(n_code, 0);
39416 ret_val = xmlUCSIsCurrencySymbols(code);
39417 desret_int(ret_val);
39419 des_int(n_code, code, 0);
39420 xmlResetLastError();
39421 if (mem_base != xmlMemBlocks()) {
39422 printf("Leak of %d blocks found in xmlUCSIsCurrencySymbols",
39423 xmlMemBlocks() - mem_base);
39425 printf(" %d", n_code);
39437 test_xmlUCSIsCypriotSyllabary(void) {
39440 #if defined(LIBXML_UNICODE_ENABLED)
39443 int code; /* UCS code point */
39446 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39447 mem_base = xmlMemBlocks();
39448 code = gen_int(n_code, 0);
39450 ret_val = xmlUCSIsCypriotSyllabary(code);
39451 desret_int(ret_val);
39453 des_int(n_code, code, 0);
39454 xmlResetLastError();
39455 if (mem_base != xmlMemBlocks()) {
39456 printf("Leak of %d blocks found in xmlUCSIsCypriotSyllabary",
39457 xmlMemBlocks() - mem_base);
39459 printf(" %d", n_code);
39471 test_xmlUCSIsCyrillic(void) {
39474 #if defined(LIBXML_UNICODE_ENABLED)
39477 int code; /* UCS code point */
39480 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39481 mem_base = xmlMemBlocks();
39482 code = gen_int(n_code, 0);
39484 ret_val = xmlUCSIsCyrillic(code);
39485 desret_int(ret_val);
39487 des_int(n_code, code, 0);
39488 xmlResetLastError();
39489 if (mem_base != xmlMemBlocks()) {
39490 printf("Leak of %d blocks found in xmlUCSIsCyrillic",
39491 xmlMemBlocks() - mem_base);
39493 printf(" %d", n_code);
39505 test_xmlUCSIsCyrillicSupplement(void) {
39508 #if defined(LIBXML_UNICODE_ENABLED)
39511 int code; /* UCS code point */
39514 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39515 mem_base = xmlMemBlocks();
39516 code = gen_int(n_code, 0);
39518 ret_val = xmlUCSIsCyrillicSupplement(code);
39519 desret_int(ret_val);
39521 des_int(n_code, code, 0);
39522 xmlResetLastError();
39523 if (mem_base != xmlMemBlocks()) {
39524 printf("Leak of %d blocks found in xmlUCSIsCyrillicSupplement",
39525 xmlMemBlocks() - mem_base);
39527 printf(" %d", n_code);
39539 test_xmlUCSIsDeseret(void) {
39542 #if defined(LIBXML_UNICODE_ENABLED)
39545 int code; /* UCS code point */
39548 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39549 mem_base = xmlMemBlocks();
39550 code = gen_int(n_code, 0);
39552 ret_val = xmlUCSIsDeseret(code);
39553 desret_int(ret_val);
39555 des_int(n_code, code, 0);
39556 xmlResetLastError();
39557 if (mem_base != xmlMemBlocks()) {
39558 printf("Leak of %d blocks found in xmlUCSIsDeseret",
39559 xmlMemBlocks() - mem_base);
39561 printf(" %d", n_code);
39573 test_xmlUCSIsDevanagari(void) {
39576 #if defined(LIBXML_UNICODE_ENABLED)
39579 int code; /* UCS code point */
39582 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39583 mem_base = xmlMemBlocks();
39584 code = gen_int(n_code, 0);
39586 ret_val = xmlUCSIsDevanagari(code);
39587 desret_int(ret_val);
39589 des_int(n_code, code, 0);
39590 xmlResetLastError();
39591 if (mem_base != xmlMemBlocks()) {
39592 printf("Leak of %d blocks found in xmlUCSIsDevanagari",
39593 xmlMemBlocks() - mem_base);
39595 printf(" %d", n_code);
39607 test_xmlUCSIsDingbats(void) {
39610 #if defined(LIBXML_UNICODE_ENABLED)
39613 int code; /* UCS code point */
39616 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39617 mem_base = xmlMemBlocks();
39618 code = gen_int(n_code, 0);
39620 ret_val = xmlUCSIsDingbats(code);
39621 desret_int(ret_val);
39623 des_int(n_code, code, 0);
39624 xmlResetLastError();
39625 if (mem_base != xmlMemBlocks()) {
39626 printf("Leak of %d blocks found in xmlUCSIsDingbats",
39627 xmlMemBlocks() - mem_base);
39629 printf(" %d", n_code);
39641 test_xmlUCSIsEnclosedAlphanumerics(void) {
39644 #if defined(LIBXML_UNICODE_ENABLED)
39647 int code; /* UCS code point */
39650 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39651 mem_base = xmlMemBlocks();
39652 code = gen_int(n_code, 0);
39654 ret_val = xmlUCSIsEnclosedAlphanumerics(code);
39655 desret_int(ret_val);
39657 des_int(n_code, code, 0);
39658 xmlResetLastError();
39659 if (mem_base != xmlMemBlocks()) {
39660 printf("Leak of %d blocks found in xmlUCSIsEnclosedAlphanumerics",
39661 xmlMemBlocks() - mem_base);
39663 printf(" %d", n_code);
39675 test_xmlUCSIsEnclosedCJKLettersandMonths(void) {
39678 #if defined(LIBXML_UNICODE_ENABLED)
39681 int code; /* UCS code point */
39684 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39685 mem_base = xmlMemBlocks();
39686 code = gen_int(n_code, 0);
39688 ret_val = xmlUCSIsEnclosedCJKLettersandMonths(code);
39689 desret_int(ret_val);
39691 des_int(n_code, code, 0);
39692 xmlResetLastError();
39693 if (mem_base != xmlMemBlocks()) {
39694 printf("Leak of %d blocks found in xmlUCSIsEnclosedCJKLettersandMonths",
39695 xmlMemBlocks() - mem_base);
39697 printf(" %d", n_code);
39709 test_xmlUCSIsEthiopic(void) {
39712 #if defined(LIBXML_UNICODE_ENABLED)
39715 int code; /* UCS code point */
39718 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39719 mem_base = xmlMemBlocks();
39720 code = gen_int(n_code, 0);
39722 ret_val = xmlUCSIsEthiopic(code);
39723 desret_int(ret_val);
39725 des_int(n_code, code, 0);
39726 xmlResetLastError();
39727 if (mem_base != xmlMemBlocks()) {
39728 printf("Leak of %d blocks found in xmlUCSIsEthiopic",
39729 xmlMemBlocks() - mem_base);
39731 printf(" %d", n_code);
39743 test_xmlUCSIsGeneralPunctuation(void) {
39746 #if defined(LIBXML_UNICODE_ENABLED)
39749 int code; /* UCS code point */
39752 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39753 mem_base = xmlMemBlocks();
39754 code = gen_int(n_code, 0);
39756 ret_val = xmlUCSIsGeneralPunctuation(code);
39757 desret_int(ret_val);
39759 des_int(n_code, code, 0);
39760 xmlResetLastError();
39761 if (mem_base != xmlMemBlocks()) {
39762 printf("Leak of %d blocks found in xmlUCSIsGeneralPunctuation",
39763 xmlMemBlocks() - mem_base);
39765 printf(" %d", n_code);
39777 test_xmlUCSIsGeometricShapes(void) {
39780 #if defined(LIBXML_UNICODE_ENABLED)
39783 int code; /* UCS code point */
39786 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39787 mem_base = xmlMemBlocks();
39788 code = gen_int(n_code, 0);
39790 ret_val = xmlUCSIsGeometricShapes(code);
39791 desret_int(ret_val);
39793 des_int(n_code, code, 0);
39794 xmlResetLastError();
39795 if (mem_base != xmlMemBlocks()) {
39796 printf("Leak of %d blocks found in xmlUCSIsGeometricShapes",
39797 xmlMemBlocks() - mem_base);
39799 printf(" %d", n_code);
39811 test_xmlUCSIsGeorgian(void) {
39814 #if defined(LIBXML_UNICODE_ENABLED)
39817 int code; /* UCS code point */
39820 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39821 mem_base = xmlMemBlocks();
39822 code = gen_int(n_code, 0);
39824 ret_val = xmlUCSIsGeorgian(code);
39825 desret_int(ret_val);
39827 des_int(n_code, code, 0);
39828 xmlResetLastError();
39829 if (mem_base != xmlMemBlocks()) {
39830 printf("Leak of %d blocks found in xmlUCSIsGeorgian",
39831 xmlMemBlocks() - mem_base);
39833 printf(" %d", n_code);
39845 test_xmlUCSIsGothic(void) {
39848 #if defined(LIBXML_UNICODE_ENABLED)
39851 int code; /* UCS code point */
39854 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39855 mem_base = xmlMemBlocks();
39856 code = gen_int(n_code, 0);
39858 ret_val = xmlUCSIsGothic(code);
39859 desret_int(ret_val);
39861 des_int(n_code, code, 0);
39862 xmlResetLastError();
39863 if (mem_base != xmlMemBlocks()) {
39864 printf("Leak of %d blocks found in xmlUCSIsGothic",
39865 xmlMemBlocks() - mem_base);
39867 printf(" %d", n_code);
39879 test_xmlUCSIsGreek(void) {
39882 #if defined(LIBXML_UNICODE_ENABLED)
39885 int code; /* UCS code point */
39888 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39889 mem_base = xmlMemBlocks();
39890 code = gen_int(n_code, 0);
39892 ret_val = xmlUCSIsGreek(code);
39893 desret_int(ret_val);
39895 des_int(n_code, code, 0);
39896 xmlResetLastError();
39897 if (mem_base != xmlMemBlocks()) {
39898 printf("Leak of %d blocks found in xmlUCSIsGreek",
39899 xmlMemBlocks() - mem_base);
39901 printf(" %d", n_code);
39913 test_xmlUCSIsGreekExtended(void) {
39916 #if defined(LIBXML_UNICODE_ENABLED)
39919 int code; /* UCS code point */
39922 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39923 mem_base = xmlMemBlocks();
39924 code = gen_int(n_code, 0);
39926 ret_val = xmlUCSIsGreekExtended(code);
39927 desret_int(ret_val);
39929 des_int(n_code, code, 0);
39930 xmlResetLastError();
39931 if (mem_base != xmlMemBlocks()) {
39932 printf("Leak of %d blocks found in xmlUCSIsGreekExtended",
39933 xmlMemBlocks() - mem_base);
39935 printf(" %d", n_code);
39947 test_xmlUCSIsGreekandCoptic(void) {
39950 #if defined(LIBXML_UNICODE_ENABLED)
39953 int code; /* UCS code point */
39956 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39957 mem_base = xmlMemBlocks();
39958 code = gen_int(n_code, 0);
39960 ret_val = xmlUCSIsGreekandCoptic(code);
39961 desret_int(ret_val);
39963 des_int(n_code, code, 0);
39964 xmlResetLastError();
39965 if (mem_base != xmlMemBlocks()) {
39966 printf("Leak of %d blocks found in xmlUCSIsGreekandCoptic",
39967 xmlMemBlocks() - mem_base);
39969 printf(" %d", n_code);
39981 test_xmlUCSIsGujarati(void) {
39984 #if defined(LIBXML_UNICODE_ENABLED)
39987 int code; /* UCS code point */
39990 for (n_code = 0;n_code < gen_nb_int;n_code++) {
39991 mem_base = xmlMemBlocks();
39992 code = gen_int(n_code, 0);
39994 ret_val = xmlUCSIsGujarati(code);
39995 desret_int(ret_val);
39997 des_int(n_code, code, 0);
39998 xmlResetLastError();
39999 if (mem_base != xmlMemBlocks()) {
40000 printf("Leak of %d blocks found in xmlUCSIsGujarati",
40001 xmlMemBlocks() - mem_base);
40003 printf(" %d", n_code);
40015 test_xmlUCSIsGurmukhi(void) {
40018 #if defined(LIBXML_UNICODE_ENABLED)
40021 int code; /* UCS code point */
40024 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40025 mem_base = xmlMemBlocks();
40026 code = gen_int(n_code, 0);
40028 ret_val = xmlUCSIsGurmukhi(code);
40029 desret_int(ret_val);
40031 des_int(n_code, code, 0);
40032 xmlResetLastError();
40033 if (mem_base != xmlMemBlocks()) {
40034 printf("Leak of %d blocks found in xmlUCSIsGurmukhi",
40035 xmlMemBlocks() - mem_base);
40037 printf(" %d", n_code);
40049 test_xmlUCSIsHalfwidthandFullwidthForms(void) {
40052 #if defined(LIBXML_UNICODE_ENABLED)
40055 int code; /* UCS code point */
40058 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40059 mem_base = xmlMemBlocks();
40060 code = gen_int(n_code, 0);
40062 ret_val = xmlUCSIsHalfwidthandFullwidthForms(code);
40063 desret_int(ret_val);
40065 des_int(n_code, code, 0);
40066 xmlResetLastError();
40067 if (mem_base != xmlMemBlocks()) {
40068 printf("Leak of %d blocks found in xmlUCSIsHalfwidthandFullwidthForms",
40069 xmlMemBlocks() - mem_base);
40071 printf(" %d", n_code);
40083 test_xmlUCSIsHangulCompatibilityJamo(void) {
40086 #if defined(LIBXML_UNICODE_ENABLED)
40089 int code; /* UCS code point */
40092 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40093 mem_base = xmlMemBlocks();
40094 code = gen_int(n_code, 0);
40096 ret_val = xmlUCSIsHangulCompatibilityJamo(code);
40097 desret_int(ret_val);
40099 des_int(n_code, code, 0);
40100 xmlResetLastError();
40101 if (mem_base != xmlMemBlocks()) {
40102 printf("Leak of %d blocks found in xmlUCSIsHangulCompatibilityJamo",
40103 xmlMemBlocks() - mem_base);
40105 printf(" %d", n_code);
40117 test_xmlUCSIsHangulJamo(void) {
40120 #if defined(LIBXML_UNICODE_ENABLED)
40123 int code; /* UCS code point */
40126 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40127 mem_base = xmlMemBlocks();
40128 code = gen_int(n_code, 0);
40130 ret_val = xmlUCSIsHangulJamo(code);
40131 desret_int(ret_val);
40133 des_int(n_code, code, 0);
40134 xmlResetLastError();
40135 if (mem_base != xmlMemBlocks()) {
40136 printf("Leak of %d blocks found in xmlUCSIsHangulJamo",
40137 xmlMemBlocks() - mem_base);
40139 printf(" %d", n_code);
40151 test_xmlUCSIsHangulSyllables(void) {
40154 #if defined(LIBXML_UNICODE_ENABLED)
40157 int code; /* UCS code point */
40160 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40161 mem_base = xmlMemBlocks();
40162 code = gen_int(n_code, 0);
40164 ret_val = xmlUCSIsHangulSyllables(code);
40165 desret_int(ret_val);
40167 des_int(n_code, code, 0);
40168 xmlResetLastError();
40169 if (mem_base != xmlMemBlocks()) {
40170 printf("Leak of %d blocks found in xmlUCSIsHangulSyllables",
40171 xmlMemBlocks() - mem_base);
40173 printf(" %d", n_code);
40185 test_xmlUCSIsHanunoo(void) {
40188 #if defined(LIBXML_UNICODE_ENABLED)
40191 int code; /* UCS code point */
40194 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40195 mem_base = xmlMemBlocks();
40196 code = gen_int(n_code, 0);
40198 ret_val = xmlUCSIsHanunoo(code);
40199 desret_int(ret_val);
40201 des_int(n_code, code, 0);
40202 xmlResetLastError();
40203 if (mem_base != xmlMemBlocks()) {
40204 printf("Leak of %d blocks found in xmlUCSIsHanunoo",
40205 xmlMemBlocks() - mem_base);
40207 printf(" %d", n_code);
40219 test_xmlUCSIsHebrew(void) {
40222 #if defined(LIBXML_UNICODE_ENABLED)
40225 int code; /* UCS code point */
40228 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40229 mem_base = xmlMemBlocks();
40230 code = gen_int(n_code, 0);
40232 ret_val = xmlUCSIsHebrew(code);
40233 desret_int(ret_val);
40235 des_int(n_code, code, 0);
40236 xmlResetLastError();
40237 if (mem_base != xmlMemBlocks()) {
40238 printf("Leak of %d blocks found in xmlUCSIsHebrew",
40239 xmlMemBlocks() - mem_base);
40241 printf(" %d", n_code);
40253 test_xmlUCSIsHighPrivateUseSurrogates(void) {
40256 #if defined(LIBXML_UNICODE_ENABLED)
40259 int code; /* UCS code point */
40262 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40263 mem_base = xmlMemBlocks();
40264 code = gen_int(n_code, 0);
40266 ret_val = xmlUCSIsHighPrivateUseSurrogates(code);
40267 desret_int(ret_val);
40269 des_int(n_code, code, 0);
40270 xmlResetLastError();
40271 if (mem_base != xmlMemBlocks()) {
40272 printf("Leak of %d blocks found in xmlUCSIsHighPrivateUseSurrogates",
40273 xmlMemBlocks() - mem_base);
40275 printf(" %d", n_code);
40287 test_xmlUCSIsHighSurrogates(void) {
40290 #if defined(LIBXML_UNICODE_ENABLED)
40293 int code; /* UCS code point */
40296 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40297 mem_base = xmlMemBlocks();
40298 code = gen_int(n_code, 0);
40300 ret_val = xmlUCSIsHighSurrogates(code);
40301 desret_int(ret_val);
40303 des_int(n_code, code, 0);
40304 xmlResetLastError();
40305 if (mem_base != xmlMemBlocks()) {
40306 printf("Leak of %d blocks found in xmlUCSIsHighSurrogates",
40307 xmlMemBlocks() - mem_base);
40309 printf(" %d", n_code);
40321 test_xmlUCSIsHiragana(void) {
40324 #if defined(LIBXML_UNICODE_ENABLED)
40327 int code; /* UCS code point */
40330 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40331 mem_base = xmlMemBlocks();
40332 code = gen_int(n_code, 0);
40334 ret_val = xmlUCSIsHiragana(code);
40335 desret_int(ret_val);
40337 des_int(n_code, code, 0);
40338 xmlResetLastError();
40339 if (mem_base != xmlMemBlocks()) {
40340 printf("Leak of %d blocks found in xmlUCSIsHiragana",
40341 xmlMemBlocks() - mem_base);
40343 printf(" %d", n_code);
40355 test_xmlUCSIsIPAExtensions(void) {
40358 #if defined(LIBXML_UNICODE_ENABLED)
40361 int code; /* UCS code point */
40364 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40365 mem_base = xmlMemBlocks();
40366 code = gen_int(n_code, 0);
40368 ret_val = xmlUCSIsIPAExtensions(code);
40369 desret_int(ret_val);
40371 des_int(n_code, code, 0);
40372 xmlResetLastError();
40373 if (mem_base != xmlMemBlocks()) {
40374 printf("Leak of %d blocks found in xmlUCSIsIPAExtensions",
40375 xmlMemBlocks() - mem_base);
40377 printf(" %d", n_code);
40389 test_xmlUCSIsIdeographicDescriptionCharacters(void) {
40392 #if defined(LIBXML_UNICODE_ENABLED)
40395 int code; /* UCS code point */
40398 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40399 mem_base = xmlMemBlocks();
40400 code = gen_int(n_code, 0);
40402 ret_val = xmlUCSIsIdeographicDescriptionCharacters(code);
40403 desret_int(ret_val);
40405 des_int(n_code, code, 0);
40406 xmlResetLastError();
40407 if (mem_base != xmlMemBlocks()) {
40408 printf("Leak of %d blocks found in xmlUCSIsIdeographicDescriptionCharacters",
40409 xmlMemBlocks() - mem_base);
40411 printf(" %d", n_code);
40423 test_xmlUCSIsKanbun(void) {
40426 #if defined(LIBXML_UNICODE_ENABLED)
40429 int code; /* UCS code point */
40432 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40433 mem_base = xmlMemBlocks();
40434 code = gen_int(n_code, 0);
40436 ret_val = xmlUCSIsKanbun(code);
40437 desret_int(ret_val);
40439 des_int(n_code, code, 0);
40440 xmlResetLastError();
40441 if (mem_base != xmlMemBlocks()) {
40442 printf("Leak of %d blocks found in xmlUCSIsKanbun",
40443 xmlMemBlocks() - mem_base);
40445 printf(" %d", n_code);
40457 test_xmlUCSIsKangxiRadicals(void) {
40460 #if defined(LIBXML_UNICODE_ENABLED)
40463 int code; /* UCS code point */
40466 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40467 mem_base = xmlMemBlocks();
40468 code = gen_int(n_code, 0);
40470 ret_val = xmlUCSIsKangxiRadicals(code);
40471 desret_int(ret_val);
40473 des_int(n_code, code, 0);
40474 xmlResetLastError();
40475 if (mem_base != xmlMemBlocks()) {
40476 printf("Leak of %d blocks found in xmlUCSIsKangxiRadicals",
40477 xmlMemBlocks() - mem_base);
40479 printf(" %d", n_code);
40491 test_xmlUCSIsKannada(void) {
40494 #if defined(LIBXML_UNICODE_ENABLED)
40497 int code; /* UCS code point */
40500 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40501 mem_base = xmlMemBlocks();
40502 code = gen_int(n_code, 0);
40504 ret_val = xmlUCSIsKannada(code);
40505 desret_int(ret_val);
40507 des_int(n_code, code, 0);
40508 xmlResetLastError();
40509 if (mem_base != xmlMemBlocks()) {
40510 printf("Leak of %d blocks found in xmlUCSIsKannada",
40511 xmlMemBlocks() - mem_base);
40513 printf(" %d", n_code);
40525 test_xmlUCSIsKatakana(void) {
40528 #if defined(LIBXML_UNICODE_ENABLED)
40531 int code; /* UCS code point */
40534 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40535 mem_base = xmlMemBlocks();
40536 code = gen_int(n_code, 0);
40538 ret_val = xmlUCSIsKatakana(code);
40539 desret_int(ret_val);
40541 des_int(n_code, code, 0);
40542 xmlResetLastError();
40543 if (mem_base != xmlMemBlocks()) {
40544 printf("Leak of %d blocks found in xmlUCSIsKatakana",
40545 xmlMemBlocks() - mem_base);
40547 printf(" %d", n_code);
40559 test_xmlUCSIsKatakanaPhoneticExtensions(void) {
40562 #if defined(LIBXML_UNICODE_ENABLED)
40565 int code; /* UCS code point */
40568 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40569 mem_base = xmlMemBlocks();
40570 code = gen_int(n_code, 0);
40572 ret_val = xmlUCSIsKatakanaPhoneticExtensions(code);
40573 desret_int(ret_val);
40575 des_int(n_code, code, 0);
40576 xmlResetLastError();
40577 if (mem_base != xmlMemBlocks()) {
40578 printf("Leak of %d blocks found in xmlUCSIsKatakanaPhoneticExtensions",
40579 xmlMemBlocks() - mem_base);
40581 printf(" %d", n_code);
40593 test_xmlUCSIsKhmer(void) {
40596 #if defined(LIBXML_UNICODE_ENABLED)
40599 int code; /* UCS code point */
40602 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40603 mem_base = xmlMemBlocks();
40604 code = gen_int(n_code, 0);
40606 ret_val = xmlUCSIsKhmer(code);
40607 desret_int(ret_val);
40609 des_int(n_code, code, 0);
40610 xmlResetLastError();
40611 if (mem_base != xmlMemBlocks()) {
40612 printf("Leak of %d blocks found in xmlUCSIsKhmer",
40613 xmlMemBlocks() - mem_base);
40615 printf(" %d", n_code);
40627 test_xmlUCSIsKhmerSymbols(void) {
40630 #if defined(LIBXML_UNICODE_ENABLED)
40633 int code; /* UCS code point */
40636 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40637 mem_base = xmlMemBlocks();
40638 code = gen_int(n_code, 0);
40640 ret_val = xmlUCSIsKhmerSymbols(code);
40641 desret_int(ret_val);
40643 des_int(n_code, code, 0);
40644 xmlResetLastError();
40645 if (mem_base != xmlMemBlocks()) {
40646 printf("Leak of %d blocks found in xmlUCSIsKhmerSymbols",
40647 xmlMemBlocks() - mem_base);
40649 printf(" %d", n_code);
40661 test_xmlUCSIsLao(void) {
40664 #if defined(LIBXML_UNICODE_ENABLED)
40667 int code; /* UCS code point */
40670 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40671 mem_base = xmlMemBlocks();
40672 code = gen_int(n_code, 0);
40674 ret_val = xmlUCSIsLao(code);
40675 desret_int(ret_val);
40677 des_int(n_code, code, 0);
40678 xmlResetLastError();
40679 if (mem_base != xmlMemBlocks()) {
40680 printf("Leak of %d blocks found in xmlUCSIsLao",
40681 xmlMemBlocks() - mem_base);
40683 printf(" %d", n_code);
40695 test_xmlUCSIsLatin1Supplement(void) {
40698 #if defined(LIBXML_UNICODE_ENABLED)
40701 int code; /* UCS code point */
40704 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40705 mem_base = xmlMemBlocks();
40706 code = gen_int(n_code, 0);
40708 ret_val = xmlUCSIsLatin1Supplement(code);
40709 desret_int(ret_val);
40711 des_int(n_code, code, 0);
40712 xmlResetLastError();
40713 if (mem_base != xmlMemBlocks()) {
40714 printf("Leak of %d blocks found in xmlUCSIsLatin1Supplement",
40715 xmlMemBlocks() - mem_base);
40717 printf(" %d", n_code);
40729 test_xmlUCSIsLatinExtendedA(void) {
40732 #if defined(LIBXML_UNICODE_ENABLED)
40735 int code; /* UCS code point */
40738 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40739 mem_base = xmlMemBlocks();
40740 code = gen_int(n_code, 0);
40742 ret_val = xmlUCSIsLatinExtendedA(code);
40743 desret_int(ret_val);
40745 des_int(n_code, code, 0);
40746 xmlResetLastError();
40747 if (mem_base != xmlMemBlocks()) {
40748 printf("Leak of %d blocks found in xmlUCSIsLatinExtendedA",
40749 xmlMemBlocks() - mem_base);
40751 printf(" %d", n_code);
40763 test_xmlUCSIsLatinExtendedAdditional(void) {
40766 #if defined(LIBXML_UNICODE_ENABLED)
40769 int code; /* UCS code point */
40772 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40773 mem_base = xmlMemBlocks();
40774 code = gen_int(n_code, 0);
40776 ret_val = xmlUCSIsLatinExtendedAdditional(code);
40777 desret_int(ret_val);
40779 des_int(n_code, code, 0);
40780 xmlResetLastError();
40781 if (mem_base != xmlMemBlocks()) {
40782 printf("Leak of %d blocks found in xmlUCSIsLatinExtendedAdditional",
40783 xmlMemBlocks() - mem_base);
40785 printf(" %d", n_code);
40797 test_xmlUCSIsLatinExtendedB(void) {
40800 #if defined(LIBXML_UNICODE_ENABLED)
40803 int code; /* UCS code point */
40806 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40807 mem_base = xmlMemBlocks();
40808 code = gen_int(n_code, 0);
40810 ret_val = xmlUCSIsLatinExtendedB(code);
40811 desret_int(ret_val);
40813 des_int(n_code, code, 0);
40814 xmlResetLastError();
40815 if (mem_base != xmlMemBlocks()) {
40816 printf("Leak of %d blocks found in xmlUCSIsLatinExtendedB",
40817 xmlMemBlocks() - mem_base);
40819 printf(" %d", n_code);
40831 test_xmlUCSIsLetterlikeSymbols(void) {
40834 #if defined(LIBXML_UNICODE_ENABLED)
40837 int code; /* UCS code point */
40840 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40841 mem_base = xmlMemBlocks();
40842 code = gen_int(n_code, 0);
40844 ret_val = xmlUCSIsLetterlikeSymbols(code);
40845 desret_int(ret_val);
40847 des_int(n_code, code, 0);
40848 xmlResetLastError();
40849 if (mem_base != xmlMemBlocks()) {
40850 printf("Leak of %d blocks found in xmlUCSIsLetterlikeSymbols",
40851 xmlMemBlocks() - mem_base);
40853 printf(" %d", n_code);
40865 test_xmlUCSIsLimbu(void) {
40868 #if defined(LIBXML_UNICODE_ENABLED)
40871 int code; /* UCS code point */
40874 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40875 mem_base = xmlMemBlocks();
40876 code = gen_int(n_code, 0);
40878 ret_val = xmlUCSIsLimbu(code);
40879 desret_int(ret_val);
40881 des_int(n_code, code, 0);
40882 xmlResetLastError();
40883 if (mem_base != xmlMemBlocks()) {
40884 printf("Leak of %d blocks found in xmlUCSIsLimbu",
40885 xmlMemBlocks() - mem_base);
40887 printf(" %d", n_code);
40899 test_xmlUCSIsLinearBIdeograms(void) {
40902 #if defined(LIBXML_UNICODE_ENABLED)
40905 int code; /* UCS code point */
40908 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40909 mem_base = xmlMemBlocks();
40910 code = gen_int(n_code, 0);
40912 ret_val = xmlUCSIsLinearBIdeograms(code);
40913 desret_int(ret_val);
40915 des_int(n_code, code, 0);
40916 xmlResetLastError();
40917 if (mem_base != xmlMemBlocks()) {
40918 printf("Leak of %d blocks found in xmlUCSIsLinearBIdeograms",
40919 xmlMemBlocks() - mem_base);
40921 printf(" %d", n_code);
40933 test_xmlUCSIsLinearBSyllabary(void) {
40936 #if defined(LIBXML_UNICODE_ENABLED)
40939 int code; /* UCS code point */
40942 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40943 mem_base = xmlMemBlocks();
40944 code = gen_int(n_code, 0);
40946 ret_val = xmlUCSIsLinearBSyllabary(code);
40947 desret_int(ret_val);
40949 des_int(n_code, code, 0);
40950 xmlResetLastError();
40951 if (mem_base != xmlMemBlocks()) {
40952 printf("Leak of %d blocks found in xmlUCSIsLinearBSyllabary",
40953 xmlMemBlocks() - mem_base);
40955 printf(" %d", n_code);
40967 test_xmlUCSIsLowSurrogates(void) {
40970 #if defined(LIBXML_UNICODE_ENABLED)
40973 int code; /* UCS code point */
40976 for (n_code = 0;n_code < gen_nb_int;n_code++) {
40977 mem_base = xmlMemBlocks();
40978 code = gen_int(n_code, 0);
40980 ret_val = xmlUCSIsLowSurrogates(code);
40981 desret_int(ret_val);
40983 des_int(n_code, code, 0);
40984 xmlResetLastError();
40985 if (mem_base != xmlMemBlocks()) {
40986 printf("Leak of %d blocks found in xmlUCSIsLowSurrogates",
40987 xmlMemBlocks() - mem_base);
40989 printf(" %d", n_code);
41001 test_xmlUCSIsMalayalam(void) {
41004 #if defined(LIBXML_UNICODE_ENABLED)
41007 int code; /* UCS code point */
41010 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41011 mem_base = xmlMemBlocks();
41012 code = gen_int(n_code, 0);
41014 ret_val = xmlUCSIsMalayalam(code);
41015 desret_int(ret_val);
41017 des_int(n_code, code, 0);
41018 xmlResetLastError();
41019 if (mem_base != xmlMemBlocks()) {
41020 printf("Leak of %d blocks found in xmlUCSIsMalayalam",
41021 xmlMemBlocks() - mem_base);
41023 printf(" %d", n_code);
41035 test_xmlUCSIsMathematicalAlphanumericSymbols(void) {
41038 #if defined(LIBXML_UNICODE_ENABLED)
41041 int code; /* UCS code point */
41044 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41045 mem_base = xmlMemBlocks();
41046 code = gen_int(n_code, 0);
41048 ret_val = xmlUCSIsMathematicalAlphanumericSymbols(code);
41049 desret_int(ret_val);
41051 des_int(n_code, code, 0);
41052 xmlResetLastError();
41053 if (mem_base != xmlMemBlocks()) {
41054 printf("Leak of %d blocks found in xmlUCSIsMathematicalAlphanumericSymbols",
41055 xmlMemBlocks() - mem_base);
41057 printf(" %d", n_code);
41069 test_xmlUCSIsMathematicalOperators(void) {
41072 #if defined(LIBXML_UNICODE_ENABLED)
41075 int code; /* UCS code point */
41078 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41079 mem_base = xmlMemBlocks();
41080 code = gen_int(n_code, 0);
41082 ret_val = xmlUCSIsMathematicalOperators(code);
41083 desret_int(ret_val);
41085 des_int(n_code, code, 0);
41086 xmlResetLastError();
41087 if (mem_base != xmlMemBlocks()) {
41088 printf("Leak of %d blocks found in xmlUCSIsMathematicalOperators",
41089 xmlMemBlocks() - mem_base);
41091 printf(" %d", n_code);
41103 test_xmlUCSIsMiscellaneousMathematicalSymbolsA(void) {
41106 #if defined(LIBXML_UNICODE_ENABLED)
41109 int code; /* UCS code point */
41112 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41113 mem_base = xmlMemBlocks();
41114 code = gen_int(n_code, 0);
41116 ret_val = xmlUCSIsMiscellaneousMathematicalSymbolsA(code);
41117 desret_int(ret_val);
41119 des_int(n_code, code, 0);
41120 xmlResetLastError();
41121 if (mem_base != xmlMemBlocks()) {
41122 printf("Leak of %d blocks found in xmlUCSIsMiscellaneousMathematicalSymbolsA",
41123 xmlMemBlocks() - mem_base);
41125 printf(" %d", n_code);
41137 test_xmlUCSIsMiscellaneousMathematicalSymbolsB(void) {
41140 #if defined(LIBXML_UNICODE_ENABLED)
41143 int code; /* UCS code point */
41146 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41147 mem_base = xmlMemBlocks();
41148 code = gen_int(n_code, 0);
41150 ret_val = xmlUCSIsMiscellaneousMathematicalSymbolsB(code);
41151 desret_int(ret_val);
41153 des_int(n_code, code, 0);
41154 xmlResetLastError();
41155 if (mem_base != xmlMemBlocks()) {
41156 printf("Leak of %d blocks found in xmlUCSIsMiscellaneousMathematicalSymbolsB",
41157 xmlMemBlocks() - mem_base);
41159 printf(" %d", n_code);
41171 test_xmlUCSIsMiscellaneousSymbols(void) {
41174 #if defined(LIBXML_UNICODE_ENABLED)
41177 int code; /* UCS code point */
41180 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41181 mem_base = xmlMemBlocks();
41182 code = gen_int(n_code, 0);
41184 ret_val = xmlUCSIsMiscellaneousSymbols(code);
41185 desret_int(ret_val);
41187 des_int(n_code, code, 0);
41188 xmlResetLastError();
41189 if (mem_base != xmlMemBlocks()) {
41190 printf("Leak of %d blocks found in xmlUCSIsMiscellaneousSymbols",
41191 xmlMemBlocks() - mem_base);
41193 printf(" %d", n_code);
41205 test_xmlUCSIsMiscellaneousSymbolsandArrows(void) {
41208 #if defined(LIBXML_UNICODE_ENABLED)
41211 int code; /* UCS code point */
41214 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41215 mem_base = xmlMemBlocks();
41216 code = gen_int(n_code, 0);
41218 ret_val = xmlUCSIsMiscellaneousSymbolsandArrows(code);
41219 desret_int(ret_val);
41221 des_int(n_code, code, 0);
41222 xmlResetLastError();
41223 if (mem_base != xmlMemBlocks()) {
41224 printf("Leak of %d blocks found in xmlUCSIsMiscellaneousSymbolsandArrows",
41225 xmlMemBlocks() - mem_base);
41227 printf(" %d", n_code);
41239 test_xmlUCSIsMiscellaneousTechnical(void) {
41242 #if defined(LIBXML_UNICODE_ENABLED)
41245 int code; /* UCS code point */
41248 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41249 mem_base = xmlMemBlocks();
41250 code = gen_int(n_code, 0);
41252 ret_val = xmlUCSIsMiscellaneousTechnical(code);
41253 desret_int(ret_val);
41255 des_int(n_code, code, 0);
41256 xmlResetLastError();
41257 if (mem_base != xmlMemBlocks()) {
41258 printf("Leak of %d blocks found in xmlUCSIsMiscellaneousTechnical",
41259 xmlMemBlocks() - mem_base);
41261 printf(" %d", n_code);
41273 test_xmlUCSIsMongolian(void) {
41276 #if defined(LIBXML_UNICODE_ENABLED)
41279 int code; /* UCS code point */
41282 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41283 mem_base = xmlMemBlocks();
41284 code = gen_int(n_code, 0);
41286 ret_val = xmlUCSIsMongolian(code);
41287 desret_int(ret_val);
41289 des_int(n_code, code, 0);
41290 xmlResetLastError();
41291 if (mem_base != xmlMemBlocks()) {
41292 printf("Leak of %d blocks found in xmlUCSIsMongolian",
41293 xmlMemBlocks() - mem_base);
41295 printf(" %d", n_code);
41307 test_xmlUCSIsMusicalSymbols(void) {
41310 #if defined(LIBXML_UNICODE_ENABLED)
41313 int code; /* UCS code point */
41316 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41317 mem_base = xmlMemBlocks();
41318 code = gen_int(n_code, 0);
41320 ret_val = xmlUCSIsMusicalSymbols(code);
41321 desret_int(ret_val);
41323 des_int(n_code, code, 0);
41324 xmlResetLastError();
41325 if (mem_base != xmlMemBlocks()) {
41326 printf("Leak of %d blocks found in xmlUCSIsMusicalSymbols",
41327 xmlMemBlocks() - mem_base);
41329 printf(" %d", n_code);
41341 test_xmlUCSIsMyanmar(void) {
41344 #if defined(LIBXML_UNICODE_ENABLED)
41347 int code; /* UCS code point */
41350 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41351 mem_base = xmlMemBlocks();
41352 code = gen_int(n_code, 0);
41354 ret_val = xmlUCSIsMyanmar(code);
41355 desret_int(ret_val);
41357 des_int(n_code, code, 0);
41358 xmlResetLastError();
41359 if (mem_base != xmlMemBlocks()) {
41360 printf("Leak of %d blocks found in xmlUCSIsMyanmar",
41361 xmlMemBlocks() - mem_base);
41363 printf(" %d", n_code);
41375 test_xmlUCSIsNumberForms(void) {
41378 #if defined(LIBXML_UNICODE_ENABLED)
41381 int code; /* UCS code point */
41384 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41385 mem_base = xmlMemBlocks();
41386 code = gen_int(n_code, 0);
41388 ret_val = xmlUCSIsNumberForms(code);
41389 desret_int(ret_val);
41391 des_int(n_code, code, 0);
41392 xmlResetLastError();
41393 if (mem_base != xmlMemBlocks()) {
41394 printf("Leak of %d blocks found in xmlUCSIsNumberForms",
41395 xmlMemBlocks() - mem_base);
41397 printf(" %d", n_code);
41409 test_xmlUCSIsOgham(void) {
41412 #if defined(LIBXML_UNICODE_ENABLED)
41415 int code; /* UCS code point */
41418 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41419 mem_base = xmlMemBlocks();
41420 code = gen_int(n_code, 0);
41422 ret_val = xmlUCSIsOgham(code);
41423 desret_int(ret_val);
41425 des_int(n_code, code, 0);
41426 xmlResetLastError();
41427 if (mem_base != xmlMemBlocks()) {
41428 printf("Leak of %d blocks found in xmlUCSIsOgham",
41429 xmlMemBlocks() - mem_base);
41431 printf(" %d", n_code);
41443 test_xmlUCSIsOldItalic(void) {
41446 #if defined(LIBXML_UNICODE_ENABLED)
41449 int code; /* UCS code point */
41452 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41453 mem_base = xmlMemBlocks();
41454 code = gen_int(n_code, 0);
41456 ret_val = xmlUCSIsOldItalic(code);
41457 desret_int(ret_val);
41459 des_int(n_code, code, 0);
41460 xmlResetLastError();
41461 if (mem_base != xmlMemBlocks()) {
41462 printf("Leak of %d blocks found in xmlUCSIsOldItalic",
41463 xmlMemBlocks() - mem_base);
41465 printf(" %d", n_code);
41477 test_xmlUCSIsOpticalCharacterRecognition(void) {
41480 #if defined(LIBXML_UNICODE_ENABLED)
41483 int code; /* UCS code point */
41486 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41487 mem_base = xmlMemBlocks();
41488 code = gen_int(n_code, 0);
41490 ret_val = xmlUCSIsOpticalCharacterRecognition(code);
41491 desret_int(ret_val);
41493 des_int(n_code, code, 0);
41494 xmlResetLastError();
41495 if (mem_base != xmlMemBlocks()) {
41496 printf("Leak of %d blocks found in xmlUCSIsOpticalCharacterRecognition",
41497 xmlMemBlocks() - mem_base);
41499 printf(" %d", n_code);
41511 test_xmlUCSIsOriya(void) {
41514 #if defined(LIBXML_UNICODE_ENABLED)
41517 int code; /* UCS code point */
41520 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41521 mem_base = xmlMemBlocks();
41522 code = gen_int(n_code, 0);
41524 ret_val = xmlUCSIsOriya(code);
41525 desret_int(ret_val);
41527 des_int(n_code, code, 0);
41528 xmlResetLastError();
41529 if (mem_base != xmlMemBlocks()) {
41530 printf("Leak of %d blocks found in xmlUCSIsOriya",
41531 xmlMemBlocks() - mem_base);
41533 printf(" %d", n_code);
41545 test_xmlUCSIsOsmanya(void) {
41548 #if defined(LIBXML_UNICODE_ENABLED)
41551 int code; /* UCS code point */
41554 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41555 mem_base = xmlMemBlocks();
41556 code = gen_int(n_code, 0);
41558 ret_val = xmlUCSIsOsmanya(code);
41559 desret_int(ret_val);
41561 des_int(n_code, code, 0);
41562 xmlResetLastError();
41563 if (mem_base != xmlMemBlocks()) {
41564 printf("Leak of %d blocks found in xmlUCSIsOsmanya",
41565 xmlMemBlocks() - mem_base);
41567 printf(" %d", n_code);
41579 test_xmlUCSIsPhoneticExtensions(void) {
41582 #if defined(LIBXML_UNICODE_ENABLED)
41585 int code; /* UCS code point */
41588 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41589 mem_base = xmlMemBlocks();
41590 code = gen_int(n_code, 0);
41592 ret_val = xmlUCSIsPhoneticExtensions(code);
41593 desret_int(ret_val);
41595 des_int(n_code, code, 0);
41596 xmlResetLastError();
41597 if (mem_base != xmlMemBlocks()) {
41598 printf("Leak of %d blocks found in xmlUCSIsPhoneticExtensions",
41599 xmlMemBlocks() - mem_base);
41601 printf(" %d", n_code);
41613 test_xmlUCSIsPrivateUse(void) {
41616 #if defined(LIBXML_UNICODE_ENABLED)
41619 int code; /* UCS code point */
41622 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41623 mem_base = xmlMemBlocks();
41624 code = gen_int(n_code, 0);
41626 ret_val = xmlUCSIsPrivateUse(code);
41627 desret_int(ret_val);
41629 des_int(n_code, code, 0);
41630 xmlResetLastError();
41631 if (mem_base != xmlMemBlocks()) {
41632 printf("Leak of %d blocks found in xmlUCSIsPrivateUse",
41633 xmlMemBlocks() - mem_base);
41635 printf(" %d", n_code);
41647 test_xmlUCSIsPrivateUseArea(void) {
41650 #if defined(LIBXML_UNICODE_ENABLED)
41653 int code; /* UCS code point */
41656 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41657 mem_base = xmlMemBlocks();
41658 code = gen_int(n_code, 0);
41660 ret_val = xmlUCSIsPrivateUseArea(code);
41661 desret_int(ret_val);
41663 des_int(n_code, code, 0);
41664 xmlResetLastError();
41665 if (mem_base != xmlMemBlocks()) {
41666 printf("Leak of %d blocks found in xmlUCSIsPrivateUseArea",
41667 xmlMemBlocks() - mem_base);
41669 printf(" %d", n_code);
41681 test_xmlUCSIsRunic(void) {
41684 #if defined(LIBXML_UNICODE_ENABLED)
41687 int code; /* UCS code point */
41690 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41691 mem_base = xmlMemBlocks();
41692 code = gen_int(n_code, 0);
41694 ret_val = xmlUCSIsRunic(code);
41695 desret_int(ret_val);
41697 des_int(n_code, code, 0);
41698 xmlResetLastError();
41699 if (mem_base != xmlMemBlocks()) {
41700 printf("Leak of %d blocks found in xmlUCSIsRunic",
41701 xmlMemBlocks() - mem_base);
41703 printf(" %d", n_code);
41715 test_xmlUCSIsShavian(void) {
41718 #if defined(LIBXML_UNICODE_ENABLED)
41721 int code; /* UCS code point */
41724 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41725 mem_base = xmlMemBlocks();
41726 code = gen_int(n_code, 0);
41728 ret_val = xmlUCSIsShavian(code);
41729 desret_int(ret_val);
41731 des_int(n_code, code, 0);
41732 xmlResetLastError();
41733 if (mem_base != xmlMemBlocks()) {
41734 printf("Leak of %d blocks found in xmlUCSIsShavian",
41735 xmlMemBlocks() - mem_base);
41737 printf(" %d", n_code);
41749 test_xmlUCSIsSinhala(void) {
41752 #if defined(LIBXML_UNICODE_ENABLED)
41755 int code; /* UCS code point */
41758 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41759 mem_base = xmlMemBlocks();
41760 code = gen_int(n_code, 0);
41762 ret_val = xmlUCSIsSinhala(code);
41763 desret_int(ret_val);
41765 des_int(n_code, code, 0);
41766 xmlResetLastError();
41767 if (mem_base != xmlMemBlocks()) {
41768 printf("Leak of %d blocks found in xmlUCSIsSinhala",
41769 xmlMemBlocks() - mem_base);
41771 printf(" %d", n_code);
41783 test_xmlUCSIsSmallFormVariants(void) {
41786 #if defined(LIBXML_UNICODE_ENABLED)
41789 int code; /* UCS code point */
41792 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41793 mem_base = xmlMemBlocks();
41794 code = gen_int(n_code, 0);
41796 ret_val = xmlUCSIsSmallFormVariants(code);
41797 desret_int(ret_val);
41799 des_int(n_code, code, 0);
41800 xmlResetLastError();
41801 if (mem_base != xmlMemBlocks()) {
41802 printf("Leak of %d blocks found in xmlUCSIsSmallFormVariants",
41803 xmlMemBlocks() - mem_base);
41805 printf(" %d", n_code);
41817 test_xmlUCSIsSpacingModifierLetters(void) {
41820 #if defined(LIBXML_UNICODE_ENABLED)
41823 int code; /* UCS code point */
41826 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41827 mem_base = xmlMemBlocks();
41828 code = gen_int(n_code, 0);
41830 ret_val = xmlUCSIsSpacingModifierLetters(code);
41831 desret_int(ret_val);
41833 des_int(n_code, code, 0);
41834 xmlResetLastError();
41835 if (mem_base != xmlMemBlocks()) {
41836 printf("Leak of %d blocks found in xmlUCSIsSpacingModifierLetters",
41837 xmlMemBlocks() - mem_base);
41839 printf(" %d", n_code);
41851 test_xmlUCSIsSpecials(void) {
41854 #if defined(LIBXML_UNICODE_ENABLED)
41857 int code; /* UCS code point */
41860 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41861 mem_base = xmlMemBlocks();
41862 code = gen_int(n_code, 0);
41864 ret_val = xmlUCSIsSpecials(code);
41865 desret_int(ret_val);
41867 des_int(n_code, code, 0);
41868 xmlResetLastError();
41869 if (mem_base != xmlMemBlocks()) {
41870 printf("Leak of %d blocks found in xmlUCSIsSpecials",
41871 xmlMemBlocks() - mem_base);
41873 printf(" %d", n_code);
41885 test_xmlUCSIsSuperscriptsandSubscripts(void) {
41888 #if defined(LIBXML_UNICODE_ENABLED)
41891 int code; /* UCS code point */
41894 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41895 mem_base = xmlMemBlocks();
41896 code = gen_int(n_code, 0);
41898 ret_val = xmlUCSIsSuperscriptsandSubscripts(code);
41899 desret_int(ret_val);
41901 des_int(n_code, code, 0);
41902 xmlResetLastError();
41903 if (mem_base != xmlMemBlocks()) {
41904 printf("Leak of %d blocks found in xmlUCSIsSuperscriptsandSubscripts",
41905 xmlMemBlocks() - mem_base);
41907 printf(" %d", n_code);
41919 test_xmlUCSIsSupplementalArrowsA(void) {
41922 #if defined(LIBXML_UNICODE_ENABLED)
41925 int code; /* UCS code point */
41928 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41929 mem_base = xmlMemBlocks();
41930 code = gen_int(n_code, 0);
41932 ret_val = xmlUCSIsSupplementalArrowsA(code);
41933 desret_int(ret_val);
41935 des_int(n_code, code, 0);
41936 xmlResetLastError();
41937 if (mem_base != xmlMemBlocks()) {
41938 printf("Leak of %d blocks found in xmlUCSIsSupplementalArrowsA",
41939 xmlMemBlocks() - mem_base);
41941 printf(" %d", n_code);
41953 test_xmlUCSIsSupplementalArrowsB(void) {
41956 #if defined(LIBXML_UNICODE_ENABLED)
41959 int code; /* UCS code point */
41962 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41963 mem_base = xmlMemBlocks();
41964 code = gen_int(n_code, 0);
41966 ret_val = xmlUCSIsSupplementalArrowsB(code);
41967 desret_int(ret_val);
41969 des_int(n_code, code, 0);
41970 xmlResetLastError();
41971 if (mem_base != xmlMemBlocks()) {
41972 printf("Leak of %d blocks found in xmlUCSIsSupplementalArrowsB",
41973 xmlMemBlocks() - mem_base);
41975 printf(" %d", n_code);
41987 test_xmlUCSIsSupplementalMathematicalOperators(void) {
41990 #if defined(LIBXML_UNICODE_ENABLED)
41993 int code; /* UCS code point */
41996 for (n_code = 0;n_code < gen_nb_int;n_code++) {
41997 mem_base = xmlMemBlocks();
41998 code = gen_int(n_code, 0);
42000 ret_val = xmlUCSIsSupplementalMathematicalOperators(code);
42001 desret_int(ret_val);
42003 des_int(n_code, code, 0);
42004 xmlResetLastError();
42005 if (mem_base != xmlMemBlocks()) {
42006 printf("Leak of %d blocks found in xmlUCSIsSupplementalMathematicalOperators",
42007 xmlMemBlocks() - mem_base);
42009 printf(" %d", n_code);
42021 test_xmlUCSIsSupplementaryPrivateUseAreaA(void) {
42024 #if defined(LIBXML_UNICODE_ENABLED)
42027 int code; /* UCS code point */
42030 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42031 mem_base = xmlMemBlocks();
42032 code = gen_int(n_code, 0);
42034 ret_val = xmlUCSIsSupplementaryPrivateUseAreaA(code);
42035 desret_int(ret_val);
42037 des_int(n_code, code, 0);
42038 xmlResetLastError();
42039 if (mem_base != xmlMemBlocks()) {
42040 printf("Leak of %d blocks found in xmlUCSIsSupplementaryPrivateUseAreaA",
42041 xmlMemBlocks() - mem_base);
42043 printf(" %d", n_code);
42055 test_xmlUCSIsSupplementaryPrivateUseAreaB(void) {
42058 #if defined(LIBXML_UNICODE_ENABLED)
42061 int code; /* UCS code point */
42064 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42065 mem_base = xmlMemBlocks();
42066 code = gen_int(n_code, 0);
42068 ret_val = xmlUCSIsSupplementaryPrivateUseAreaB(code);
42069 desret_int(ret_val);
42071 des_int(n_code, code, 0);
42072 xmlResetLastError();
42073 if (mem_base != xmlMemBlocks()) {
42074 printf("Leak of %d blocks found in xmlUCSIsSupplementaryPrivateUseAreaB",
42075 xmlMemBlocks() - mem_base);
42077 printf(" %d", n_code);
42089 test_xmlUCSIsSyriac(void) {
42092 #if defined(LIBXML_UNICODE_ENABLED)
42095 int code; /* UCS code point */
42098 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42099 mem_base = xmlMemBlocks();
42100 code = gen_int(n_code, 0);
42102 ret_val = xmlUCSIsSyriac(code);
42103 desret_int(ret_val);
42105 des_int(n_code, code, 0);
42106 xmlResetLastError();
42107 if (mem_base != xmlMemBlocks()) {
42108 printf("Leak of %d blocks found in xmlUCSIsSyriac",
42109 xmlMemBlocks() - mem_base);
42111 printf(" %d", n_code);
42123 test_xmlUCSIsTagalog(void) {
42126 #if defined(LIBXML_UNICODE_ENABLED)
42129 int code; /* UCS code point */
42132 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42133 mem_base = xmlMemBlocks();
42134 code = gen_int(n_code, 0);
42136 ret_val = xmlUCSIsTagalog(code);
42137 desret_int(ret_val);
42139 des_int(n_code, code, 0);
42140 xmlResetLastError();
42141 if (mem_base != xmlMemBlocks()) {
42142 printf("Leak of %d blocks found in xmlUCSIsTagalog",
42143 xmlMemBlocks() - mem_base);
42145 printf(" %d", n_code);
42157 test_xmlUCSIsTagbanwa(void) {
42160 #if defined(LIBXML_UNICODE_ENABLED)
42163 int code; /* UCS code point */
42166 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42167 mem_base = xmlMemBlocks();
42168 code = gen_int(n_code, 0);
42170 ret_val = xmlUCSIsTagbanwa(code);
42171 desret_int(ret_val);
42173 des_int(n_code, code, 0);
42174 xmlResetLastError();
42175 if (mem_base != xmlMemBlocks()) {
42176 printf("Leak of %d blocks found in xmlUCSIsTagbanwa",
42177 xmlMemBlocks() - mem_base);
42179 printf(" %d", n_code);
42191 test_xmlUCSIsTags(void) {
42194 #if defined(LIBXML_UNICODE_ENABLED)
42197 int code; /* UCS code point */
42200 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42201 mem_base = xmlMemBlocks();
42202 code = gen_int(n_code, 0);
42204 ret_val = xmlUCSIsTags(code);
42205 desret_int(ret_val);
42207 des_int(n_code, code, 0);
42208 xmlResetLastError();
42209 if (mem_base != xmlMemBlocks()) {
42210 printf("Leak of %d blocks found in xmlUCSIsTags",
42211 xmlMemBlocks() - mem_base);
42213 printf(" %d", n_code);
42225 test_xmlUCSIsTaiLe(void) {
42228 #if defined(LIBXML_UNICODE_ENABLED)
42231 int code; /* UCS code point */
42234 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42235 mem_base = xmlMemBlocks();
42236 code = gen_int(n_code, 0);
42238 ret_val = xmlUCSIsTaiLe(code);
42239 desret_int(ret_val);
42241 des_int(n_code, code, 0);
42242 xmlResetLastError();
42243 if (mem_base != xmlMemBlocks()) {
42244 printf("Leak of %d blocks found in xmlUCSIsTaiLe",
42245 xmlMemBlocks() - mem_base);
42247 printf(" %d", n_code);
42259 test_xmlUCSIsTaiXuanJingSymbols(void) {
42262 #if defined(LIBXML_UNICODE_ENABLED)
42265 int code; /* UCS code point */
42268 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42269 mem_base = xmlMemBlocks();
42270 code = gen_int(n_code, 0);
42272 ret_val = xmlUCSIsTaiXuanJingSymbols(code);
42273 desret_int(ret_val);
42275 des_int(n_code, code, 0);
42276 xmlResetLastError();
42277 if (mem_base != xmlMemBlocks()) {
42278 printf("Leak of %d blocks found in xmlUCSIsTaiXuanJingSymbols",
42279 xmlMemBlocks() - mem_base);
42281 printf(" %d", n_code);
42293 test_xmlUCSIsTamil(void) {
42296 #if defined(LIBXML_UNICODE_ENABLED)
42299 int code; /* UCS code point */
42302 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42303 mem_base = xmlMemBlocks();
42304 code = gen_int(n_code, 0);
42306 ret_val = xmlUCSIsTamil(code);
42307 desret_int(ret_val);
42309 des_int(n_code, code, 0);
42310 xmlResetLastError();
42311 if (mem_base != xmlMemBlocks()) {
42312 printf("Leak of %d blocks found in xmlUCSIsTamil",
42313 xmlMemBlocks() - mem_base);
42315 printf(" %d", n_code);
42327 test_xmlUCSIsTelugu(void) {
42330 #if defined(LIBXML_UNICODE_ENABLED)
42333 int code; /* UCS code point */
42336 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42337 mem_base = xmlMemBlocks();
42338 code = gen_int(n_code, 0);
42340 ret_val = xmlUCSIsTelugu(code);
42341 desret_int(ret_val);
42343 des_int(n_code, code, 0);
42344 xmlResetLastError();
42345 if (mem_base != xmlMemBlocks()) {
42346 printf("Leak of %d blocks found in xmlUCSIsTelugu",
42347 xmlMemBlocks() - mem_base);
42349 printf(" %d", n_code);
42361 test_xmlUCSIsThaana(void) {
42364 #if defined(LIBXML_UNICODE_ENABLED)
42367 int code; /* UCS code point */
42370 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42371 mem_base = xmlMemBlocks();
42372 code = gen_int(n_code, 0);
42374 ret_val = xmlUCSIsThaana(code);
42375 desret_int(ret_val);
42377 des_int(n_code, code, 0);
42378 xmlResetLastError();
42379 if (mem_base != xmlMemBlocks()) {
42380 printf("Leak of %d blocks found in xmlUCSIsThaana",
42381 xmlMemBlocks() - mem_base);
42383 printf(" %d", n_code);
42395 test_xmlUCSIsThai(void) {
42398 #if defined(LIBXML_UNICODE_ENABLED)
42401 int code; /* UCS code point */
42404 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42405 mem_base = xmlMemBlocks();
42406 code = gen_int(n_code, 0);
42408 ret_val = xmlUCSIsThai(code);
42409 desret_int(ret_val);
42411 des_int(n_code, code, 0);
42412 xmlResetLastError();
42413 if (mem_base != xmlMemBlocks()) {
42414 printf("Leak of %d blocks found in xmlUCSIsThai",
42415 xmlMemBlocks() - mem_base);
42417 printf(" %d", n_code);
42429 test_xmlUCSIsTibetan(void) {
42432 #if defined(LIBXML_UNICODE_ENABLED)
42435 int code; /* UCS code point */
42438 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42439 mem_base = xmlMemBlocks();
42440 code = gen_int(n_code, 0);
42442 ret_val = xmlUCSIsTibetan(code);
42443 desret_int(ret_val);
42445 des_int(n_code, code, 0);
42446 xmlResetLastError();
42447 if (mem_base != xmlMemBlocks()) {
42448 printf("Leak of %d blocks found in xmlUCSIsTibetan",
42449 xmlMemBlocks() - mem_base);
42451 printf(" %d", n_code);
42463 test_xmlUCSIsUgaritic(void) {
42466 #if defined(LIBXML_UNICODE_ENABLED)
42469 int code; /* UCS code point */
42472 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42473 mem_base = xmlMemBlocks();
42474 code = gen_int(n_code, 0);
42476 ret_val = xmlUCSIsUgaritic(code);
42477 desret_int(ret_val);
42479 des_int(n_code, code, 0);
42480 xmlResetLastError();
42481 if (mem_base != xmlMemBlocks()) {
42482 printf("Leak of %d blocks found in xmlUCSIsUgaritic",
42483 xmlMemBlocks() - mem_base);
42485 printf(" %d", n_code);
42497 test_xmlUCSIsUnifiedCanadianAboriginalSyllabics(void) {
42500 #if defined(LIBXML_UNICODE_ENABLED)
42503 int code; /* UCS code point */
42506 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42507 mem_base = xmlMemBlocks();
42508 code = gen_int(n_code, 0);
42510 ret_val = xmlUCSIsUnifiedCanadianAboriginalSyllabics(code);
42511 desret_int(ret_val);
42513 des_int(n_code, code, 0);
42514 xmlResetLastError();
42515 if (mem_base != xmlMemBlocks()) {
42516 printf("Leak of %d blocks found in xmlUCSIsUnifiedCanadianAboriginalSyllabics",
42517 xmlMemBlocks() - mem_base);
42519 printf(" %d", n_code);
42531 test_xmlUCSIsVariationSelectors(void) {
42534 #if defined(LIBXML_UNICODE_ENABLED)
42537 int code; /* UCS code point */
42540 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42541 mem_base = xmlMemBlocks();
42542 code = gen_int(n_code, 0);
42544 ret_val = xmlUCSIsVariationSelectors(code);
42545 desret_int(ret_val);
42547 des_int(n_code, code, 0);
42548 xmlResetLastError();
42549 if (mem_base != xmlMemBlocks()) {
42550 printf("Leak of %d blocks found in xmlUCSIsVariationSelectors",
42551 xmlMemBlocks() - mem_base);
42553 printf(" %d", n_code);
42565 test_xmlUCSIsVariationSelectorsSupplement(void) {
42568 #if defined(LIBXML_UNICODE_ENABLED)
42571 int code; /* UCS code point */
42574 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42575 mem_base = xmlMemBlocks();
42576 code = gen_int(n_code, 0);
42578 ret_val = xmlUCSIsVariationSelectorsSupplement(code);
42579 desret_int(ret_val);
42581 des_int(n_code, code, 0);
42582 xmlResetLastError();
42583 if (mem_base != xmlMemBlocks()) {
42584 printf("Leak of %d blocks found in xmlUCSIsVariationSelectorsSupplement",
42585 xmlMemBlocks() - mem_base);
42587 printf(" %d", n_code);
42599 test_xmlUCSIsYiRadicals(void) {
42602 #if defined(LIBXML_UNICODE_ENABLED)
42605 int code; /* UCS code point */
42608 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42609 mem_base = xmlMemBlocks();
42610 code = gen_int(n_code, 0);
42612 ret_val = xmlUCSIsYiRadicals(code);
42613 desret_int(ret_val);
42615 des_int(n_code, code, 0);
42616 xmlResetLastError();
42617 if (mem_base != xmlMemBlocks()) {
42618 printf("Leak of %d blocks found in xmlUCSIsYiRadicals",
42619 xmlMemBlocks() - mem_base);
42621 printf(" %d", n_code);
42633 test_xmlUCSIsYiSyllables(void) {
42636 #if defined(LIBXML_UNICODE_ENABLED)
42639 int code; /* UCS code point */
42642 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42643 mem_base = xmlMemBlocks();
42644 code = gen_int(n_code, 0);
42646 ret_val = xmlUCSIsYiSyllables(code);
42647 desret_int(ret_val);
42649 des_int(n_code, code, 0);
42650 xmlResetLastError();
42651 if (mem_base != xmlMemBlocks()) {
42652 printf("Leak of %d blocks found in xmlUCSIsYiSyllables",
42653 xmlMemBlocks() - mem_base);
42655 printf(" %d", n_code);
42667 test_xmlUCSIsYijingHexagramSymbols(void) {
42670 #if defined(LIBXML_UNICODE_ENABLED)
42673 int code; /* UCS code point */
42676 for (n_code = 0;n_code < gen_nb_int;n_code++) {
42677 mem_base = xmlMemBlocks();
42678 code = gen_int(n_code, 0);
42680 ret_val = xmlUCSIsYijingHexagramSymbols(code);
42681 desret_int(ret_val);
42683 des_int(n_code, code, 0);
42684 xmlResetLastError();
42685 if (mem_base != xmlMemBlocks()) {
42686 printf("Leak of %d blocks found in xmlUCSIsYijingHexagramSymbols",
42687 xmlMemBlocks() - mem_base);
42689 printf(" %d", n_code);
42700 test_xmlunicode(void) {
42703 if (quiet == 0) printf("Testing xmlunicode : 166 of 166 functions ...\n");
42704 test_ret += test_xmlUCSIsAegeanNumbers();
42705 test_ret += test_xmlUCSIsAlphabeticPresentationForms();
42706 test_ret += test_xmlUCSIsArabic();
42707 test_ret += test_xmlUCSIsArabicPresentationFormsA();
42708 test_ret += test_xmlUCSIsArabicPresentationFormsB();
42709 test_ret += test_xmlUCSIsArmenian();
42710 test_ret += test_xmlUCSIsArrows();
42711 test_ret += test_xmlUCSIsBasicLatin();
42712 test_ret += test_xmlUCSIsBengali();
42713 test_ret += test_xmlUCSIsBlock();
42714 test_ret += test_xmlUCSIsBlockElements();
42715 test_ret += test_xmlUCSIsBopomofo();
42716 test_ret += test_xmlUCSIsBopomofoExtended();
42717 test_ret += test_xmlUCSIsBoxDrawing();
42718 test_ret += test_xmlUCSIsBraillePatterns();
42719 test_ret += test_xmlUCSIsBuhid();
42720 test_ret += test_xmlUCSIsByzantineMusicalSymbols();
42721 test_ret += test_xmlUCSIsCJKCompatibility();
42722 test_ret += test_xmlUCSIsCJKCompatibilityForms();
42723 test_ret += test_xmlUCSIsCJKCompatibilityIdeographs();
42724 test_ret += test_xmlUCSIsCJKCompatibilityIdeographsSupplement();
42725 test_ret += test_xmlUCSIsCJKRadicalsSupplement();
42726 test_ret += test_xmlUCSIsCJKSymbolsandPunctuation();
42727 test_ret += test_xmlUCSIsCJKUnifiedIdeographs();
42728 test_ret += test_xmlUCSIsCJKUnifiedIdeographsExtensionA();
42729 test_ret += test_xmlUCSIsCJKUnifiedIdeographsExtensionB();
42730 test_ret += test_xmlUCSIsCat();
42731 test_ret += test_xmlUCSIsCatC();
42732 test_ret += test_xmlUCSIsCatCc();
42733 test_ret += test_xmlUCSIsCatCf();
42734 test_ret += test_xmlUCSIsCatCo();
42735 test_ret += test_xmlUCSIsCatCs();
42736 test_ret += test_xmlUCSIsCatL();
42737 test_ret += test_xmlUCSIsCatLl();
42738 test_ret += test_xmlUCSIsCatLm();
42739 test_ret += test_xmlUCSIsCatLo();
42740 test_ret += test_xmlUCSIsCatLt();
42741 test_ret += test_xmlUCSIsCatLu();
42742 test_ret += test_xmlUCSIsCatM();
42743 test_ret += test_xmlUCSIsCatMc();
42744 test_ret += test_xmlUCSIsCatMe();
42745 test_ret += test_xmlUCSIsCatMn();
42746 test_ret += test_xmlUCSIsCatN();
42747 test_ret += test_xmlUCSIsCatNd();
42748 test_ret += test_xmlUCSIsCatNl();
42749 test_ret += test_xmlUCSIsCatNo();
42750 test_ret += test_xmlUCSIsCatP();
42751 test_ret += test_xmlUCSIsCatPc();
42752 test_ret += test_xmlUCSIsCatPd();
42753 test_ret += test_xmlUCSIsCatPe();
42754 test_ret += test_xmlUCSIsCatPf();
42755 test_ret += test_xmlUCSIsCatPi();
42756 test_ret += test_xmlUCSIsCatPo();
42757 test_ret += test_xmlUCSIsCatPs();
42758 test_ret += test_xmlUCSIsCatS();
42759 test_ret += test_xmlUCSIsCatSc();
42760 test_ret += test_xmlUCSIsCatSk();
42761 test_ret += test_xmlUCSIsCatSm();
42762 test_ret += test_xmlUCSIsCatSo();
42763 test_ret += test_xmlUCSIsCatZ();
42764 test_ret += test_xmlUCSIsCatZl();
42765 test_ret += test_xmlUCSIsCatZp();
42766 test_ret += test_xmlUCSIsCatZs();
42767 test_ret += test_xmlUCSIsCherokee();
42768 test_ret += test_xmlUCSIsCombiningDiacriticalMarks();
42769 test_ret += test_xmlUCSIsCombiningDiacriticalMarksforSymbols();
42770 test_ret += test_xmlUCSIsCombiningHalfMarks();
42771 test_ret += test_xmlUCSIsCombiningMarksforSymbols();
42772 test_ret += test_xmlUCSIsControlPictures();
42773 test_ret += test_xmlUCSIsCurrencySymbols();
42774 test_ret += test_xmlUCSIsCypriotSyllabary();
42775 test_ret += test_xmlUCSIsCyrillic();
42776 test_ret += test_xmlUCSIsCyrillicSupplement();
42777 test_ret += test_xmlUCSIsDeseret();
42778 test_ret += test_xmlUCSIsDevanagari();
42779 test_ret += test_xmlUCSIsDingbats();
42780 test_ret += test_xmlUCSIsEnclosedAlphanumerics();
42781 test_ret += test_xmlUCSIsEnclosedCJKLettersandMonths();
42782 test_ret += test_xmlUCSIsEthiopic();
42783 test_ret += test_xmlUCSIsGeneralPunctuation();
42784 test_ret += test_xmlUCSIsGeometricShapes();
42785 test_ret += test_xmlUCSIsGeorgian();
42786 test_ret += test_xmlUCSIsGothic();
42787 test_ret += test_xmlUCSIsGreek();
42788 test_ret += test_xmlUCSIsGreekExtended();
42789 test_ret += test_xmlUCSIsGreekandCoptic();
42790 test_ret += test_xmlUCSIsGujarati();
42791 test_ret += test_xmlUCSIsGurmukhi();
42792 test_ret += test_xmlUCSIsHalfwidthandFullwidthForms();
42793 test_ret += test_xmlUCSIsHangulCompatibilityJamo();
42794 test_ret += test_xmlUCSIsHangulJamo();
42795 test_ret += test_xmlUCSIsHangulSyllables();
42796 test_ret += test_xmlUCSIsHanunoo();
42797 test_ret += test_xmlUCSIsHebrew();
42798 test_ret += test_xmlUCSIsHighPrivateUseSurrogates();
42799 test_ret += test_xmlUCSIsHighSurrogates();
42800 test_ret += test_xmlUCSIsHiragana();
42801 test_ret += test_xmlUCSIsIPAExtensions();
42802 test_ret += test_xmlUCSIsIdeographicDescriptionCharacters();
42803 test_ret += test_xmlUCSIsKanbun();
42804 test_ret += test_xmlUCSIsKangxiRadicals();
42805 test_ret += test_xmlUCSIsKannada();
42806 test_ret += test_xmlUCSIsKatakana();
42807 test_ret += test_xmlUCSIsKatakanaPhoneticExtensions();
42808 test_ret += test_xmlUCSIsKhmer();
42809 test_ret += test_xmlUCSIsKhmerSymbols();
42810 test_ret += test_xmlUCSIsLao();
42811 test_ret += test_xmlUCSIsLatin1Supplement();
42812 test_ret += test_xmlUCSIsLatinExtendedA();
42813 test_ret += test_xmlUCSIsLatinExtendedAdditional();
42814 test_ret += test_xmlUCSIsLatinExtendedB();
42815 test_ret += test_xmlUCSIsLetterlikeSymbols();
42816 test_ret += test_xmlUCSIsLimbu();
42817 test_ret += test_xmlUCSIsLinearBIdeograms();
42818 test_ret += test_xmlUCSIsLinearBSyllabary();
42819 test_ret += test_xmlUCSIsLowSurrogates();
42820 test_ret += test_xmlUCSIsMalayalam();
42821 test_ret += test_xmlUCSIsMathematicalAlphanumericSymbols();
42822 test_ret += test_xmlUCSIsMathematicalOperators();
42823 test_ret += test_xmlUCSIsMiscellaneousMathematicalSymbolsA();
42824 test_ret += test_xmlUCSIsMiscellaneousMathematicalSymbolsB();
42825 test_ret += test_xmlUCSIsMiscellaneousSymbols();
42826 test_ret += test_xmlUCSIsMiscellaneousSymbolsandArrows();
42827 test_ret += test_xmlUCSIsMiscellaneousTechnical();
42828 test_ret += test_xmlUCSIsMongolian();
42829 test_ret += test_xmlUCSIsMusicalSymbols();
42830 test_ret += test_xmlUCSIsMyanmar();
42831 test_ret += test_xmlUCSIsNumberForms();
42832 test_ret += test_xmlUCSIsOgham();
42833 test_ret += test_xmlUCSIsOldItalic();
42834 test_ret += test_xmlUCSIsOpticalCharacterRecognition();
42835 test_ret += test_xmlUCSIsOriya();
42836 test_ret += test_xmlUCSIsOsmanya();
42837 test_ret += test_xmlUCSIsPhoneticExtensions();
42838 test_ret += test_xmlUCSIsPrivateUse();
42839 test_ret += test_xmlUCSIsPrivateUseArea();
42840 test_ret += test_xmlUCSIsRunic();
42841 test_ret += test_xmlUCSIsShavian();
42842 test_ret += test_xmlUCSIsSinhala();
42843 test_ret += test_xmlUCSIsSmallFormVariants();
42844 test_ret += test_xmlUCSIsSpacingModifierLetters();
42845 test_ret += test_xmlUCSIsSpecials();
42846 test_ret += test_xmlUCSIsSuperscriptsandSubscripts();
42847 test_ret += test_xmlUCSIsSupplementalArrowsA();
42848 test_ret += test_xmlUCSIsSupplementalArrowsB();
42849 test_ret += test_xmlUCSIsSupplementalMathematicalOperators();
42850 test_ret += test_xmlUCSIsSupplementaryPrivateUseAreaA();
42851 test_ret += test_xmlUCSIsSupplementaryPrivateUseAreaB();
42852 test_ret += test_xmlUCSIsSyriac();
42853 test_ret += test_xmlUCSIsTagalog();
42854 test_ret += test_xmlUCSIsTagbanwa();
42855 test_ret += test_xmlUCSIsTags();
42856 test_ret += test_xmlUCSIsTaiLe();
42857 test_ret += test_xmlUCSIsTaiXuanJingSymbols();
42858 test_ret += test_xmlUCSIsTamil();
42859 test_ret += test_xmlUCSIsTelugu();
42860 test_ret += test_xmlUCSIsThaana();
42861 test_ret += test_xmlUCSIsThai();
42862 test_ret += test_xmlUCSIsTibetan();
42863 test_ret += test_xmlUCSIsUgaritic();
42864 test_ret += test_xmlUCSIsUnifiedCanadianAboriginalSyllabics();
42865 test_ret += test_xmlUCSIsVariationSelectors();
42866 test_ret += test_xmlUCSIsVariationSelectorsSupplement();
42867 test_ret += test_xmlUCSIsYiRadicals();
42868 test_ret += test_xmlUCSIsYiSyllables();
42869 test_ret += test_xmlUCSIsYijingHexagramSymbols();
42872 printf("Module xmlunicode: %d errors\n", test_ret);
42877 test_xmlNewTextWriter(void) {
42880 #if defined(LIBXML_WRITER_ENABLED)
42882 xmlTextWriterPtr ret_val;
42883 xmlOutputBufferPtr out; /* an xmlOutputBufferPtr */
42886 for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
42887 mem_base = xmlMemBlocks();
42888 out = gen_xmlOutputBufferPtr(n_out, 0);
42890 ret_val = xmlNewTextWriter(out);
42891 if (ret_val != NULL) out = NULL;
42892 desret_xmlTextWriterPtr(ret_val);
42894 des_xmlOutputBufferPtr(n_out, out, 0);
42895 xmlResetLastError();
42896 if (mem_base != xmlMemBlocks()) {
42897 printf("Leak of %d blocks found in xmlNewTextWriter",
42898 xmlMemBlocks() - mem_base);
42900 printf(" %d", n_out);
42912 test_xmlNewTextWriterFilename(void) {
42915 #if defined(LIBXML_WRITER_ENABLED)
42917 xmlTextWriterPtr ret_val;
42918 const char * uri; /* the URI of the resource for the output */
42920 int compression; /* compress the output? */
42923 for (n_uri = 0;n_uri < gen_nb_fileoutput;n_uri++) {
42924 for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
42925 mem_base = xmlMemBlocks();
42926 uri = gen_fileoutput(n_uri, 0);
42927 compression = gen_int(n_compression, 1);
42929 ret_val = xmlNewTextWriterFilename(uri, compression);
42930 desret_xmlTextWriterPtr(ret_val);
42932 des_fileoutput(n_uri, uri, 0);
42933 des_int(n_compression, compression, 1);
42934 xmlResetLastError();
42935 if (mem_base != xmlMemBlocks()) {
42936 printf("Leak of %d blocks found in xmlNewTextWriterFilename",
42937 xmlMemBlocks() - mem_base);
42939 printf(" %d", n_uri);
42940 printf(" %d", n_compression);
42953 test_xmlNewTextWriterMemory(void) {
42956 #if defined(LIBXML_WRITER_ENABLED)
42958 xmlTextWriterPtr ret_val;
42959 xmlBufferPtr buf; /* xmlBufferPtr */
42961 int compression; /* compress the output? */
42964 for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
42965 for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
42966 mem_base = xmlMemBlocks();
42967 buf = gen_xmlBufferPtr(n_buf, 0);
42968 compression = gen_int(n_compression, 1);
42970 ret_val = xmlNewTextWriterMemory(buf, compression);
42971 desret_xmlTextWriterPtr(ret_val);
42973 des_xmlBufferPtr(n_buf, buf, 0);
42974 des_int(n_compression, compression, 1);
42975 xmlResetLastError();
42976 if (mem_base != xmlMemBlocks()) {
42977 printf("Leak of %d blocks found in xmlNewTextWriterMemory",
42978 xmlMemBlocks() - mem_base);
42980 printf(" %d", n_buf);
42981 printf(" %d", n_compression);
42994 test_xmlNewTextWriterPushParser(void) {
42997 #if defined(LIBXML_WRITER_ENABLED)
42999 xmlTextWriterPtr ret_val;
43000 xmlParserCtxtPtr ctxt; /* xmlParserCtxtPtr to hold the new XML document tree */
43002 int compression; /* compress the output? */
43005 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
43006 for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
43007 mem_base = xmlMemBlocks();
43008 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
43009 compression = gen_int(n_compression, 1);
43011 ret_val = xmlNewTextWriterPushParser(ctxt, compression);
43012 if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;} if (ret_val != NULL) ctxt = NULL;
43013 desret_xmlTextWriterPtr(ret_val);
43015 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
43016 des_int(n_compression, compression, 1);
43017 xmlResetLastError();
43018 if (mem_base != xmlMemBlocks()) {
43019 printf("Leak of %d blocks found in xmlNewTextWriterPushParser",
43020 xmlMemBlocks() - mem_base);
43022 printf(" %d", n_ctxt);
43023 printf(" %d", n_compression);
43036 test_xmlNewTextWriterTree(void) {
43039 #if defined(LIBXML_WRITER_ENABLED)
43041 xmlTextWriterPtr ret_val;
43042 xmlDocPtr doc; /* xmlDocPtr */
43044 xmlNodePtr node; /* xmlNodePtr or NULL for doc->children */
43046 int compression; /* compress the output? */
43049 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
43050 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
43051 for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
43052 mem_base = xmlMemBlocks();
43053 doc = gen_xmlDocPtr(n_doc, 0);
43054 node = gen_xmlNodePtr(n_node, 1);
43055 compression = gen_int(n_compression, 2);
43057 ret_val = xmlNewTextWriterTree(doc, node, compression);
43058 desret_xmlTextWriterPtr(ret_val);
43060 des_xmlDocPtr(n_doc, doc, 0);
43061 des_xmlNodePtr(n_node, node, 1);
43062 des_int(n_compression, compression, 2);
43063 xmlResetLastError();
43064 if (mem_base != xmlMemBlocks()) {
43065 printf("Leak of %d blocks found in xmlNewTextWriterTree",
43066 xmlMemBlocks() - mem_base);
43068 printf(" %d", n_doc);
43069 printf(" %d", n_node);
43070 printf(" %d", n_compression);
43084 test_xmlTextWriterEndAttribute(void) {
43087 #if defined(LIBXML_WRITER_ENABLED)
43090 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43093 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43094 mem_base = xmlMemBlocks();
43095 writer = gen_xmlTextWriterPtr(n_writer, 0);
43097 ret_val = xmlTextWriterEndAttribute(writer);
43098 desret_int(ret_val);
43100 des_xmlTextWriterPtr(n_writer, writer, 0);
43101 xmlResetLastError();
43102 if (mem_base != xmlMemBlocks()) {
43103 printf("Leak of %d blocks found in xmlTextWriterEndAttribute",
43104 xmlMemBlocks() - mem_base);
43106 printf(" %d", n_writer);
43118 test_xmlTextWriterEndCDATA(void) {
43121 #if defined(LIBXML_WRITER_ENABLED)
43124 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43127 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43128 mem_base = xmlMemBlocks();
43129 writer = gen_xmlTextWriterPtr(n_writer, 0);
43131 ret_val = xmlTextWriterEndCDATA(writer);
43132 desret_int(ret_val);
43134 des_xmlTextWriterPtr(n_writer, writer, 0);
43135 xmlResetLastError();
43136 if (mem_base != xmlMemBlocks()) {
43137 printf("Leak of %d blocks found in xmlTextWriterEndCDATA",
43138 xmlMemBlocks() - mem_base);
43140 printf(" %d", n_writer);
43152 test_xmlTextWriterEndComment(void) {
43155 #if defined(LIBXML_WRITER_ENABLED)
43158 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43161 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43162 mem_base = xmlMemBlocks();
43163 writer = gen_xmlTextWriterPtr(n_writer, 0);
43165 ret_val = xmlTextWriterEndComment(writer);
43166 desret_int(ret_val);
43168 des_xmlTextWriterPtr(n_writer, writer, 0);
43169 xmlResetLastError();
43170 if (mem_base != xmlMemBlocks()) {
43171 printf("Leak of %d blocks found in xmlTextWriterEndComment",
43172 xmlMemBlocks() - mem_base);
43174 printf(" %d", n_writer);
43186 test_xmlTextWriterEndDTD(void) {
43189 #if defined(LIBXML_WRITER_ENABLED)
43192 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43195 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43196 mem_base = xmlMemBlocks();
43197 writer = gen_xmlTextWriterPtr(n_writer, 0);
43199 ret_val = xmlTextWriterEndDTD(writer);
43200 desret_int(ret_val);
43202 des_xmlTextWriterPtr(n_writer, writer, 0);
43203 xmlResetLastError();
43204 if (mem_base != xmlMemBlocks()) {
43205 printf("Leak of %d blocks found in xmlTextWriterEndDTD",
43206 xmlMemBlocks() - mem_base);
43208 printf(" %d", n_writer);
43220 test_xmlTextWriterEndDTDAttlist(void) {
43223 #if defined(LIBXML_WRITER_ENABLED)
43226 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43229 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43230 mem_base = xmlMemBlocks();
43231 writer = gen_xmlTextWriterPtr(n_writer, 0);
43233 ret_val = xmlTextWriterEndDTDAttlist(writer);
43234 desret_int(ret_val);
43236 des_xmlTextWriterPtr(n_writer, writer, 0);
43237 xmlResetLastError();
43238 if (mem_base != xmlMemBlocks()) {
43239 printf("Leak of %d blocks found in xmlTextWriterEndDTDAttlist",
43240 xmlMemBlocks() - mem_base);
43242 printf(" %d", n_writer);
43254 test_xmlTextWriterEndDTDElement(void) {
43257 #if defined(LIBXML_WRITER_ENABLED)
43260 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43263 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43264 mem_base = xmlMemBlocks();
43265 writer = gen_xmlTextWriterPtr(n_writer, 0);
43267 ret_val = xmlTextWriterEndDTDElement(writer);
43268 desret_int(ret_val);
43270 des_xmlTextWriterPtr(n_writer, writer, 0);
43271 xmlResetLastError();
43272 if (mem_base != xmlMemBlocks()) {
43273 printf("Leak of %d blocks found in xmlTextWriterEndDTDElement",
43274 xmlMemBlocks() - mem_base);
43276 printf(" %d", n_writer);
43288 test_xmlTextWriterEndDTDEntity(void) {
43291 #if defined(LIBXML_WRITER_ENABLED)
43294 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43297 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43298 mem_base = xmlMemBlocks();
43299 writer = gen_xmlTextWriterPtr(n_writer, 0);
43301 ret_val = xmlTextWriterEndDTDEntity(writer);
43302 desret_int(ret_val);
43304 des_xmlTextWriterPtr(n_writer, writer, 0);
43305 xmlResetLastError();
43306 if (mem_base != xmlMemBlocks()) {
43307 printf("Leak of %d blocks found in xmlTextWriterEndDTDEntity",
43308 xmlMemBlocks() - mem_base);
43310 printf(" %d", n_writer);
43322 test_xmlTextWriterEndDocument(void) {
43325 #if defined(LIBXML_WRITER_ENABLED)
43328 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43331 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43332 mem_base = xmlMemBlocks();
43333 writer = gen_xmlTextWriterPtr(n_writer, 0);
43335 ret_val = xmlTextWriterEndDocument(writer);
43336 desret_int(ret_val);
43338 des_xmlTextWriterPtr(n_writer, writer, 0);
43339 xmlResetLastError();
43340 if (mem_base != xmlMemBlocks()) {
43341 printf("Leak of %d blocks found in xmlTextWriterEndDocument",
43342 xmlMemBlocks() - mem_base);
43344 printf(" %d", n_writer);
43356 test_xmlTextWriterEndElement(void) {
43359 #if defined(LIBXML_WRITER_ENABLED)
43362 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43365 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43366 mem_base = xmlMemBlocks();
43367 writer = gen_xmlTextWriterPtr(n_writer, 0);
43369 ret_val = xmlTextWriterEndElement(writer);
43370 desret_int(ret_val);
43372 des_xmlTextWriterPtr(n_writer, writer, 0);
43373 xmlResetLastError();
43374 if (mem_base != xmlMemBlocks()) {
43375 printf("Leak of %d blocks found in xmlTextWriterEndElement",
43376 xmlMemBlocks() - mem_base);
43378 printf(" %d", n_writer);
43390 test_xmlTextWriterEndPI(void) {
43393 #if defined(LIBXML_WRITER_ENABLED)
43396 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43399 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43400 mem_base = xmlMemBlocks();
43401 writer = gen_xmlTextWriterPtr(n_writer, 0);
43403 ret_val = xmlTextWriterEndPI(writer);
43404 desret_int(ret_val);
43406 des_xmlTextWriterPtr(n_writer, writer, 0);
43407 xmlResetLastError();
43408 if (mem_base != xmlMemBlocks()) {
43409 printf("Leak of %d blocks found in xmlTextWriterEndPI",
43410 xmlMemBlocks() - mem_base);
43412 printf(" %d", n_writer);
43424 test_xmlTextWriterFlush(void) {
43427 #if defined(LIBXML_WRITER_ENABLED)
43430 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43433 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43434 mem_base = xmlMemBlocks();
43435 writer = gen_xmlTextWriterPtr(n_writer, 0);
43437 ret_val = xmlTextWriterFlush(writer);
43438 desret_int(ret_val);
43440 des_xmlTextWriterPtr(n_writer, writer, 0);
43441 xmlResetLastError();
43442 if (mem_base != xmlMemBlocks()) {
43443 printf("Leak of %d blocks found in xmlTextWriterFlush",
43444 xmlMemBlocks() - mem_base);
43446 printf(" %d", n_writer);
43458 test_xmlTextWriterFullEndElement(void) {
43461 #if defined(LIBXML_WRITER_ENABLED)
43464 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43467 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43468 mem_base = xmlMemBlocks();
43469 writer = gen_xmlTextWriterPtr(n_writer, 0);
43471 ret_val = xmlTextWriterFullEndElement(writer);
43472 desret_int(ret_val);
43474 des_xmlTextWriterPtr(n_writer, writer, 0);
43475 xmlResetLastError();
43476 if (mem_base != xmlMemBlocks()) {
43477 printf("Leak of %d blocks found in xmlTextWriterFullEndElement",
43478 xmlMemBlocks() - mem_base);
43480 printf(" %d", n_writer);
43492 test_xmlTextWriterSetIndent(void) {
43495 #if defined(LIBXML_WRITER_ENABLED)
43498 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43500 int indent; /* do indentation? */
43503 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43504 for (n_indent = 0;n_indent < gen_nb_int;n_indent++) {
43505 mem_base = xmlMemBlocks();
43506 writer = gen_xmlTextWriterPtr(n_writer, 0);
43507 indent = gen_int(n_indent, 1);
43509 ret_val = xmlTextWriterSetIndent(writer, indent);
43510 desret_int(ret_val);
43512 des_xmlTextWriterPtr(n_writer, writer, 0);
43513 des_int(n_indent, indent, 1);
43514 xmlResetLastError();
43515 if (mem_base != xmlMemBlocks()) {
43516 printf("Leak of %d blocks found in xmlTextWriterSetIndent",
43517 xmlMemBlocks() - mem_base);
43519 printf(" %d", n_writer);
43520 printf(" %d", n_indent);
43533 test_xmlTextWriterSetIndentString(void) {
43536 #if defined(LIBXML_WRITER_ENABLED)
43539 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43541 xmlChar * str; /* the xmlChar string */
43544 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43545 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
43546 mem_base = xmlMemBlocks();
43547 writer = gen_xmlTextWriterPtr(n_writer, 0);
43548 str = gen_const_xmlChar_ptr(n_str, 1);
43550 ret_val = xmlTextWriterSetIndentString(writer, (const xmlChar *)str);
43551 desret_int(ret_val);
43553 des_xmlTextWriterPtr(n_writer, writer, 0);
43554 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
43555 xmlResetLastError();
43556 if (mem_base != xmlMemBlocks()) {
43557 printf("Leak of %d blocks found in xmlTextWriterSetIndentString",
43558 xmlMemBlocks() - mem_base);
43560 printf(" %d", n_writer);
43561 printf(" %d", n_str);
43574 test_xmlTextWriterStartAttribute(void) {
43577 #if defined(LIBXML_WRITER_ENABLED)
43580 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43582 xmlChar * name; /* element name */
43585 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43586 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43587 mem_base = xmlMemBlocks();
43588 writer = gen_xmlTextWriterPtr(n_writer, 0);
43589 name = gen_const_xmlChar_ptr(n_name, 1);
43591 ret_val = xmlTextWriterStartAttribute(writer, (const xmlChar *)name);
43592 desret_int(ret_val);
43594 des_xmlTextWriterPtr(n_writer, writer, 0);
43595 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
43596 xmlResetLastError();
43597 if (mem_base != xmlMemBlocks()) {
43598 printf("Leak of %d blocks found in xmlTextWriterStartAttribute",
43599 xmlMemBlocks() - mem_base);
43601 printf(" %d", n_writer);
43602 printf(" %d", n_name);
43615 test_xmlTextWriterStartAttributeNS(void) {
43618 #if defined(LIBXML_WRITER_ENABLED)
43621 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43623 xmlChar * prefix; /* namespace prefix or NULL */
43625 xmlChar * name; /* element local name */
43627 xmlChar * namespaceURI; /* namespace URI or NULL */
43628 int n_namespaceURI;
43630 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43631 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
43632 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43633 for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
43634 mem_base = xmlMemBlocks();
43635 writer = gen_xmlTextWriterPtr(n_writer, 0);
43636 prefix = gen_const_xmlChar_ptr(n_prefix, 1);
43637 name = gen_const_xmlChar_ptr(n_name, 2);
43638 namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3);
43640 ret_val = xmlTextWriterStartAttributeNS(writer, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)namespaceURI);
43641 desret_int(ret_val);
43643 des_xmlTextWriterPtr(n_writer, writer, 0);
43644 des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
43645 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
43646 des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 3);
43647 xmlResetLastError();
43648 if (mem_base != xmlMemBlocks()) {
43649 printf("Leak of %d blocks found in xmlTextWriterStartAttributeNS",
43650 xmlMemBlocks() - mem_base);
43652 printf(" %d", n_writer);
43653 printf(" %d", n_prefix);
43654 printf(" %d", n_name);
43655 printf(" %d", n_namespaceURI);
43670 test_xmlTextWriterStartCDATA(void) {
43673 #if defined(LIBXML_WRITER_ENABLED)
43676 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43679 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43680 mem_base = xmlMemBlocks();
43681 writer = gen_xmlTextWriterPtr(n_writer, 0);
43683 ret_val = xmlTextWriterStartCDATA(writer);
43684 desret_int(ret_val);
43686 des_xmlTextWriterPtr(n_writer, writer, 0);
43687 xmlResetLastError();
43688 if (mem_base != xmlMemBlocks()) {
43689 printf("Leak of %d blocks found in xmlTextWriterStartCDATA",
43690 xmlMemBlocks() - mem_base);
43692 printf(" %d", n_writer);
43704 test_xmlTextWriterStartComment(void) {
43707 #if defined(LIBXML_WRITER_ENABLED)
43710 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43713 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43714 mem_base = xmlMemBlocks();
43715 writer = gen_xmlTextWriterPtr(n_writer, 0);
43717 ret_val = xmlTextWriterStartComment(writer);
43718 desret_int(ret_val);
43720 des_xmlTextWriterPtr(n_writer, writer, 0);
43721 xmlResetLastError();
43722 if (mem_base != xmlMemBlocks()) {
43723 printf("Leak of %d blocks found in xmlTextWriterStartComment",
43724 xmlMemBlocks() - mem_base);
43726 printf(" %d", n_writer);
43738 test_xmlTextWriterStartDTD(void) {
43741 #if defined(LIBXML_WRITER_ENABLED)
43744 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43746 xmlChar * name; /* the name of the DTD */
43748 xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
43750 xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
43753 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43754 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43755 for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
43756 for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
43757 mem_base = xmlMemBlocks();
43758 writer = gen_xmlTextWriterPtr(n_writer, 0);
43759 name = gen_const_xmlChar_ptr(n_name, 1);
43760 pubid = gen_const_xmlChar_ptr(n_pubid, 2);
43761 sysid = gen_const_xmlChar_ptr(n_sysid, 3);
43763 ret_val = xmlTextWriterStartDTD(writer, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid);
43764 desret_int(ret_val);
43766 des_xmlTextWriterPtr(n_writer, writer, 0);
43767 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
43768 des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 2);
43769 des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 3);
43770 xmlResetLastError();
43771 if (mem_base != xmlMemBlocks()) {
43772 printf("Leak of %d blocks found in xmlTextWriterStartDTD",
43773 xmlMemBlocks() - mem_base);
43775 printf(" %d", n_writer);
43776 printf(" %d", n_name);
43777 printf(" %d", n_pubid);
43778 printf(" %d", n_sysid);
43793 test_xmlTextWriterStartDTDAttlist(void) {
43796 #if defined(LIBXML_WRITER_ENABLED)
43799 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43801 xmlChar * name; /* the name of the DTD ATTLIST */
43804 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43805 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43806 mem_base = xmlMemBlocks();
43807 writer = gen_xmlTextWriterPtr(n_writer, 0);
43808 name = gen_const_xmlChar_ptr(n_name, 1);
43810 ret_val = xmlTextWriterStartDTDAttlist(writer, (const xmlChar *)name);
43811 desret_int(ret_val);
43813 des_xmlTextWriterPtr(n_writer, writer, 0);
43814 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
43815 xmlResetLastError();
43816 if (mem_base != xmlMemBlocks()) {
43817 printf("Leak of %d blocks found in xmlTextWriterStartDTDAttlist",
43818 xmlMemBlocks() - mem_base);
43820 printf(" %d", n_writer);
43821 printf(" %d", n_name);
43834 test_xmlTextWriterStartDTDElement(void) {
43837 #if defined(LIBXML_WRITER_ENABLED)
43840 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43842 xmlChar * name; /* the name of the DTD element */
43845 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43846 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43847 mem_base = xmlMemBlocks();
43848 writer = gen_xmlTextWriterPtr(n_writer, 0);
43849 name = gen_const_xmlChar_ptr(n_name, 1);
43851 ret_val = xmlTextWriterStartDTDElement(writer, (const xmlChar *)name);
43852 desret_int(ret_val);
43854 des_xmlTextWriterPtr(n_writer, writer, 0);
43855 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
43856 xmlResetLastError();
43857 if (mem_base != xmlMemBlocks()) {
43858 printf("Leak of %d blocks found in xmlTextWriterStartDTDElement",
43859 xmlMemBlocks() - mem_base);
43861 printf(" %d", n_writer);
43862 printf(" %d", n_name);
43875 test_xmlTextWriterStartDTDEntity(void) {
43878 #if defined(LIBXML_WRITER_ENABLED)
43881 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43883 int pe; /* TRUE if this is a parameter entity, FALSE if not */
43885 xmlChar * name; /* the name of the DTD ATTLIST */
43888 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43889 for (n_pe = 0;n_pe < gen_nb_int;n_pe++) {
43890 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43891 mem_base = xmlMemBlocks();
43892 writer = gen_xmlTextWriterPtr(n_writer, 0);
43893 pe = gen_int(n_pe, 1);
43894 name = gen_const_xmlChar_ptr(n_name, 2);
43896 ret_val = xmlTextWriterStartDTDEntity(writer, pe, (const xmlChar *)name);
43897 desret_int(ret_val);
43899 des_xmlTextWriterPtr(n_writer, writer, 0);
43900 des_int(n_pe, pe, 1);
43901 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
43902 xmlResetLastError();
43903 if (mem_base != xmlMemBlocks()) {
43904 printf("Leak of %d blocks found in xmlTextWriterStartDTDEntity",
43905 xmlMemBlocks() - mem_base);
43907 printf(" %d", n_writer);
43908 printf(" %d", n_pe);
43909 printf(" %d", n_name);
43923 test_xmlTextWriterStartDocument(void) {
43926 #if defined(LIBXML_WRITER_ENABLED)
43929 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43931 char * version; /* the xml version ("1.0") or NULL for default ("1.0") */
43933 char * encoding; /* the encoding or NULL for default */
43935 char * standalone; /* "yes" or "no" or NULL for default */
43938 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43939 for (n_version = 0;n_version < gen_nb_const_char_ptr;n_version++) {
43940 for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
43941 for (n_standalone = 0;n_standalone < gen_nb_const_char_ptr;n_standalone++) {
43942 mem_base = xmlMemBlocks();
43943 writer = gen_xmlTextWriterPtr(n_writer, 0);
43944 version = gen_const_char_ptr(n_version, 1);
43945 encoding = gen_const_char_ptr(n_encoding, 2);
43946 standalone = gen_const_char_ptr(n_standalone, 3);
43948 ret_val = xmlTextWriterStartDocument(writer, (const char *)version, (const char *)encoding, (const char *)standalone);
43949 desret_int(ret_val);
43951 des_xmlTextWriterPtr(n_writer, writer, 0);
43952 des_const_char_ptr(n_version, (const char *)version, 1);
43953 des_const_char_ptr(n_encoding, (const char *)encoding, 2);
43954 des_const_char_ptr(n_standalone, (const char *)standalone, 3);
43955 xmlResetLastError();
43956 if (mem_base != xmlMemBlocks()) {
43957 printf("Leak of %d blocks found in xmlTextWriterStartDocument",
43958 xmlMemBlocks() - mem_base);
43960 printf(" %d", n_writer);
43961 printf(" %d", n_version);
43962 printf(" %d", n_encoding);
43963 printf(" %d", n_standalone);
43978 test_xmlTextWriterStartElement(void) {
43981 #if defined(LIBXML_WRITER_ENABLED)
43984 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43986 xmlChar * name; /* element name */
43989 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43990 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43991 mem_base = xmlMemBlocks();
43992 writer = gen_xmlTextWriterPtr(n_writer, 0);
43993 name = gen_const_xmlChar_ptr(n_name, 1);
43995 ret_val = xmlTextWriterStartElement(writer, (const xmlChar *)name);
43996 desret_int(ret_val);
43998 des_xmlTextWriterPtr(n_writer, writer, 0);
43999 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
44000 xmlResetLastError();
44001 if (mem_base != xmlMemBlocks()) {
44002 printf("Leak of %d blocks found in xmlTextWriterStartElement",
44003 xmlMemBlocks() - mem_base);
44005 printf(" %d", n_writer);
44006 printf(" %d", n_name);
44019 test_xmlTextWriterStartElementNS(void) {
44022 #if defined(LIBXML_WRITER_ENABLED)
44025 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44027 xmlChar * prefix; /* namespace prefix or NULL */
44029 xmlChar * name; /* element local name */
44031 xmlChar * namespaceURI; /* namespace URI or NULL */
44032 int n_namespaceURI;
44034 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44035 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
44036 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44037 for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
44038 mem_base = xmlMemBlocks();
44039 writer = gen_xmlTextWriterPtr(n_writer, 0);
44040 prefix = gen_const_xmlChar_ptr(n_prefix, 1);
44041 name = gen_const_xmlChar_ptr(n_name, 2);
44042 namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3);
44044 ret_val = xmlTextWriterStartElementNS(writer, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)namespaceURI);
44045 desret_int(ret_val);
44047 des_xmlTextWriterPtr(n_writer, writer, 0);
44048 des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
44049 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
44050 des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 3);
44051 xmlResetLastError();
44052 if (mem_base != xmlMemBlocks()) {
44053 printf("Leak of %d blocks found in xmlTextWriterStartElementNS",
44054 xmlMemBlocks() - mem_base);
44056 printf(" %d", n_writer);
44057 printf(" %d", n_prefix);
44058 printf(" %d", n_name);
44059 printf(" %d", n_namespaceURI);
44074 test_xmlTextWriterStartPI(void) {
44077 #if defined(LIBXML_WRITER_ENABLED)
44080 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44082 xmlChar * target; /* PI target */
44085 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44086 for (n_target = 0;n_target < gen_nb_const_xmlChar_ptr;n_target++) {
44087 mem_base = xmlMemBlocks();
44088 writer = gen_xmlTextWriterPtr(n_writer, 0);
44089 target = gen_const_xmlChar_ptr(n_target, 1);
44091 ret_val = xmlTextWriterStartPI(writer, (const xmlChar *)target);
44092 desret_int(ret_val);
44094 des_xmlTextWriterPtr(n_writer, writer, 0);
44095 des_const_xmlChar_ptr(n_target, (const xmlChar *)target, 1);
44096 xmlResetLastError();
44097 if (mem_base != xmlMemBlocks()) {
44098 printf("Leak of %d blocks found in xmlTextWriterStartPI",
44099 xmlMemBlocks() - mem_base);
44101 printf(" %d", n_writer);
44102 printf(" %d", n_target);
44115 test_xmlTextWriterWriteAttribute(void) {
44118 #if defined(LIBXML_WRITER_ENABLED)
44121 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44123 xmlChar * name; /* attribute name */
44125 xmlChar * content; /* attribute content */
44128 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44129 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44130 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44131 mem_base = xmlMemBlocks();
44132 writer = gen_xmlTextWriterPtr(n_writer, 0);
44133 name = gen_const_xmlChar_ptr(n_name, 1);
44134 content = gen_const_xmlChar_ptr(n_content, 2);
44136 ret_val = xmlTextWriterWriteAttribute(writer, (const xmlChar *)name, (const xmlChar *)content);
44137 desret_int(ret_val);
44139 des_xmlTextWriterPtr(n_writer, writer, 0);
44140 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
44141 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
44142 xmlResetLastError();
44143 if (mem_base != xmlMemBlocks()) {
44144 printf("Leak of %d blocks found in xmlTextWriterWriteAttribute",
44145 xmlMemBlocks() - mem_base);
44147 printf(" %d", n_writer);
44148 printf(" %d", n_name);
44149 printf(" %d", n_content);
44163 test_xmlTextWriterWriteAttributeNS(void) {
44166 #if defined(LIBXML_WRITER_ENABLED)
44169 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44171 xmlChar * prefix; /* namespace prefix */
44173 xmlChar * name; /* attribute local name */
44175 xmlChar * namespaceURI; /* namespace URI */
44176 int n_namespaceURI;
44177 xmlChar * content; /* attribute content */
44180 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44181 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
44182 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44183 for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
44184 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44185 mem_base = xmlMemBlocks();
44186 writer = gen_xmlTextWriterPtr(n_writer, 0);
44187 prefix = gen_const_xmlChar_ptr(n_prefix, 1);
44188 name = gen_const_xmlChar_ptr(n_name, 2);
44189 namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3);
44190 content = gen_const_xmlChar_ptr(n_content, 4);
44192 ret_val = xmlTextWriterWriteAttributeNS(writer, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)namespaceURI, (const xmlChar *)content);
44193 desret_int(ret_val);
44195 des_xmlTextWriterPtr(n_writer, writer, 0);
44196 des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
44197 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
44198 des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 3);
44199 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 4);
44200 xmlResetLastError();
44201 if (mem_base != xmlMemBlocks()) {
44202 printf("Leak of %d blocks found in xmlTextWriterWriteAttributeNS",
44203 xmlMemBlocks() - mem_base);
44205 printf(" %d", n_writer);
44206 printf(" %d", n_prefix);
44207 printf(" %d", n_name);
44208 printf(" %d", n_namespaceURI);
44209 printf(" %d", n_content);
44225 test_xmlTextWriterWriteBase64(void) {
44228 #if defined(LIBXML_WRITER_ENABLED)
44231 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44233 char * data; /* binary data */
44235 int start; /* the position within the data of the first byte to encode */
44237 int len; /* the number of bytes to encode */
44240 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44241 for (n_data = 0;n_data < gen_nb_const_char_ptr;n_data++) {
44242 for (n_start = 0;n_start < gen_nb_int;n_start++) {
44243 for (n_len = 0;n_len < gen_nb_int;n_len++) {
44244 mem_base = xmlMemBlocks();
44245 writer = gen_xmlTextWriterPtr(n_writer, 0);
44246 data = gen_const_char_ptr(n_data, 1);
44247 start = gen_int(n_start, 2);
44248 len = gen_int(n_len, 3);
44250 ret_val = xmlTextWriterWriteBase64(writer, (const char *)data, start, len);
44251 desret_int(ret_val);
44253 des_xmlTextWriterPtr(n_writer, writer, 0);
44254 des_const_char_ptr(n_data, (const char *)data, 1);
44255 des_int(n_start, start, 2);
44256 des_int(n_len, len, 3);
44257 xmlResetLastError();
44258 if (mem_base != xmlMemBlocks()) {
44259 printf("Leak of %d blocks found in xmlTextWriterWriteBase64",
44260 xmlMemBlocks() - mem_base);
44262 printf(" %d", n_writer);
44263 printf(" %d", n_data);
44264 printf(" %d", n_start);
44265 printf(" %d", n_len);
44280 test_xmlTextWriterWriteBinHex(void) {
44283 #if defined(LIBXML_WRITER_ENABLED)
44286 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44288 char * data; /* binary data */
44290 int start; /* the position within the data of the first byte to encode */
44292 int len; /* the number of bytes to encode */
44295 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44296 for (n_data = 0;n_data < gen_nb_const_char_ptr;n_data++) {
44297 for (n_start = 0;n_start < gen_nb_int;n_start++) {
44298 for (n_len = 0;n_len < gen_nb_int;n_len++) {
44299 mem_base = xmlMemBlocks();
44300 writer = gen_xmlTextWriterPtr(n_writer, 0);
44301 data = gen_const_char_ptr(n_data, 1);
44302 start = gen_int(n_start, 2);
44303 len = gen_int(n_len, 3);
44305 ret_val = xmlTextWriterWriteBinHex(writer, (const char *)data, start, len);
44306 desret_int(ret_val);
44308 des_xmlTextWriterPtr(n_writer, writer, 0);
44309 des_const_char_ptr(n_data, (const char *)data, 1);
44310 des_int(n_start, start, 2);
44311 des_int(n_len, len, 3);
44312 xmlResetLastError();
44313 if (mem_base != xmlMemBlocks()) {
44314 printf("Leak of %d blocks found in xmlTextWriterWriteBinHex",
44315 xmlMemBlocks() - mem_base);
44317 printf(" %d", n_writer);
44318 printf(" %d", n_data);
44319 printf(" %d", n_start);
44320 printf(" %d", n_len);
44335 test_xmlTextWriterWriteCDATA(void) {
44338 #if defined(LIBXML_WRITER_ENABLED)
44341 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44343 xmlChar * content; /* CDATA content */
44346 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44347 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44348 mem_base = xmlMemBlocks();
44349 writer = gen_xmlTextWriterPtr(n_writer, 0);
44350 content = gen_const_xmlChar_ptr(n_content, 1);
44352 ret_val = xmlTextWriterWriteCDATA(writer, (const xmlChar *)content);
44353 desret_int(ret_val);
44355 des_xmlTextWriterPtr(n_writer, writer, 0);
44356 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
44357 xmlResetLastError();
44358 if (mem_base != xmlMemBlocks()) {
44359 printf("Leak of %d blocks found in xmlTextWriterWriteCDATA",
44360 xmlMemBlocks() - mem_base);
44362 printf(" %d", n_writer);
44363 printf(" %d", n_content);
44376 test_xmlTextWriterWriteComment(void) {
44379 #if defined(LIBXML_WRITER_ENABLED)
44382 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44384 xmlChar * content; /* comment string */
44387 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44388 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44389 mem_base = xmlMemBlocks();
44390 writer = gen_xmlTextWriterPtr(n_writer, 0);
44391 content = gen_const_xmlChar_ptr(n_content, 1);
44393 ret_val = xmlTextWriterWriteComment(writer, (const xmlChar *)content);
44394 desret_int(ret_val);
44396 des_xmlTextWriterPtr(n_writer, writer, 0);
44397 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
44398 xmlResetLastError();
44399 if (mem_base != xmlMemBlocks()) {
44400 printf("Leak of %d blocks found in xmlTextWriterWriteComment",
44401 xmlMemBlocks() - mem_base);
44403 printf(" %d", n_writer);
44404 printf(" %d", n_content);
44417 test_xmlTextWriterWriteDTD(void) {
44420 #if defined(LIBXML_WRITER_ENABLED)
44423 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44425 xmlChar * name; /* the name of the DTD */
44427 xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
44429 xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
44431 xmlChar * subset; /* string content of the DTD */
44434 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44435 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44436 for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
44437 for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
44438 for (n_subset = 0;n_subset < gen_nb_const_xmlChar_ptr;n_subset++) {
44439 mem_base = xmlMemBlocks();
44440 writer = gen_xmlTextWriterPtr(n_writer, 0);
44441 name = gen_const_xmlChar_ptr(n_name, 1);
44442 pubid = gen_const_xmlChar_ptr(n_pubid, 2);
44443 sysid = gen_const_xmlChar_ptr(n_sysid, 3);
44444 subset = gen_const_xmlChar_ptr(n_subset, 4);
44446 ret_val = xmlTextWriterWriteDTD(writer, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid, (const xmlChar *)subset);
44447 desret_int(ret_val);
44449 des_xmlTextWriterPtr(n_writer, writer, 0);
44450 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
44451 des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 2);
44452 des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 3);
44453 des_const_xmlChar_ptr(n_subset, (const xmlChar *)subset, 4);
44454 xmlResetLastError();
44455 if (mem_base != xmlMemBlocks()) {
44456 printf("Leak of %d blocks found in xmlTextWriterWriteDTD",
44457 xmlMemBlocks() - mem_base);
44459 printf(" %d", n_writer);
44460 printf(" %d", n_name);
44461 printf(" %d", n_pubid);
44462 printf(" %d", n_sysid);
44463 printf(" %d", n_subset);
44479 test_xmlTextWriterWriteDTDAttlist(void) {
44482 #if defined(LIBXML_WRITER_ENABLED)
44485 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44487 xmlChar * name; /* the name of the DTD ATTLIST */
44489 xmlChar * content; /* content of the ATTLIST */
44492 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44493 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44494 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44495 mem_base = xmlMemBlocks();
44496 writer = gen_xmlTextWriterPtr(n_writer, 0);
44497 name = gen_const_xmlChar_ptr(n_name, 1);
44498 content = gen_const_xmlChar_ptr(n_content, 2);
44500 ret_val = xmlTextWriterWriteDTDAttlist(writer, (const xmlChar *)name, (const xmlChar *)content);
44501 desret_int(ret_val);
44503 des_xmlTextWriterPtr(n_writer, writer, 0);
44504 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
44505 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
44506 xmlResetLastError();
44507 if (mem_base != xmlMemBlocks()) {
44508 printf("Leak of %d blocks found in xmlTextWriterWriteDTDAttlist",
44509 xmlMemBlocks() - mem_base);
44511 printf(" %d", n_writer);
44512 printf(" %d", n_name);
44513 printf(" %d", n_content);
44527 test_xmlTextWriterWriteDTDElement(void) {
44530 #if defined(LIBXML_WRITER_ENABLED)
44533 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44535 xmlChar * name; /* the name of the DTD element */
44537 xmlChar * content; /* content of the element */
44540 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44541 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44542 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44543 mem_base = xmlMemBlocks();
44544 writer = gen_xmlTextWriterPtr(n_writer, 0);
44545 name = gen_const_xmlChar_ptr(n_name, 1);
44546 content = gen_const_xmlChar_ptr(n_content, 2);
44548 ret_val = xmlTextWriterWriteDTDElement(writer, (const xmlChar *)name, (const xmlChar *)content);
44549 desret_int(ret_val);
44551 des_xmlTextWriterPtr(n_writer, writer, 0);
44552 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
44553 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
44554 xmlResetLastError();
44555 if (mem_base != xmlMemBlocks()) {
44556 printf("Leak of %d blocks found in xmlTextWriterWriteDTDElement",
44557 xmlMemBlocks() - mem_base);
44559 printf(" %d", n_writer);
44560 printf(" %d", n_name);
44561 printf(" %d", n_content);
44575 test_xmlTextWriterWriteDTDEntity(void) {
44578 #if defined(LIBXML_WRITER_ENABLED)
44581 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44583 int pe; /* TRUE if this is a parameter entity, FALSE if not */
44585 xmlChar * name; /* the name of the DTD entity */
44587 xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
44589 xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
44591 xmlChar * ndataid; /* the xml notation name. */
44593 xmlChar * content; /* content of the entity */
44596 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44597 for (n_pe = 0;n_pe < gen_nb_int;n_pe++) {
44598 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44599 for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
44600 for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
44601 for (n_ndataid = 0;n_ndataid < gen_nb_const_xmlChar_ptr;n_ndataid++) {
44602 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44603 mem_base = xmlMemBlocks();
44604 writer = gen_xmlTextWriterPtr(n_writer, 0);
44605 pe = gen_int(n_pe, 1);
44606 name = gen_const_xmlChar_ptr(n_name, 2);
44607 pubid = gen_const_xmlChar_ptr(n_pubid, 3);
44608 sysid = gen_const_xmlChar_ptr(n_sysid, 4);
44609 ndataid = gen_const_xmlChar_ptr(n_ndataid, 5);
44610 content = gen_const_xmlChar_ptr(n_content, 6);
44612 ret_val = xmlTextWriterWriteDTDEntity(writer, pe, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid, (const xmlChar *)ndataid, (const xmlChar *)content);
44613 desret_int(ret_val);
44615 des_xmlTextWriterPtr(n_writer, writer, 0);
44616 des_int(n_pe, pe, 1);
44617 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
44618 des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 3);
44619 des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 4);
44620 des_const_xmlChar_ptr(n_ndataid, (const xmlChar *)ndataid, 5);
44621 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 6);
44622 xmlResetLastError();
44623 if (mem_base != xmlMemBlocks()) {
44624 printf("Leak of %d blocks found in xmlTextWriterWriteDTDEntity",
44625 xmlMemBlocks() - mem_base);
44627 printf(" %d", n_writer);
44628 printf(" %d", n_pe);
44629 printf(" %d", n_name);
44630 printf(" %d", n_pubid);
44631 printf(" %d", n_sysid);
44632 printf(" %d", n_ndataid);
44633 printf(" %d", n_content);
44651 test_xmlTextWriterWriteDTDExternalEntity(void) {
44654 #if defined(LIBXML_WRITER_ENABLED)
44657 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44659 int pe; /* TRUE if this is a parameter entity, FALSE if not */
44661 xmlChar * name; /* the name of the DTD entity */
44663 xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
44665 xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
44667 xmlChar * ndataid; /* the xml notation name. */
44670 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44671 for (n_pe = 0;n_pe < gen_nb_int;n_pe++) {
44672 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44673 for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
44674 for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
44675 for (n_ndataid = 0;n_ndataid < gen_nb_const_xmlChar_ptr;n_ndataid++) {
44676 mem_base = xmlMemBlocks();
44677 writer = gen_xmlTextWriterPtr(n_writer, 0);
44678 pe = gen_int(n_pe, 1);
44679 name = gen_const_xmlChar_ptr(n_name, 2);
44680 pubid = gen_const_xmlChar_ptr(n_pubid, 3);
44681 sysid = gen_const_xmlChar_ptr(n_sysid, 4);
44682 ndataid = gen_const_xmlChar_ptr(n_ndataid, 5);
44684 ret_val = xmlTextWriterWriteDTDExternalEntity(writer, pe, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid, (const xmlChar *)ndataid);
44685 desret_int(ret_val);
44687 des_xmlTextWriterPtr(n_writer, writer, 0);
44688 des_int(n_pe, pe, 1);
44689 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
44690 des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 3);
44691 des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 4);
44692 des_const_xmlChar_ptr(n_ndataid, (const xmlChar *)ndataid, 5);
44693 xmlResetLastError();
44694 if (mem_base != xmlMemBlocks()) {
44695 printf("Leak of %d blocks found in xmlTextWriterWriteDTDExternalEntity",
44696 xmlMemBlocks() - mem_base);
44698 printf(" %d", n_writer);
44699 printf(" %d", n_pe);
44700 printf(" %d", n_name);
44701 printf(" %d", n_pubid);
44702 printf(" %d", n_sysid);
44703 printf(" %d", n_ndataid);
44720 test_xmlTextWriterWriteDTDExternalEntityContents(void) {
44723 #if defined(LIBXML_WRITER_ENABLED)
44726 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44728 xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
44730 xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
44732 xmlChar * ndataid; /* the xml notation name. */
44735 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44736 for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
44737 for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
44738 for (n_ndataid = 0;n_ndataid < gen_nb_const_xmlChar_ptr;n_ndataid++) {
44739 mem_base = xmlMemBlocks();
44740 writer = gen_xmlTextWriterPtr(n_writer, 0);
44741 pubid = gen_const_xmlChar_ptr(n_pubid, 1);
44742 sysid = gen_const_xmlChar_ptr(n_sysid, 2);
44743 ndataid = gen_const_xmlChar_ptr(n_ndataid, 3);
44745 ret_val = xmlTextWriterWriteDTDExternalEntityContents(writer, (const xmlChar *)pubid, (const xmlChar *)sysid, (const xmlChar *)ndataid);
44746 desret_int(ret_val);
44748 des_xmlTextWriterPtr(n_writer, writer, 0);
44749 des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 1);
44750 des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 2);
44751 des_const_xmlChar_ptr(n_ndataid, (const xmlChar *)ndataid, 3);
44752 xmlResetLastError();
44753 if (mem_base != xmlMemBlocks()) {
44754 printf("Leak of %d blocks found in xmlTextWriterWriteDTDExternalEntityContents",
44755 xmlMemBlocks() - mem_base);
44757 printf(" %d", n_writer);
44758 printf(" %d", n_pubid);
44759 printf(" %d", n_sysid);
44760 printf(" %d", n_ndataid);
44775 test_xmlTextWriterWriteDTDInternalEntity(void) {
44778 #if defined(LIBXML_WRITER_ENABLED)
44781 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44783 int pe; /* TRUE if this is a parameter entity, FALSE if not */
44785 xmlChar * name; /* the name of the DTD entity */
44787 xmlChar * content; /* content of the entity */
44790 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44791 for (n_pe = 0;n_pe < gen_nb_int;n_pe++) {
44792 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44793 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44794 mem_base = xmlMemBlocks();
44795 writer = gen_xmlTextWriterPtr(n_writer, 0);
44796 pe = gen_int(n_pe, 1);
44797 name = gen_const_xmlChar_ptr(n_name, 2);
44798 content = gen_const_xmlChar_ptr(n_content, 3);
44800 ret_val = xmlTextWriterWriteDTDInternalEntity(writer, pe, (const xmlChar *)name, (const xmlChar *)content);
44801 desret_int(ret_val);
44803 des_xmlTextWriterPtr(n_writer, writer, 0);
44804 des_int(n_pe, pe, 1);
44805 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
44806 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
44807 xmlResetLastError();
44808 if (mem_base != xmlMemBlocks()) {
44809 printf("Leak of %d blocks found in xmlTextWriterWriteDTDInternalEntity",
44810 xmlMemBlocks() - mem_base);
44812 printf(" %d", n_writer);
44813 printf(" %d", n_pe);
44814 printf(" %d", n_name);
44815 printf(" %d", n_content);
44830 test_xmlTextWriterWriteDTDNotation(void) {
44833 #if defined(LIBXML_WRITER_ENABLED)
44836 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44838 xmlChar * name; /* the name of the xml notation */
44840 xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
44842 xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
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_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
44848 for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
44849 mem_base = xmlMemBlocks();
44850 writer = gen_xmlTextWriterPtr(n_writer, 0);
44851 name = gen_const_xmlChar_ptr(n_name, 1);
44852 pubid = gen_const_xmlChar_ptr(n_pubid, 2);
44853 sysid = gen_const_xmlChar_ptr(n_sysid, 3);
44855 ret_val = xmlTextWriterWriteDTDNotation(writer, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid);
44856 desret_int(ret_val);
44858 des_xmlTextWriterPtr(n_writer, writer, 0);
44859 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
44860 des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 2);
44861 des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 3);
44862 xmlResetLastError();
44863 if (mem_base != xmlMemBlocks()) {
44864 printf("Leak of %d blocks found in xmlTextWriterWriteDTDNotation",
44865 xmlMemBlocks() - mem_base);
44867 printf(" %d", n_writer);
44868 printf(" %d", n_name);
44869 printf(" %d", n_pubid);
44870 printf(" %d", n_sysid);
44885 test_xmlTextWriterWriteElement(void) {
44888 #if defined(LIBXML_WRITER_ENABLED)
44891 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44893 xmlChar * name; /* element name */
44895 xmlChar * content; /* element content */
44898 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44899 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44900 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44901 mem_base = xmlMemBlocks();
44902 writer = gen_xmlTextWriterPtr(n_writer, 0);
44903 name = gen_const_xmlChar_ptr(n_name, 1);
44904 content = gen_const_xmlChar_ptr(n_content, 2);
44906 ret_val = xmlTextWriterWriteElement(writer, (const xmlChar *)name, (const xmlChar *)content);
44907 desret_int(ret_val);
44909 des_xmlTextWriterPtr(n_writer, writer, 0);
44910 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
44911 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
44912 xmlResetLastError();
44913 if (mem_base != xmlMemBlocks()) {
44914 printf("Leak of %d blocks found in xmlTextWriterWriteElement",
44915 xmlMemBlocks() - mem_base);
44917 printf(" %d", n_writer);
44918 printf(" %d", n_name);
44919 printf(" %d", n_content);
44933 test_xmlTextWriterWriteElementNS(void) {
44936 #if defined(LIBXML_WRITER_ENABLED)
44939 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44941 xmlChar * prefix; /* namespace prefix */
44943 xmlChar * name; /* element local name */
44945 xmlChar * namespaceURI; /* namespace URI */
44946 int n_namespaceURI;
44947 xmlChar * content; /* element content */
44950 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44951 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
44952 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44953 for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
44954 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44955 mem_base = xmlMemBlocks();
44956 writer = gen_xmlTextWriterPtr(n_writer, 0);
44957 prefix = gen_const_xmlChar_ptr(n_prefix, 1);
44958 name = gen_const_xmlChar_ptr(n_name, 2);
44959 namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3);
44960 content = gen_const_xmlChar_ptr(n_content, 4);
44962 ret_val = xmlTextWriterWriteElementNS(writer, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)namespaceURI, (const xmlChar *)content);
44963 desret_int(ret_val);
44965 des_xmlTextWriterPtr(n_writer, writer, 0);
44966 des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
44967 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
44968 des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 3);
44969 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 4);
44970 xmlResetLastError();
44971 if (mem_base != xmlMemBlocks()) {
44972 printf("Leak of %d blocks found in xmlTextWriterWriteElementNS",
44973 xmlMemBlocks() - mem_base);
44975 printf(" %d", n_writer);
44976 printf(" %d", n_prefix);
44977 printf(" %d", n_name);
44978 printf(" %d", n_namespaceURI);
44979 printf(" %d", n_content);
44995 test_xmlTextWriterWriteFormatAttribute(void) {
44999 /* missing type support */
45005 test_xmlTextWriterWriteFormatAttributeNS(void) {
45009 /* missing type support */
45015 test_xmlTextWriterWriteFormatCDATA(void) {
45019 /* missing type support */
45025 test_xmlTextWriterWriteFormatComment(void) {
45029 /* missing type support */
45035 test_xmlTextWriterWriteFormatDTD(void) {
45039 /* missing type support */
45045 test_xmlTextWriterWriteFormatDTDAttlist(void) {
45049 /* missing type support */
45055 test_xmlTextWriterWriteFormatDTDElement(void) {
45059 /* missing type support */
45065 test_xmlTextWriterWriteFormatDTDInternalEntity(void) {
45069 /* missing type support */
45075 test_xmlTextWriterWriteFormatElement(void) {
45079 /* missing type support */
45085 test_xmlTextWriterWriteFormatElementNS(void) {
45089 /* missing type support */
45095 test_xmlTextWriterWriteFormatPI(void) {
45099 /* missing type support */
45105 test_xmlTextWriterWriteFormatRaw(void) {
45109 /* missing type support */
45115 test_xmlTextWriterWriteFormatString(void) {
45119 /* missing type support */
45125 test_xmlTextWriterWritePI(void) {
45128 #if defined(LIBXML_WRITER_ENABLED)
45131 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45133 xmlChar * target; /* PI target */
45135 xmlChar * content; /* PI content */
45138 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45139 for (n_target = 0;n_target < gen_nb_const_xmlChar_ptr;n_target++) {
45140 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
45141 mem_base = xmlMemBlocks();
45142 writer = gen_xmlTextWriterPtr(n_writer, 0);
45143 target = gen_const_xmlChar_ptr(n_target, 1);
45144 content = gen_const_xmlChar_ptr(n_content, 2);
45146 ret_val = xmlTextWriterWritePI(writer, (const xmlChar *)target, (const xmlChar *)content);
45147 desret_int(ret_val);
45149 des_xmlTextWriterPtr(n_writer, writer, 0);
45150 des_const_xmlChar_ptr(n_target, (const xmlChar *)target, 1);
45151 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
45152 xmlResetLastError();
45153 if (mem_base != xmlMemBlocks()) {
45154 printf("Leak of %d blocks found in xmlTextWriterWritePI",
45155 xmlMemBlocks() - mem_base);
45157 printf(" %d", n_writer);
45158 printf(" %d", n_target);
45159 printf(" %d", n_content);
45173 test_xmlTextWriterWriteRaw(void) {
45176 #if defined(LIBXML_WRITER_ENABLED)
45179 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45181 xmlChar * content; /* text string */
45184 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45185 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
45186 mem_base = xmlMemBlocks();
45187 writer = gen_xmlTextWriterPtr(n_writer, 0);
45188 content = gen_const_xmlChar_ptr(n_content, 1);
45190 ret_val = xmlTextWriterWriteRaw(writer, (const xmlChar *)content);
45191 desret_int(ret_val);
45193 des_xmlTextWriterPtr(n_writer, writer, 0);
45194 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
45195 xmlResetLastError();
45196 if (mem_base != xmlMemBlocks()) {
45197 printf("Leak of %d blocks found in xmlTextWriterWriteRaw",
45198 xmlMemBlocks() - mem_base);
45200 printf(" %d", n_writer);
45201 printf(" %d", n_content);
45214 test_xmlTextWriterWriteRawLen(void) {
45217 #if defined(LIBXML_WRITER_ENABLED)
45220 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45222 xmlChar * content; /* text string */
45224 int len; /* length of the text string */
45227 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45228 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
45229 for (n_len = 0;n_len < gen_nb_int;n_len++) {
45230 mem_base = xmlMemBlocks();
45231 writer = gen_xmlTextWriterPtr(n_writer, 0);
45232 content = gen_const_xmlChar_ptr(n_content, 1);
45233 len = gen_int(n_len, 2);
45235 ret_val = xmlTextWriterWriteRawLen(writer, (const xmlChar *)content, len);
45236 desret_int(ret_val);
45238 des_xmlTextWriterPtr(n_writer, writer, 0);
45239 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
45240 des_int(n_len, len, 2);
45241 xmlResetLastError();
45242 if (mem_base != xmlMemBlocks()) {
45243 printf("Leak of %d blocks found in xmlTextWriterWriteRawLen",
45244 xmlMemBlocks() - mem_base);
45246 printf(" %d", n_writer);
45247 printf(" %d", n_content);
45248 printf(" %d", n_len);
45262 test_xmlTextWriterWriteString(void) {
45265 #if defined(LIBXML_WRITER_ENABLED)
45268 xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45270 xmlChar * content; /* text string */
45273 for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45274 for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
45275 mem_base = xmlMemBlocks();
45276 writer = gen_xmlTextWriterPtr(n_writer, 0);
45277 content = gen_const_xmlChar_ptr(n_content, 1);
45279 ret_val = xmlTextWriterWriteString(writer, (const xmlChar *)content);
45280 desret_int(ret_val);
45282 des_xmlTextWriterPtr(n_writer, writer, 0);
45283 des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
45284 xmlResetLastError();
45285 if (mem_base != xmlMemBlocks()) {
45286 printf("Leak of %d blocks found in xmlTextWriterWriteString",
45287 xmlMemBlocks() - mem_base);
45289 printf(" %d", n_writer);
45290 printf(" %d", n_content);
45303 test_xmlTextWriterWriteVFormatAttribute(void) {
45307 /* missing type support */
45313 test_xmlTextWriterWriteVFormatAttributeNS(void) {
45317 /* missing type support */
45323 test_xmlTextWriterWriteVFormatCDATA(void) {
45327 /* missing type support */
45333 test_xmlTextWriterWriteVFormatComment(void) {
45337 /* missing type support */
45343 test_xmlTextWriterWriteVFormatDTD(void) {
45347 /* missing type support */
45353 test_xmlTextWriterWriteVFormatDTDAttlist(void) {
45357 /* missing type support */
45363 test_xmlTextWriterWriteVFormatDTDElement(void) {
45367 /* missing type support */
45373 test_xmlTextWriterWriteVFormatDTDInternalEntity(void) {
45377 /* missing type support */
45383 test_xmlTextWriterWriteVFormatElement(void) {
45387 /* missing type support */
45393 test_xmlTextWriterWriteVFormatElementNS(void) {
45397 /* missing type support */
45403 test_xmlTextWriterWriteVFormatPI(void) {
45407 /* missing type support */
45413 test_xmlTextWriterWriteVFormatRaw(void) {
45417 /* missing type support */
45423 test_xmlTextWriterWriteVFormatString(void) {
45427 /* missing type support */
45432 test_xmlwriter(void) {
45435 if (quiet == 0) printf("Testing xmlwriter : 51 of 79 functions ...\n");
45436 test_ret += test_xmlNewTextWriter();
45437 test_ret += test_xmlNewTextWriterFilename();
45438 test_ret += test_xmlNewTextWriterMemory();
45439 test_ret += test_xmlNewTextWriterPushParser();
45440 test_ret += test_xmlNewTextWriterTree();
45441 test_ret += test_xmlTextWriterEndAttribute();
45442 test_ret += test_xmlTextWriterEndCDATA();
45443 test_ret += test_xmlTextWriterEndComment();
45444 test_ret += test_xmlTextWriterEndDTD();
45445 test_ret += test_xmlTextWriterEndDTDAttlist();
45446 test_ret += test_xmlTextWriterEndDTDElement();
45447 test_ret += test_xmlTextWriterEndDTDEntity();
45448 test_ret += test_xmlTextWriterEndDocument();
45449 test_ret += test_xmlTextWriterEndElement();
45450 test_ret += test_xmlTextWriterEndPI();
45451 test_ret += test_xmlTextWriterFlush();
45452 test_ret += test_xmlTextWriterFullEndElement();
45453 test_ret += test_xmlTextWriterSetIndent();
45454 test_ret += test_xmlTextWriterSetIndentString();
45455 test_ret += test_xmlTextWriterStartAttribute();
45456 test_ret += test_xmlTextWriterStartAttributeNS();
45457 test_ret += test_xmlTextWriterStartCDATA();
45458 test_ret += test_xmlTextWriterStartComment();
45459 test_ret += test_xmlTextWriterStartDTD();
45460 test_ret += test_xmlTextWriterStartDTDAttlist();
45461 test_ret += test_xmlTextWriterStartDTDElement();
45462 test_ret += test_xmlTextWriterStartDTDEntity();
45463 test_ret += test_xmlTextWriterStartDocument();
45464 test_ret += test_xmlTextWriterStartElement();
45465 test_ret += test_xmlTextWriterStartElementNS();
45466 test_ret += test_xmlTextWriterStartPI();
45467 test_ret += test_xmlTextWriterWriteAttribute();
45468 test_ret += test_xmlTextWriterWriteAttributeNS();
45469 test_ret += test_xmlTextWriterWriteBase64();
45470 test_ret += test_xmlTextWriterWriteBinHex();
45471 test_ret += test_xmlTextWriterWriteCDATA();
45472 test_ret += test_xmlTextWriterWriteComment();
45473 test_ret += test_xmlTextWriterWriteDTD();
45474 test_ret += test_xmlTextWriterWriteDTDAttlist();
45475 test_ret += test_xmlTextWriterWriteDTDElement();
45476 test_ret += test_xmlTextWriterWriteDTDEntity();
45477 test_ret += test_xmlTextWriterWriteDTDExternalEntity();
45478 test_ret += test_xmlTextWriterWriteDTDExternalEntityContents();
45479 test_ret += test_xmlTextWriterWriteDTDInternalEntity();
45480 test_ret += test_xmlTextWriterWriteDTDNotation();
45481 test_ret += test_xmlTextWriterWriteElement();
45482 test_ret += test_xmlTextWriterWriteElementNS();
45483 test_ret += test_xmlTextWriterWriteFormatAttribute();
45484 test_ret += test_xmlTextWriterWriteFormatAttributeNS();
45485 test_ret += test_xmlTextWriterWriteFormatCDATA();
45486 test_ret += test_xmlTextWriterWriteFormatComment();
45487 test_ret += test_xmlTextWriterWriteFormatDTD();
45488 test_ret += test_xmlTextWriterWriteFormatDTDAttlist();
45489 test_ret += test_xmlTextWriterWriteFormatDTDElement();
45490 test_ret += test_xmlTextWriterWriteFormatDTDInternalEntity();
45491 test_ret += test_xmlTextWriterWriteFormatElement();
45492 test_ret += test_xmlTextWriterWriteFormatElementNS();
45493 test_ret += test_xmlTextWriterWriteFormatPI();
45494 test_ret += test_xmlTextWriterWriteFormatRaw();
45495 test_ret += test_xmlTextWriterWriteFormatString();
45496 test_ret += test_xmlTextWriterWritePI();
45497 test_ret += test_xmlTextWriterWriteRaw();
45498 test_ret += test_xmlTextWriterWriteRawLen();
45499 test_ret += test_xmlTextWriterWriteString();
45500 test_ret += test_xmlTextWriterWriteVFormatAttribute();
45501 test_ret += test_xmlTextWriterWriteVFormatAttributeNS();
45502 test_ret += test_xmlTextWriterWriteVFormatCDATA();
45503 test_ret += test_xmlTextWriterWriteVFormatComment();
45504 test_ret += test_xmlTextWriterWriteVFormatDTD();
45505 test_ret += test_xmlTextWriterWriteVFormatDTDAttlist();
45506 test_ret += test_xmlTextWriterWriteVFormatDTDElement();
45507 test_ret += test_xmlTextWriterWriteVFormatDTDInternalEntity();
45508 test_ret += test_xmlTextWriterWriteVFormatElement();
45509 test_ret += test_xmlTextWriterWriteVFormatElementNS();
45510 test_ret += test_xmlTextWriterWriteVFormatPI();
45511 test_ret += test_xmlTextWriterWriteVFormatRaw();
45512 test_ret += test_xmlTextWriterWriteVFormatString();
45515 printf("Module xmlwriter: %d errors\n", test_ret);
45520 test_xmlXPathCastBooleanToNumber(void) {
45523 #if defined(LIBXML_XPATH_ENABLED)
45526 int val; /* a boolean */
45529 for (n_val = 0;n_val < gen_nb_int;n_val++) {
45530 mem_base = xmlMemBlocks();
45531 val = gen_int(n_val, 0);
45533 ret_val = xmlXPathCastBooleanToNumber(val);
45534 desret_double(ret_val);
45536 des_int(n_val, val, 0);
45537 xmlResetLastError();
45538 if (mem_base != xmlMemBlocks()) {
45539 printf("Leak of %d blocks found in xmlXPathCastBooleanToNumber",
45540 xmlMemBlocks() - mem_base);
45542 printf(" %d", n_val);
45554 test_xmlXPathCastBooleanToString(void) {
45557 #if defined(LIBXML_XPATH_ENABLED)
45560 int val; /* a boolean */
45563 for (n_val = 0;n_val < gen_nb_int;n_val++) {
45564 mem_base = xmlMemBlocks();
45565 val = gen_int(n_val, 0);
45567 ret_val = xmlXPathCastBooleanToString(val);
45568 desret_xmlChar_ptr(ret_val);
45570 des_int(n_val, val, 0);
45571 xmlResetLastError();
45572 if (mem_base != xmlMemBlocks()) {
45573 printf("Leak of %d blocks found in xmlXPathCastBooleanToString",
45574 xmlMemBlocks() - mem_base);
45576 printf(" %d", n_val);
45588 test_xmlXPathCastNodeSetToBoolean(void) {
45591 #if defined(LIBXML_XPATH_ENABLED)
45594 xmlNodeSetPtr ns; /* a node-set */
45597 for (n_ns = 0;n_ns < gen_nb_xmlNodeSetPtr;n_ns++) {
45598 mem_base = xmlMemBlocks();
45599 ns = gen_xmlNodeSetPtr(n_ns, 0);
45601 ret_val = xmlXPathCastNodeSetToBoolean(ns);
45602 desret_int(ret_val);
45604 des_xmlNodeSetPtr(n_ns, ns, 0);
45605 xmlResetLastError();
45606 if (mem_base != xmlMemBlocks()) {
45607 printf("Leak of %d blocks found in xmlXPathCastNodeSetToBoolean",
45608 xmlMemBlocks() - mem_base);
45610 printf(" %d", n_ns);
45622 test_xmlXPathCastNodeSetToNumber(void) {
45625 #if defined(LIBXML_XPATH_ENABLED)
45628 xmlNodeSetPtr ns; /* a node-set */
45631 for (n_ns = 0;n_ns < gen_nb_xmlNodeSetPtr;n_ns++) {
45632 mem_base = xmlMemBlocks();
45633 ns = gen_xmlNodeSetPtr(n_ns, 0);
45635 ret_val = xmlXPathCastNodeSetToNumber(ns);
45636 desret_double(ret_val);
45638 des_xmlNodeSetPtr(n_ns, ns, 0);
45639 xmlResetLastError();
45640 if (mem_base != xmlMemBlocks()) {
45641 printf("Leak of %d blocks found in xmlXPathCastNodeSetToNumber",
45642 xmlMemBlocks() - mem_base);
45644 printf(" %d", n_ns);
45656 test_xmlXPathCastNodeSetToString(void) {
45659 #if defined(LIBXML_XPATH_ENABLED)
45662 xmlNodeSetPtr ns; /* a node-set */
45665 for (n_ns = 0;n_ns < gen_nb_xmlNodeSetPtr;n_ns++) {
45666 mem_base = xmlMemBlocks();
45667 ns = gen_xmlNodeSetPtr(n_ns, 0);
45669 ret_val = xmlXPathCastNodeSetToString(ns);
45670 desret_xmlChar_ptr(ret_val);
45672 des_xmlNodeSetPtr(n_ns, ns, 0);
45673 xmlResetLastError();
45674 if (mem_base != xmlMemBlocks()) {
45675 printf("Leak of %d blocks found in xmlXPathCastNodeSetToString",
45676 xmlMemBlocks() - mem_base);
45678 printf(" %d", n_ns);
45690 test_xmlXPathCastNodeToNumber(void) {
45693 #if defined(LIBXML_XPATH_ENABLED)
45696 xmlNodePtr node; /* a node */
45699 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
45700 mem_base = xmlMemBlocks();
45701 node = gen_xmlNodePtr(n_node, 0);
45703 ret_val = xmlXPathCastNodeToNumber(node);
45704 desret_double(ret_val);
45706 des_xmlNodePtr(n_node, node, 0);
45707 xmlResetLastError();
45708 if (mem_base != xmlMemBlocks()) {
45709 printf("Leak of %d blocks found in xmlXPathCastNodeToNumber",
45710 xmlMemBlocks() - mem_base);
45712 printf(" %d", n_node);
45724 test_xmlXPathCastNodeToString(void) {
45727 #if defined(LIBXML_XPATH_ENABLED)
45730 xmlNodePtr node; /* a node */
45733 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
45734 mem_base = xmlMemBlocks();
45735 node = gen_xmlNodePtr(n_node, 0);
45737 ret_val = xmlXPathCastNodeToString(node);
45738 desret_xmlChar_ptr(ret_val);
45740 des_xmlNodePtr(n_node, node, 0);
45741 xmlResetLastError();
45742 if (mem_base != xmlMemBlocks()) {
45743 printf("Leak of %d blocks found in xmlXPathCastNodeToString",
45744 xmlMemBlocks() - mem_base);
45746 printf(" %d", n_node);
45758 test_xmlXPathCastNumberToBoolean(void) {
45761 #if defined(LIBXML_XPATH_ENABLED)
45764 double val; /* a number */
45767 for (n_val = 0;n_val < gen_nb_double;n_val++) {
45768 mem_base = xmlMemBlocks();
45769 val = gen_double(n_val, 0);
45771 ret_val = xmlXPathCastNumberToBoolean(val);
45772 desret_int(ret_val);
45774 des_double(n_val, val, 0);
45775 xmlResetLastError();
45776 if (mem_base != xmlMemBlocks()) {
45777 printf("Leak of %d blocks found in xmlXPathCastNumberToBoolean",
45778 xmlMemBlocks() - mem_base);
45780 printf(" %d", n_val);
45792 test_xmlXPathCastNumberToString(void) {
45795 #if defined(LIBXML_XPATH_ENABLED)
45798 double val; /* a number */
45801 for (n_val = 0;n_val < gen_nb_double;n_val++) {
45802 mem_base = xmlMemBlocks();
45803 val = gen_double(n_val, 0);
45805 ret_val = xmlXPathCastNumberToString(val);
45806 desret_xmlChar_ptr(ret_val);
45808 des_double(n_val, val, 0);
45809 xmlResetLastError();
45810 if (mem_base != xmlMemBlocks()) {
45811 printf("Leak of %d blocks found in xmlXPathCastNumberToString",
45812 xmlMemBlocks() - mem_base);
45814 printf(" %d", n_val);
45826 test_xmlXPathCastStringToBoolean(void) {
45829 #if defined(LIBXML_XPATH_ENABLED)
45832 xmlChar * val; /* a string */
45835 for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
45836 mem_base = xmlMemBlocks();
45837 val = gen_const_xmlChar_ptr(n_val, 0);
45839 ret_val = xmlXPathCastStringToBoolean((const xmlChar *)val);
45840 desret_int(ret_val);
45842 des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 0);
45843 xmlResetLastError();
45844 if (mem_base != xmlMemBlocks()) {
45845 printf("Leak of %d blocks found in xmlXPathCastStringToBoolean",
45846 xmlMemBlocks() - mem_base);
45848 printf(" %d", n_val);
45860 test_xmlXPathCastStringToNumber(void) {
45863 #if defined(LIBXML_XPATH_ENABLED)
45866 xmlChar * val; /* a string */
45869 for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
45870 mem_base = xmlMemBlocks();
45871 val = gen_const_xmlChar_ptr(n_val, 0);
45873 ret_val = xmlXPathCastStringToNumber((const xmlChar *)val);
45874 desret_double(ret_val);
45876 des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 0);
45877 xmlResetLastError();
45878 if (mem_base != xmlMemBlocks()) {
45879 printf("Leak of %d blocks found in xmlXPathCastStringToNumber",
45880 xmlMemBlocks() - mem_base);
45882 printf(" %d", n_val);
45894 test_xmlXPathCastToBoolean(void) {
45897 #if defined(LIBXML_XPATH_ENABLED)
45900 xmlXPathObjectPtr val; /* an XPath object */
45903 for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
45904 mem_base = xmlMemBlocks();
45905 val = gen_xmlXPathObjectPtr(n_val, 0);
45907 ret_val = xmlXPathCastToBoolean(val);
45908 desret_int(ret_val);
45910 des_xmlXPathObjectPtr(n_val, val, 0);
45911 xmlResetLastError();
45912 if (mem_base != xmlMemBlocks()) {
45913 printf("Leak of %d blocks found in xmlXPathCastToBoolean",
45914 xmlMemBlocks() - mem_base);
45916 printf(" %d", n_val);
45928 test_xmlXPathCastToNumber(void) {
45931 #if defined(LIBXML_XPATH_ENABLED)
45934 xmlXPathObjectPtr val; /* an XPath object */
45937 for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
45938 mem_base = xmlMemBlocks();
45939 val = gen_xmlXPathObjectPtr(n_val, 0);
45941 ret_val = xmlXPathCastToNumber(val);
45942 desret_double(ret_val);
45944 des_xmlXPathObjectPtr(n_val, val, 0);
45945 xmlResetLastError();
45946 if (mem_base != xmlMemBlocks()) {
45947 printf("Leak of %d blocks found in xmlXPathCastToNumber",
45948 xmlMemBlocks() - mem_base);
45950 printf(" %d", n_val);
45962 test_xmlXPathCastToString(void) {
45965 #if defined(LIBXML_XPATH_ENABLED)
45968 xmlXPathObjectPtr val; /* an XPath object */
45971 for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
45972 mem_base = xmlMemBlocks();
45973 val = gen_xmlXPathObjectPtr(n_val, 0);
45975 ret_val = xmlXPathCastToString(val);
45976 desret_xmlChar_ptr(ret_val);
45978 des_xmlXPathObjectPtr(n_val, val, 0);
45979 xmlResetLastError();
45980 if (mem_base != xmlMemBlocks()) {
45981 printf("Leak of %d blocks found in xmlXPathCastToString",
45982 xmlMemBlocks() - mem_base);
45984 printf(" %d", n_val);
45996 test_xmlXPathCmpNodes(void) {
45999 #if defined(LIBXML_XPATH_ENABLED)
46002 xmlNodePtr node1; /* the first node */
46004 xmlNodePtr node2; /* the second node */
46007 for (n_node1 = 0;n_node1 < gen_nb_xmlNodePtr;n_node1++) {
46008 for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
46009 mem_base = xmlMemBlocks();
46010 node1 = gen_xmlNodePtr(n_node1, 0);
46011 node2 = gen_xmlNodePtr(n_node2, 1);
46013 ret_val = xmlXPathCmpNodes(node1, node2);
46014 desret_int(ret_val);
46016 des_xmlNodePtr(n_node1, node1, 0);
46017 des_xmlNodePtr(n_node2, node2, 1);
46018 xmlResetLastError();
46019 if (mem_base != xmlMemBlocks()) {
46020 printf("Leak of %d blocks found in xmlXPathCmpNodes",
46021 xmlMemBlocks() - mem_base);
46023 printf(" %d", n_node1);
46024 printf(" %d", n_node2);
46037 test_xmlXPathCompile(void) {
46041 /* missing type support */
46045 #ifdef LIBXML_XPATH_ENABLED
46047 #define gen_nb_xmlXPathCompExprPtr 1
46048 static xmlXPathCompExprPtr gen_xmlXPathCompExprPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
46051 static void des_xmlXPathCompExprPtr(int no ATTRIBUTE_UNUSED, xmlXPathCompExprPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
46055 #ifdef LIBXML_XPATH_ENABLED
46057 #define gen_nb_xmlXPathContextPtr 1
46058 static xmlXPathContextPtr gen_xmlXPathContextPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
46061 static void des_xmlXPathContextPtr(int no ATTRIBUTE_UNUSED, xmlXPathContextPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
46067 test_xmlXPathCompiledEval(void) {
46070 #if defined(LIBXML_XPATH_ENABLED)
46072 xmlXPathObjectPtr ret_val;
46073 xmlXPathCompExprPtr comp; /* the compiled XPath expression */
46075 xmlXPathContextPtr ctx; /* the XPath context */
46078 for (n_comp = 0;n_comp < gen_nb_xmlXPathCompExprPtr;n_comp++) {
46079 for (n_ctx = 0;n_ctx < gen_nb_xmlXPathContextPtr;n_ctx++) {
46080 mem_base = xmlMemBlocks();
46081 comp = gen_xmlXPathCompExprPtr(n_comp, 0);
46082 ctx = gen_xmlXPathContextPtr(n_ctx, 1);
46084 ret_val = xmlXPathCompiledEval(comp, ctx);
46085 desret_xmlXPathObjectPtr(ret_val);
46087 des_xmlXPathCompExprPtr(n_comp, comp, 0);
46088 des_xmlXPathContextPtr(n_ctx, ctx, 1);
46089 xmlResetLastError();
46090 if (mem_base != xmlMemBlocks()) {
46091 printf("Leak of %d blocks found in xmlXPathCompiledEval",
46092 xmlMemBlocks() - mem_base);
46094 printf(" %d", n_comp);
46095 printf(" %d", n_ctx);
46108 test_xmlXPathCompiledEvalToBoolean(void) {
46111 #if defined(LIBXML_XPATH_ENABLED)
46114 xmlXPathCompExprPtr comp; /* the compiled XPath expression */
46116 xmlXPathContextPtr ctxt; /* the XPath context */
46119 for (n_comp = 0;n_comp < gen_nb_xmlXPathCompExprPtr;n_comp++) {
46120 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
46121 mem_base = xmlMemBlocks();
46122 comp = gen_xmlXPathCompExprPtr(n_comp, 0);
46123 ctxt = gen_xmlXPathContextPtr(n_ctxt, 1);
46125 ret_val = xmlXPathCompiledEvalToBoolean(comp, ctxt);
46126 desret_int(ret_val);
46128 des_xmlXPathCompExprPtr(n_comp, comp, 0);
46129 des_xmlXPathContextPtr(n_ctxt, ctxt, 1);
46130 xmlResetLastError();
46131 if (mem_base != xmlMemBlocks()) {
46132 printf("Leak of %d blocks found in xmlXPathCompiledEvalToBoolean",
46133 xmlMemBlocks() - mem_base);
46135 printf(" %d", n_comp);
46136 printf(" %d", n_ctxt);
46149 test_xmlXPathContextSetCache(void) {
46152 #if defined(LIBXML_XPATH_ENABLED)
46155 xmlXPathContextPtr ctxt; /* the XPath context */
46157 int active; /* enables/disables (creates/frees) the cache */
46159 int value; /* a value with semantics dependant on @options */
46161 int options; /* options (currently only the value 0 is used) */
46164 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
46165 for (n_active = 0;n_active < gen_nb_int;n_active++) {
46166 for (n_value = 0;n_value < gen_nb_int;n_value++) {
46167 for (n_options = 0;n_options < gen_nb_int;n_options++) {
46168 mem_base = xmlMemBlocks();
46169 ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
46170 active = gen_int(n_active, 1);
46171 value = gen_int(n_value, 2);
46172 options = gen_int(n_options, 3);
46174 ret_val = xmlXPathContextSetCache(ctxt, active, value, options);
46175 desret_int(ret_val);
46177 des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
46178 des_int(n_active, active, 1);
46179 des_int(n_value, value, 2);
46180 des_int(n_options, options, 3);
46181 xmlResetLastError();
46182 if (mem_base != xmlMemBlocks()) {
46183 printf("Leak of %d blocks found in xmlXPathContextSetCache",
46184 xmlMemBlocks() - mem_base);
46186 printf(" %d", n_ctxt);
46187 printf(" %d", n_active);
46188 printf(" %d", n_value);
46189 printf(" %d", n_options);
46204 test_xmlXPathConvertBoolean(void) {
46207 #if defined(LIBXML_XPATH_ENABLED)
46209 xmlXPathObjectPtr ret_val;
46210 xmlXPathObjectPtr val; /* an XPath object */
46213 for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
46214 mem_base = xmlMemBlocks();
46215 val = gen_xmlXPathObjectPtr(n_val, 0);
46217 ret_val = xmlXPathConvertBoolean(val);
46219 desret_xmlXPathObjectPtr(ret_val);
46221 des_xmlXPathObjectPtr(n_val, val, 0);
46222 xmlResetLastError();
46223 if (mem_base != xmlMemBlocks()) {
46224 printf("Leak of %d blocks found in xmlXPathConvertBoolean",
46225 xmlMemBlocks() - mem_base);
46227 printf(" %d", n_val);
46239 test_xmlXPathConvertNumber(void) {
46242 #if defined(LIBXML_XPATH_ENABLED)
46244 xmlXPathObjectPtr ret_val;
46245 xmlXPathObjectPtr val; /* an XPath object */
46248 for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
46249 mem_base = xmlMemBlocks();
46250 val = gen_xmlXPathObjectPtr(n_val, 0);
46252 ret_val = xmlXPathConvertNumber(val);
46254 desret_xmlXPathObjectPtr(ret_val);
46256 des_xmlXPathObjectPtr(n_val, val, 0);
46257 xmlResetLastError();
46258 if (mem_base != xmlMemBlocks()) {
46259 printf("Leak of %d blocks found in xmlXPathConvertNumber",
46260 xmlMemBlocks() - mem_base);
46262 printf(" %d", n_val);
46274 test_xmlXPathConvertString(void) {
46277 #if defined(LIBXML_XPATH_ENABLED)
46279 xmlXPathObjectPtr ret_val;
46280 xmlXPathObjectPtr val; /* an XPath object */
46283 for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
46284 mem_base = xmlMemBlocks();
46285 val = gen_xmlXPathObjectPtr(n_val, 0);
46287 ret_val = xmlXPathConvertString(val);
46289 desret_xmlXPathObjectPtr(ret_val);
46291 des_xmlXPathObjectPtr(n_val, val, 0);
46292 xmlResetLastError();
46293 if (mem_base != xmlMemBlocks()) {
46294 printf("Leak of %d blocks found in xmlXPathConvertString",
46295 xmlMemBlocks() - mem_base);
46297 printf(" %d", n_val);
46309 test_xmlXPathCtxtCompile(void) {
46313 /* missing type support */
46319 test_xmlXPathEval(void) {
46322 #if defined(LIBXML_XPATH_ENABLED)
46324 xmlXPathObjectPtr ret_val;
46325 xmlChar * str; /* the XPath expression */
46327 xmlXPathContextPtr ctx; /* the XPath context */
46330 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
46331 for (n_ctx = 0;n_ctx < gen_nb_xmlXPathContextPtr;n_ctx++) {
46332 mem_base = xmlMemBlocks();
46333 str = gen_const_xmlChar_ptr(n_str, 0);
46334 ctx = gen_xmlXPathContextPtr(n_ctx, 1);
46336 ret_val = xmlXPathEval((const xmlChar *)str, ctx);
46337 desret_xmlXPathObjectPtr(ret_val);
46339 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
46340 des_xmlXPathContextPtr(n_ctx, ctx, 1);
46341 xmlResetLastError();
46342 if (mem_base != xmlMemBlocks()) {
46343 printf("Leak of %d blocks found in xmlXPathEval",
46344 xmlMemBlocks() - mem_base);
46346 printf(" %d", n_str);
46347 printf(" %d", n_ctx);
46360 test_xmlXPathEvalExpression(void) {
46363 #if defined(LIBXML_XPATH_ENABLED)
46365 xmlXPathObjectPtr ret_val;
46366 xmlChar * str; /* the XPath expression */
46368 xmlXPathContextPtr ctxt; /* the XPath context */
46371 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
46372 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
46373 mem_base = xmlMemBlocks();
46374 str = gen_const_xmlChar_ptr(n_str, 0);
46375 ctxt = gen_xmlXPathContextPtr(n_ctxt, 1);
46377 ret_val = xmlXPathEvalExpression((const xmlChar *)str, ctxt);
46378 desret_xmlXPathObjectPtr(ret_val);
46380 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
46381 des_xmlXPathContextPtr(n_ctxt, ctxt, 1);
46382 xmlResetLastError();
46383 if (mem_base != xmlMemBlocks()) {
46384 printf("Leak of %d blocks found in xmlXPathEvalExpression",
46385 xmlMemBlocks() - mem_base);
46387 printf(" %d", n_str);
46388 printf(" %d", n_ctxt);
46401 test_xmlXPathEvalPredicate(void) {
46404 #if defined(LIBXML_XPATH_ENABLED)
46407 xmlXPathContextPtr ctxt; /* the XPath context */
46409 xmlXPathObjectPtr res; /* the Predicate Expression evaluation result */
46412 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
46413 for (n_res = 0;n_res < gen_nb_xmlXPathObjectPtr;n_res++) {
46414 mem_base = xmlMemBlocks();
46415 ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
46416 res = gen_xmlXPathObjectPtr(n_res, 1);
46418 ret_val = xmlXPathEvalPredicate(ctxt, res);
46419 desret_int(ret_val);
46421 des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
46422 des_xmlXPathObjectPtr(n_res, res, 1);
46423 xmlResetLastError();
46424 if (mem_base != xmlMemBlocks()) {
46425 printf("Leak of %d blocks found in xmlXPathEvalPredicate",
46426 xmlMemBlocks() - mem_base);
46428 printf(" %d", n_ctxt);
46429 printf(" %d", n_res);
46442 test_xmlXPathInit(void) {
46445 #if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
46448 mem_base = xmlMemBlocks();
46452 xmlResetLastError();
46453 if (mem_base != xmlMemBlocks()) {
46454 printf("Leak of %d blocks found in xmlXPathInit",
46455 xmlMemBlocks() - mem_base);
46467 test_xmlXPathIsInf(void) {
46470 #if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
46473 double val; /* a double value */
46476 for (n_val = 0;n_val < gen_nb_double;n_val++) {
46477 mem_base = xmlMemBlocks();
46478 val = gen_double(n_val, 0);
46480 ret_val = xmlXPathIsInf(val);
46481 desret_int(ret_val);
46483 des_double(n_val, val, 0);
46484 xmlResetLastError();
46485 if (mem_base != xmlMemBlocks()) {
46486 printf("Leak of %d blocks found in xmlXPathIsInf",
46487 xmlMemBlocks() - mem_base);
46489 printf(" %d", n_val);
46501 test_xmlXPathIsNaN(void) {
46504 #if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
46507 double val; /* a double value */
46510 for (n_val = 0;n_val < gen_nb_double;n_val++) {
46511 mem_base = xmlMemBlocks();
46512 val = gen_double(n_val, 0);
46514 ret_val = xmlXPathIsNaN(val);
46515 desret_int(ret_val);
46517 des_double(n_val, val, 0);
46518 xmlResetLastError();
46519 if (mem_base != xmlMemBlocks()) {
46520 printf("Leak of %d blocks found in xmlXPathIsNaN",
46521 xmlMemBlocks() - mem_base);
46523 printf(" %d", n_val);
46535 test_xmlXPathNewContext(void) {
46539 /* missing type support */
46545 test_xmlXPathNodeSetCreate(void) {
46548 #if defined(LIBXML_XPATH_ENABLED)
46550 xmlNodeSetPtr ret_val;
46551 xmlNodePtr val; /* an initial xmlNodePtr, or NULL */
46554 for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
46555 mem_base = xmlMemBlocks();
46556 val = gen_xmlNodePtr(n_val, 0);
46558 ret_val = xmlXPathNodeSetCreate(val);
46559 desret_xmlNodeSetPtr(ret_val);
46561 des_xmlNodePtr(n_val, val, 0);
46562 xmlResetLastError();
46563 if (mem_base != xmlMemBlocks()) {
46564 printf("Leak of %d blocks found in xmlXPathNodeSetCreate",
46565 xmlMemBlocks() - mem_base);
46567 printf(" %d", n_val);
46579 test_xmlXPathObjectCopy(void) {
46582 #if defined(LIBXML_XPATH_ENABLED)
46584 xmlXPathObjectPtr ret_val;
46585 xmlXPathObjectPtr val; /* the original object */
46588 for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
46589 mem_base = xmlMemBlocks();
46590 val = gen_xmlXPathObjectPtr(n_val, 0);
46592 ret_val = xmlXPathObjectCopy(val);
46593 desret_xmlXPathObjectPtr(ret_val);
46595 des_xmlXPathObjectPtr(n_val, val, 0);
46596 xmlResetLastError();
46597 if (mem_base != xmlMemBlocks()) {
46598 printf("Leak of %d blocks found in xmlXPathObjectCopy",
46599 xmlMemBlocks() - mem_base);
46601 printf(" %d", n_val);
46613 test_xmlXPathOrderDocElems(void) {
46616 #if defined(LIBXML_XPATH_ENABLED)
46619 xmlDocPtr doc; /* an input document */
46622 for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
46623 mem_base = xmlMemBlocks();
46624 doc = gen_xmlDocPtr(n_doc, 0);
46626 ret_val = xmlXPathOrderDocElems(doc);
46627 desret_long(ret_val);
46629 des_xmlDocPtr(n_doc, doc, 0);
46630 xmlResetLastError();
46631 if (mem_base != xmlMemBlocks()) {
46632 printf("Leak of %d blocks found in xmlXPathOrderDocElems",
46633 xmlMemBlocks() - mem_base);
46635 printf(" %d", n_doc);
46649 if (quiet == 0) printf("Testing xpath : 30 of 38 functions ...\n");
46650 test_ret += test_xmlXPathCastBooleanToNumber();
46651 test_ret += test_xmlXPathCastBooleanToString();
46652 test_ret += test_xmlXPathCastNodeSetToBoolean();
46653 test_ret += test_xmlXPathCastNodeSetToNumber();
46654 test_ret += test_xmlXPathCastNodeSetToString();
46655 test_ret += test_xmlXPathCastNodeToNumber();
46656 test_ret += test_xmlXPathCastNodeToString();
46657 test_ret += test_xmlXPathCastNumberToBoolean();
46658 test_ret += test_xmlXPathCastNumberToString();
46659 test_ret += test_xmlXPathCastStringToBoolean();
46660 test_ret += test_xmlXPathCastStringToNumber();
46661 test_ret += test_xmlXPathCastToBoolean();
46662 test_ret += test_xmlXPathCastToNumber();
46663 test_ret += test_xmlXPathCastToString();
46664 test_ret += test_xmlXPathCmpNodes();
46665 test_ret += test_xmlXPathCompile();
46666 test_ret += test_xmlXPathCompiledEval();
46667 test_ret += test_xmlXPathCompiledEvalToBoolean();
46668 test_ret += test_xmlXPathContextSetCache();
46669 test_ret += test_xmlXPathConvertBoolean();
46670 test_ret += test_xmlXPathConvertNumber();
46671 test_ret += test_xmlXPathConvertString();
46672 test_ret += test_xmlXPathCtxtCompile();
46673 test_ret += test_xmlXPathEval();
46674 test_ret += test_xmlXPathEvalExpression();
46675 test_ret += test_xmlXPathEvalPredicate();
46676 test_ret += test_xmlXPathInit();
46677 test_ret += test_xmlXPathIsInf();
46678 test_ret += test_xmlXPathIsNaN();
46679 test_ret += test_xmlXPathNewContext();
46680 test_ret += test_xmlXPathNodeSetCreate();
46681 test_ret += test_xmlXPathObjectCopy();
46682 test_ret += test_xmlXPathOrderDocElems();
46685 printf("Module xpath: %d errors\n", test_ret);
46688 #ifdef LIBXML_XPATH_ENABLED
46690 #define gen_nb_xmlXPathParserContextPtr 1
46691 static xmlXPathParserContextPtr gen_xmlXPathParserContextPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
46694 static void des_xmlXPathParserContextPtr(int no ATTRIBUTE_UNUSED, xmlXPathParserContextPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
46700 test_valuePop(void) {
46703 #if defined(LIBXML_XPATH_ENABLED)
46705 xmlXPathObjectPtr ret_val;
46706 xmlXPathParserContextPtr ctxt; /* an XPath evaluation context */
46709 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46710 mem_base = xmlMemBlocks();
46711 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46713 ret_val = valuePop(ctxt);
46714 desret_xmlXPathObjectPtr(ret_val);
46716 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46717 xmlResetLastError();
46718 if (mem_base != xmlMemBlocks()) {
46719 printf("Leak of %d blocks found in valuePop",
46720 xmlMemBlocks() - mem_base);
46722 printf(" %d", n_ctxt);
46734 test_valuePush(void) {
46737 #if defined(LIBXML_XPATH_ENABLED)
46740 xmlXPathParserContextPtr ctxt; /* an XPath evaluation context */
46742 xmlXPathObjectPtr value; /* the XPath object */
46745 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46746 for (n_value = 0;n_value < gen_nb_xmlXPathObjectPtr;n_value++) {
46747 mem_base = xmlMemBlocks();
46748 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46749 value = gen_xmlXPathObjectPtr(n_value, 1);
46751 ret_val = valuePush(ctxt, value);
46752 desret_int(ret_val);
46754 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46755 des_xmlXPathObjectPtr(n_value, value, 1);
46756 xmlResetLastError();
46757 if (mem_base != xmlMemBlocks()) {
46758 printf("Leak of %d blocks found in valuePush",
46759 xmlMemBlocks() - mem_base);
46761 printf(" %d", n_ctxt);
46762 printf(" %d", n_value);
46775 test_xmlXPathAddValues(void) {
46778 #if defined(LIBXML_XPATH_ENABLED)
46780 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46783 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46784 mem_base = xmlMemBlocks();
46785 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46787 xmlXPathAddValues(ctxt);
46789 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46790 xmlResetLastError();
46791 if (mem_base != xmlMemBlocks()) {
46792 printf("Leak of %d blocks found in xmlXPathAddValues",
46793 xmlMemBlocks() - mem_base);
46795 printf(" %d", n_ctxt);
46807 test_xmlXPathBooleanFunction(void) {
46810 #if defined(LIBXML_XPATH_ENABLED)
46812 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46814 int nargs; /* the number of arguments */
46817 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46818 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
46819 mem_base = xmlMemBlocks();
46820 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46821 nargs = gen_int(n_nargs, 1);
46823 xmlXPathBooleanFunction(ctxt, nargs);
46825 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46826 des_int(n_nargs, nargs, 1);
46827 xmlResetLastError();
46828 if (mem_base != xmlMemBlocks()) {
46829 printf("Leak of %d blocks found in xmlXPathBooleanFunction",
46830 xmlMemBlocks() - mem_base);
46832 printf(" %d", n_ctxt);
46833 printf(" %d", n_nargs);
46846 test_xmlXPathCeilingFunction(void) {
46849 #if defined(LIBXML_XPATH_ENABLED)
46851 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46853 int nargs; /* the number of arguments */
46856 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46857 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
46858 mem_base = xmlMemBlocks();
46859 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46860 nargs = gen_int(n_nargs, 1);
46862 xmlXPathCeilingFunction(ctxt, nargs);
46864 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46865 des_int(n_nargs, nargs, 1);
46866 xmlResetLastError();
46867 if (mem_base != xmlMemBlocks()) {
46868 printf("Leak of %d blocks found in xmlXPathCeilingFunction",
46869 xmlMemBlocks() - mem_base);
46871 printf(" %d", n_ctxt);
46872 printf(" %d", n_nargs);
46885 test_xmlXPathCompareValues(void) {
46888 #if defined(LIBXML_XPATH_ENABLED)
46891 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46893 int inf; /* less than (1) or greater than (0) */
46895 int strict; /* is the comparison strict */
46898 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46899 for (n_inf = 0;n_inf < gen_nb_int;n_inf++) {
46900 for (n_strict = 0;n_strict < gen_nb_int;n_strict++) {
46901 mem_base = xmlMemBlocks();
46902 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46903 inf = gen_int(n_inf, 1);
46904 strict = gen_int(n_strict, 2);
46906 ret_val = xmlXPathCompareValues(ctxt, inf, strict);
46907 desret_int(ret_val);
46909 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46910 des_int(n_inf, inf, 1);
46911 des_int(n_strict, strict, 2);
46912 xmlResetLastError();
46913 if (mem_base != xmlMemBlocks()) {
46914 printf("Leak of %d blocks found in xmlXPathCompareValues",
46915 xmlMemBlocks() - mem_base);
46917 printf(" %d", n_ctxt);
46918 printf(" %d", n_inf);
46919 printf(" %d", n_strict);
46933 test_xmlXPathConcatFunction(void) {
46936 #if defined(LIBXML_XPATH_ENABLED)
46938 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46940 int nargs; /* the number of arguments */
46943 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46944 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
46945 mem_base = xmlMemBlocks();
46946 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46947 nargs = gen_int(n_nargs, 1);
46949 xmlXPathConcatFunction(ctxt, nargs);
46951 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46952 des_int(n_nargs, nargs, 1);
46953 xmlResetLastError();
46954 if (mem_base != xmlMemBlocks()) {
46955 printf("Leak of %d blocks found in xmlXPathConcatFunction",
46956 xmlMemBlocks() - mem_base);
46958 printf(" %d", n_ctxt);
46959 printf(" %d", n_nargs);
46972 test_xmlXPathContainsFunction(void) {
46975 #if defined(LIBXML_XPATH_ENABLED)
46977 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46979 int nargs; /* the number of arguments */
46982 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46983 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
46984 mem_base = xmlMemBlocks();
46985 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46986 nargs = gen_int(n_nargs, 1);
46988 xmlXPathContainsFunction(ctxt, nargs);
46990 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46991 des_int(n_nargs, nargs, 1);
46992 xmlResetLastError();
46993 if (mem_base != xmlMemBlocks()) {
46994 printf("Leak of %d blocks found in xmlXPathContainsFunction",
46995 xmlMemBlocks() - mem_base);
46997 printf(" %d", n_ctxt);
46998 printf(" %d", n_nargs);
47011 test_xmlXPathCountFunction(void) {
47014 #if defined(LIBXML_XPATH_ENABLED)
47016 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47018 int nargs; /* the number of arguments */
47021 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47022 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47023 mem_base = xmlMemBlocks();
47024 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47025 nargs = gen_int(n_nargs, 1);
47027 xmlXPathCountFunction(ctxt, nargs);
47029 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47030 des_int(n_nargs, nargs, 1);
47031 xmlResetLastError();
47032 if (mem_base != xmlMemBlocks()) {
47033 printf("Leak of %d blocks found in xmlXPathCountFunction",
47034 xmlMemBlocks() - mem_base);
47036 printf(" %d", n_ctxt);
47037 printf(" %d", n_nargs);
47050 test_xmlXPathDebugDumpCompExpr(void) {
47053 #if defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_DEBUG_ENABLED)
47055 FILE * output; /* the FILE * for the output */
47057 xmlXPathCompExprPtr comp; /* the precompiled XPath expression */
47059 int depth; /* the indentation level. */
47062 for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
47063 for (n_comp = 0;n_comp < gen_nb_xmlXPathCompExprPtr;n_comp++) {
47064 for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
47065 mem_base = xmlMemBlocks();
47066 output = gen_FILE_ptr(n_output, 0);
47067 comp = gen_xmlXPathCompExprPtr(n_comp, 1);
47068 depth = gen_int(n_depth, 2);
47070 xmlXPathDebugDumpCompExpr(output, comp, depth);
47072 des_FILE_ptr(n_output, output, 0);
47073 des_xmlXPathCompExprPtr(n_comp, comp, 1);
47074 des_int(n_depth, depth, 2);
47075 xmlResetLastError();
47076 if (mem_base != xmlMemBlocks()) {
47077 printf("Leak of %d blocks found in xmlXPathDebugDumpCompExpr",
47078 xmlMemBlocks() - mem_base);
47080 printf(" %d", n_output);
47081 printf(" %d", n_comp);
47082 printf(" %d", n_depth);
47096 test_xmlXPathDebugDumpObject(void) {
47099 #if defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_DEBUG_ENABLED)
47101 FILE * output; /* the FILE * to dump the output */
47103 xmlXPathObjectPtr cur; /* the object to inspect */
47105 int depth; /* indentation level */
47108 for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
47109 for (n_cur = 0;n_cur < gen_nb_xmlXPathObjectPtr;n_cur++) {
47110 for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
47111 mem_base = xmlMemBlocks();
47112 output = gen_FILE_ptr(n_output, 0);
47113 cur = gen_xmlXPathObjectPtr(n_cur, 1);
47114 depth = gen_int(n_depth, 2);
47116 xmlXPathDebugDumpObject(output, cur, depth);
47118 des_FILE_ptr(n_output, output, 0);
47119 des_xmlXPathObjectPtr(n_cur, cur, 1);
47120 des_int(n_depth, depth, 2);
47121 xmlResetLastError();
47122 if (mem_base != xmlMemBlocks()) {
47123 printf("Leak of %d blocks found in xmlXPathDebugDumpObject",
47124 xmlMemBlocks() - mem_base);
47126 printf(" %d", n_output);
47127 printf(" %d", n_cur);
47128 printf(" %d", n_depth);
47142 test_xmlXPathDifference(void) {
47145 #if defined(LIBXML_XPATH_ENABLED)
47147 xmlNodeSetPtr ret_val;
47148 xmlNodeSetPtr nodes1; /* a node-set */
47150 xmlNodeSetPtr nodes2; /* a node-set */
47153 for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
47154 for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
47155 mem_base = xmlMemBlocks();
47156 nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
47157 nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
47159 ret_val = xmlXPathDifference(nodes1, nodes2);
47160 desret_xmlNodeSetPtr(ret_val);
47162 des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
47163 des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
47164 xmlResetLastError();
47165 if (mem_base != xmlMemBlocks()) {
47166 printf("Leak of %d blocks found in xmlXPathDifference",
47167 xmlMemBlocks() - mem_base);
47169 printf(" %d", n_nodes1);
47170 printf(" %d", n_nodes2);
47183 test_xmlXPathDistinct(void) {
47186 #if defined(LIBXML_XPATH_ENABLED)
47188 xmlNodeSetPtr ret_val;
47189 xmlNodeSetPtr nodes; /* a node-set */
47192 for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
47193 mem_base = xmlMemBlocks();
47194 nodes = gen_xmlNodeSetPtr(n_nodes, 0);
47196 ret_val = xmlXPathDistinct(nodes);
47197 desret_xmlNodeSetPtr(ret_val);
47199 des_xmlNodeSetPtr(n_nodes, nodes, 0);
47200 xmlResetLastError();
47201 if (mem_base != xmlMemBlocks()) {
47202 printf("Leak of %d blocks found in xmlXPathDistinct",
47203 xmlMemBlocks() - mem_base);
47205 printf(" %d", n_nodes);
47217 test_xmlXPathDistinctSorted(void) {
47220 #if defined(LIBXML_XPATH_ENABLED)
47222 xmlNodeSetPtr ret_val;
47223 xmlNodeSetPtr nodes; /* a node-set, sorted by document order */
47226 for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
47227 mem_base = xmlMemBlocks();
47228 nodes = gen_xmlNodeSetPtr(n_nodes, 0);
47230 ret_val = xmlXPathDistinctSorted(nodes);
47231 desret_xmlNodeSetPtr(ret_val);
47233 des_xmlNodeSetPtr(n_nodes, nodes, 0);
47234 xmlResetLastError();
47235 if (mem_base != xmlMemBlocks()) {
47236 printf("Leak of %d blocks found in xmlXPathDistinctSorted",
47237 xmlMemBlocks() - mem_base);
47239 printf(" %d", n_nodes);
47251 test_xmlXPathDivValues(void) {
47254 #if defined(LIBXML_XPATH_ENABLED)
47256 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47259 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47260 mem_base = xmlMemBlocks();
47261 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47263 xmlXPathDivValues(ctxt);
47265 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47266 xmlResetLastError();
47267 if (mem_base != xmlMemBlocks()) {
47268 printf("Leak of %d blocks found in xmlXPathDivValues",
47269 xmlMemBlocks() - mem_base);
47271 printf(" %d", n_ctxt);
47283 test_xmlXPathEqualValues(void) {
47286 #if defined(LIBXML_XPATH_ENABLED)
47289 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47292 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47293 mem_base = xmlMemBlocks();
47294 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47296 ret_val = xmlXPathEqualValues(ctxt);
47297 desret_int(ret_val);
47299 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47300 xmlResetLastError();
47301 if (mem_base != xmlMemBlocks()) {
47302 printf("Leak of %d blocks found in xmlXPathEqualValues",
47303 xmlMemBlocks() - mem_base);
47305 printf(" %d", n_ctxt);
47317 test_xmlXPathErr(void) {
47320 #if defined(LIBXML_XPATH_ENABLED)
47322 xmlXPathParserContextPtr ctxt; /* a XPath parser context */
47324 int error; /* the error code */
47327 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47328 for (n_error = 0;n_error < gen_nb_int;n_error++) {
47329 mem_base = xmlMemBlocks();
47330 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47331 error = gen_int(n_error, 1);
47333 xmlXPathErr(ctxt, error);
47335 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47336 des_int(n_error, error, 1);
47337 xmlResetLastError();
47338 if (mem_base != xmlMemBlocks()) {
47339 printf("Leak of %d blocks found in xmlXPathErr",
47340 xmlMemBlocks() - mem_base);
47342 printf(" %d", n_ctxt);
47343 printf(" %d", n_error);
47356 test_xmlXPathEvalExpr(void) {
47359 #if defined(LIBXML_XPATH_ENABLED)
47361 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47364 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47365 mem_base = xmlMemBlocks();
47366 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47368 xmlXPathEvalExpr(ctxt);
47370 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47371 xmlResetLastError();
47372 if (mem_base != xmlMemBlocks()) {
47373 printf("Leak of %d blocks found in xmlXPathEvalExpr",
47374 xmlMemBlocks() - mem_base);
47376 printf(" %d", n_ctxt);
47388 test_xmlXPathEvaluatePredicateResult(void) {
47391 #if defined(LIBXML_XPATH_ENABLED)
47394 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47396 xmlXPathObjectPtr res; /* the Predicate Expression evaluation result */
47399 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47400 for (n_res = 0;n_res < gen_nb_xmlXPathObjectPtr;n_res++) {
47401 mem_base = xmlMemBlocks();
47402 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47403 res = gen_xmlXPathObjectPtr(n_res, 1);
47405 ret_val = xmlXPathEvaluatePredicateResult(ctxt, res);
47406 desret_int(ret_val);
47408 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47409 des_xmlXPathObjectPtr(n_res, res, 1);
47410 xmlResetLastError();
47411 if (mem_base != xmlMemBlocks()) {
47412 printf("Leak of %d blocks found in xmlXPathEvaluatePredicateResult",
47413 xmlMemBlocks() - mem_base);
47415 printf(" %d", n_ctxt);
47416 printf(" %d", n_res);
47429 test_xmlXPathFalseFunction(void) {
47432 #if defined(LIBXML_XPATH_ENABLED)
47434 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47436 int nargs; /* the number of arguments */
47439 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47440 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47441 mem_base = xmlMemBlocks();
47442 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47443 nargs = gen_int(n_nargs, 1);
47445 xmlXPathFalseFunction(ctxt, nargs);
47447 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47448 des_int(n_nargs, nargs, 1);
47449 xmlResetLastError();
47450 if (mem_base != xmlMemBlocks()) {
47451 printf("Leak of %d blocks found in xmlXPathFalseFunction",
47452 xmlMemBlocks() - mem_base);
47454 printf(" %d", n_ctxt);
47455 printf(" %d", n_nargs);
47468 test_xmlXPathFloorFunction(void) {
47471 #if defined(LIBXML_XPATH_ENABLED)
47473 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47475 int nargs; /* the number of arguments */
47478 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47479 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47480 mem_base = xmlMemBlocks();
47481 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47482 nargs = gen_int(n_nargs, 1);
47484 xmlXPathFloorFunction(ctxt, nargs);
47486 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47487 des_int(n_nargs, nargs, 1);
47488 xmlResetLastError();
47489 if (mem_base != xmlMemBlocks()) {
47490 printf("Leak of %d blocks found in xmlXPathFloorFunction",
47491 xmlMemBlocks() - mem_base);
47493 printf(" %d", n_ctxt);
47494 printf(" %d", n_nargs);
47507 test_xmlXPathFunctionLookup(void) {
47511 /* missing type support */
47517 test_xmlXPathFunctionLookupNS(void) {
47521 /* missing type support */
47527 test_xmlXPathHasSameNodes(void) {
47530 #if defined(LIBXML_XPATH_ENABLED)
47533 xmlNodeSetPtr nodes1; /* a node-set */
47535 xmlNodeSetPtr nodes2; /* a node-set */
47538 for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
47539 for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
47540 mem_base = xmlMemBlocks();
47541 nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
47542 nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
47544 ret_val = xmlXPathHasSameNodes(nodes1, nodes2);
47545 desret_int(ret_val);
47547 des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
47548 des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
47549 xmlResetLastError();
47550 if (mem_base != xmlMemBlocks()) {
47551 printf("Leak of %d blocks found in xmlXPathHasSameNodes",
47552 xmlMemBlocks() - mem_base);
47554 printf(" %d", n_nodes1);
47555 printf(" %d", n_nodes2);
47568 test_xmlXPathIdFunction(void) {
47571 #if defined(LIBXML_XPATH_ENABLED)
47573 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47575 int nargs; /* the number of arguments */
47578 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47579 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47580 mem_base = xmlMemBlocks();
47581 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47582 nargs = gen_int(n_nargs, 1);
47584 xmlXPathIdFunction(ctxt, nargs);
47586 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47587 des_int(n_nargs, nargs, 1);
47588 xmlResetLastError();
47589 if (mem_base != xmlMemBlocks()) {
47590 printf("Leak of %d blocks found in xmlXPathIdFunction",
47591 xmlMemBlocks() - mem_base);
47593 printf(" %d", n_ctxt);
47594 printf(" %d", n_nargs);
47607 test_xmlXPathIntersection(void) {
47610 #if defined(LIBXML_XPATH_ENABLED)
47612 xmlNodeSetPtr ret_val;
47613 xmlNodeSetPtr nodes1; /* a node-set */
47615 xmlNodeSetPtr nodes2; /* a node-set */
47618 for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
47619 for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
47620 mem_base = xmlMemBlocks();
47621 nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
47622 nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
47624 ret_val = xmlXPathIntersection(nodes1, nodes2);
47625 desret_xmlNodeSetPtr(ret_val);
47627 des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
47628 des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
47629 xmlResetLastError();
47630 if (mem_base != xmlMemBlocks()) {
47631 printf("Leak of %d blocks found in xmlXPathIntersection",
47632 xmlMemBlocks() - mem_base);
47634 printf(" %d", n_nodes1);
47635 printf(" %d", n_nodes2);
47648 test_xmlXPathIsNodeType(void) {
47651 #if defined(LIBXML_XPATH_ENABLED)
47654 xmlChar * name; /* a name string */
47657 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
47658 mem_base = xmlMemBlocks();
47659 name = gen_const_xmlChar_ptr(n_name, 0);
47661 ret_val = xmlXPathIsNodeType((const xmlChar *)name);
47662 desret_int(ret_val);
47664 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
47665 xmlResetLastError();
47666 if (mem_base != xmlMemBlocks()) {
47667 printf("Leak of %d blocks found in xmlXPathIsNodeType",
47668 xmlMemBlocks() - mem_base);
47670 printf(" %d", n_name);
47682 test_xmlXPathLangFunction(void) {
47685 #if defined(LIBXML_XPATH_ENABLED)
47687 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47689 int nargs; /* the number of arguments */
47692 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47693 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47694 mem_base = xmlMemBlocks();
47695 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47696 nargs = gen_int(n_nargs, 1);
47698 xmlXPathLangFunction(ctxt, nargs);
47700 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47701 des_int(n_nargs, nargs, 1);
47702 xmlResetLastError();
47703 if (mem_base != xmlMemBlocks()) {
47704 printf("Leak of %d blocks found in xmlXPathLangFunction",
47705 xmlMemBlocks() - mem_base);
47707 printf(" %d", n_ctxt);
47708 printf(" %d", n_nargs);
47721 test_xmlXPathLastFunction(void) {
47724 #if defined(LIBXML_XPATH_ENABLED)
47726 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47728 int nargs; /* the number of arguments */
47731 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47732 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47733 mem_base = xmlMemBlocks();
47734 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47735 nargs = gen_int(n_nargs, 1);
47737 xmlXPathLastFunction(ctxt, nargs);
47739 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47740 des_int(n_nargs, nargs, 1);
47741 xmlResetLastError();
47742 if (mem_base != xmlMemBlocks()) {
47743 printf("Leak of %d blocks found in xmlXPathLastFunction",
47744 xmlMemBlocks() - mem_base);
47746 printf(" %d", n_ctxt);
47747 printf(" %d", n_nargs);
47760 test_xmlXPathLeading(void) {
47763 #if defined(LIBXML_XPATH_ENABLED)
47765 xmlNodeSetPtr ret_val;
47766 xmlNodeSetPtr nodes1; /* a node-set */
47768 xmlNodeSetPtr nodes2; /* a node-set */
47771 for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
47772 for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
47773 mem_base = xmlMemBlocks();
47774 nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
47775 nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
47777 ret_val = xmlXPathLeading(nodes1, nodes2);
47778 desret_xmlNodeSetPtr(ret_val);
47780 des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
47781 des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
47782 xmlResetLastError();
47783 if (mem_base != xmlMemBlocks()) {
47784 printf("Leak of %d blocks found in xmlXPathLeading",
47785 xmlMemBlocks() - mem_base);
47787 printf(" %d", n_nodes1);
47788 printf(" %d", n_nodes2);
47801 test_xmlXPathLeadingSorted(void) {
47804 #if defined(LIBXML_XPATH_ENABLED)
47806 xmlNodeSetPtr ret_val;
47807 xmlNodeSetPtr nodes1; /* a node-set, sorted by document order */
47809 xmlNodeSetPtr nodes2; /* a node-set, sorted by document order */
47812 for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
47813 for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
47814 mem_base = xmlMemBlocks();
47815 nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
47816 nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
47818 ret_val = xmlXPathLeadingSorted(nodes1, nodes2);
47819 desret_xmlNodeSetPtr(ret_val);
47821 des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
47822 des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
47823 xmlResetLastError();
47824 if (mem_base != xmlMemBlocks()) {
47825 printf("Leak of %d blocks found in xmlXPathLeadingSorted",
47826 xmlMemBlocks() - mem_base);
47828 printf(" %d", n_nodes1);
47829 printf(" %d", n_nodes2);
47842 test_xmlXPathLocalNameFunction(void) {
47845 #if defined(LIBXML_XPATH_ENABLED)
47847 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47849 int nargs; /* the number of arguments */
47852 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47853 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47854 mem_base = xmlMemBlocks();
47855 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47856 nargs = gen_int(n_nargs, 1);
47858 xmlXPathLocalNameFunction(ctxt, nargs);
47860 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47861 des_int(n_nargs, nargs, 1);
47862 xmlResetLastError();
47863 if (mem_base != xmlMemBlocks()) {
47864 printf("Leak of %d blocks found in xmlXPathLocalNameFunction",
47865 xmlMemBlocks() - mem_base);
47867 printf(" %d", n_ctxt);
47868 printf(" %d", n_nargs);
47881 test_xmlXPathModValues(void) {
47884 #if defined(LIBXML_XPATH_ENABLED)
47886 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47889 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47890 mem_base = xmlMemBlocks();
47891 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47893 xmlXPathModValues(ctxt);
47895 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47896 xmlResetLastError();
47897 if (mem_base != xmlMemBlocks()) {
47898 printf("Leak of %d blocks found in xmlXPathModValues",
47899 xmlMemBlocks() - mem_base);
47901 printf(" %d", n_ctxt);
47913 test_xmlXPathMultValues(void) {
47916 #if defined(LIBXML_XPATH_ENABLED)
47918 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47921 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47922 mem_base = xmlMemBlocks();
47923 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47925 xmlXPathMultValues(ctxt);
47927 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47928 xmlResetLastError();
47929 if (mem_base != xmlMemBlocks()) {
47930 printf("Leak of %d blocks found in xmlXPathMultValues",
47931 xmlMemBlocks() - mem_base);
47933 printf(" %d", n_ctxt);
47945 test_xmlXPathNamespaceURIFunction(void) {
47948 #if defined(LIBXML_XPATH_ENABLED)
47950 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47952 int nargs; /* the number of arguments */
47955 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47956 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47957 mem_base = xmlMemBlocks();
47958 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47959 nargs = gen_int(n_nargs, 1);
47961 xmlXPathNamespaceURIFunction(ctxt, nargs);
47963 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47964 des_int(n_nargs, nargs, 1);
47965 xmlResetLastError();
47966 if (mem_base != xmlMemBlocks()) {
47967 printf("Leak of %d blocks found in xmlXPathNamespaceURIFunction",
47968 xmlMemBlocks() - mem_base);
47970 printf(" %d", n_ctxt);
47971 printf(" %d", n_nargs);
47984 test_xmlXPathNewBoolean(void) {
47987 #if defined(LIBXML_XPATH_ENABLED)
47989 xmlXPathObjectPtr ret_val;
47990 int val; /* the boolean value */
47993 for (n_val = 0;n_val < gen_nb_int;n_val++) {
47994 mem_base = xmlMemBlocks();
47995 val = gen_int(n_val, 0);
47997 ret_val = xmlXPathNewBoolean(val);
47998 desret_xmlXPathObjectPtr(ret_val);
48000 des_int(n_val, val, 0);
48001 xmlResetLastError();
48002 if (mem_base != xmlMemBlocks()) {
48003 printf("Leak of %d blocks found in xmlXPathNewBoolean",
48004 xmlMemBlocks() - mem_base);
48006 printf(" %d", n_val);
48018 test_xmlXPathNewCString(void) {
48021 #if defined(LIBXML_XPATH_ENABLED)
48023 xmlXPathObjectPtr ret_val;
48024 char * val; /* the char * value */
48027 for (n_val = 0;n_val < gen_nb_const_char_ptr;n_val++) {
48028 mem_base = xmlMemBlocks();
48029 val = gen_const_char_ptr(n_val, 0);
48031 ret_val = xmlXPathNewCString((const char *)val);
48032 desret_xmlXPathObjectPtr(ret_val);
48034 des_const_char_ptr(n_val, (const char *)val, 0);
48035 xmlResetLastError();
48036 if (mem_base != xmlMemBlocks()) {
48037 printf("Leak of %d blocks found in xmlXPathNewCString",
48038 xmlMemBlocks() - mem_base);
48040 printf(" %d", n_val);
48052 test_xmlXPathNewFloat(void) {
48055 #if defined(LIBXML_XPATH_ENABLED)
48057 xmlXPathObjectPtr ret_val;
48058 double val; /* the double value */
48061 for (n_val = 0;n_val < gen_nb_double;n_val++) {
48062 mem_base = xmlMemBlocks();
48063 val = gen_double(n_val, 0);
48065 ret_val = xmlXPathNewFloat(val);
48066 desret_xmlXPathObjectPtr(ret_val);
48068 des_double(n_val, val, 0);
48069 xmlResetLastError();
48070 if (mem_base != xmlMemBlocks()) {
48071 printf("Leak of %d blocks found in xmlXPathNewFloat",
48072 xmlMemBlocks() - mem_base);
48074 printf(" %d", n_val);
48086 test_xmlXPathNewNodeSet(void) {
48089 #if defined(LIBXML_XPATH_ENABLED)
48091 xmlXPathObjectPtr ret_val;
48092 xmlNodePtr val; /* the NodePtr value */
48095 for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
48096 mem_base = xmlMemBlocks();
48097 val = gen_xmlNodePtr(n_val, 0);
48099 ret_val = xmlXPathNewNodeSet(val);
48100 desret_xmlXPathObjectPtr(ret_val);
48102 des_xmlNodePtr(n_val, val, 0);
48103 xmlResetLastError();
48104 if (mem_base != xmlMemBlocks()) {
48105 printf("Leak of %d blocks found in xmlXPathNewNodeSet",
48106 xmlMemBlocks() - mem_base);
48108 printf(" %d", n_val);
48120 test_xmlXPathNewNodeSetList(void) {
48123 #if defined(LIBXML_XPATH_ENABLED)
48125 xmlXPathObjectPtr ret_val;
48126 xmlNodeSetPtr val; /* an existing NodeSet */
48129 for (n_val = 0;n_val < gen_nb_xmlNodeSetPtr;n_val++) {
48130 mem_base = xmlMemBlocks();
48131 val = gen_xmlNodeSetPtr(n_val, 0);
48133 ret_val = xmlXPathNewNodeSetList(val);
48134 desret_xmlXPathObjectPtr(ret_val);
48136 des_xmlNodeSetPtr(n_val, val, 0);
48137 xmlResetLastError();
48138 if (mem_base != xmlMemBlocks()) {
48139 printf("Leak of %d blocks found in xmlXPathNewNodeSetList",
48140 xmlMemBlocks() - mem_base);
48142 printf(" %d", n_val);
48154 test_xmlXPathNewParserContext(void) {
48158 /* missing type support */
48164 test_xmlXPathNewString(void) {
48167 #if defined(LIBXML_XPATH_ENABLED)
48169 xmlXPathObjectPtr ret_val;
48170 xmlChar * val; /* the xmlChar * value */
48173 for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
48174 mem_base = xmlMemBlocks();
48175 val = gen_const_xmlChar_ptr(n_val, 0);
48177 ret_val = xmlXPathNewString((const xmlChar *)val);
48178 desret_xmlXPathObjectPtr(ret_val);
48180 des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 0);
48181 xmlResetLastError();
48182 if (mem_base != xmlMemBlocks()) {
48183 printf("Leak of %d blocks found in xmlXPathNewString",
48184 xmlMemBlocks() - mem_base);
48186 printf(" %d", n_val);
48198 test_xmlXPathNextAncestor(void) {
48201 #if defined(LIBXML_XPATH_ENABLED)
48203 xmlNodePtr ret_val;
48204 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48206 xmlNodePtr cur; /* the current node in the traversal */
48209 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48210 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48211 mem_base = xmlMemBlocks();
48212 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48213 cur = gen_xmlNodePtr(n_cur, 1);
48215 ret_val = xmlXPathNextAncestor(ctxt, cur);
48216 desret_xmlNodePtr(ret_val);
48218 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48219 des_xmlNodePtr(n_cur, cur, 1);
48220 xmlResetLastError();
48221 if (mem_base != xmlMemBlocks()) {
48222 printf("Leak of %d blocks found in xmlXPathNextAncestor",
48223 xmlMemBlocks() - mem_base);
48225 printf(" %d", n_ctxt);
48226 printf(" %d", n_cur);
48239 test_xmlXPathNextAncestorOrSelf(void) {
48242 #if defined(LIBXML_XPATH_ENABLED)
48244 xmlNodePtr ret_val;
48245 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48247 xmlNodePtr cur; /* the current node in the traversal */
48250 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48251 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48252 mem_base = xmlMemBlocks();
48253 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48254 cur = gen_xmlNodePtr(n_cur, 1);
48256 ret_val = xmlXPathNextAncestorOrSelf(ctxt, cur);
48257 desret_xmlNodePtr(ret_val);
48259 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48260 des_xmlNodePtr(n_cur, cur, 1);
48261 xmlResetLastError();
48262 if (mem_base != xmlMemBlocks()) {
48263 printf("Leak of %d blocks found in xmlXPathNextAncestorOrSelf",
48264 xmlMemBlocks() - mem_base);
48266 printf(" %d", n_ctxt);
48267 printf(" %d", n_cur);
48280 test_xmlXPathNextAttribute(void) {
48283 #if defined(LIBXML_XPATH_ENABLED)
48285 xmlNodePtr ret_val;
48286 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48288 xmlNodePtr cur; /* the current attribute in the traversal */
48291 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48292 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48293 mem_base = xmlMemBlocks();
48294 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48295 cur = gen_xmlNodePtr(n_cur, 1);
48297 ret_val = xmlXPathNextAttribute(ctxt, cur);
48298 desret_xmlNodePtr(ret_val);
48300 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48301 des_xmlNodePtr(n_cur, cur, 1);
48302 xmlResetLastError();
48303 if (mem_base != xmlMemBlocks()) {
48304 printf("Leak of %d blocks found in xmlXPathNextAttribute",
48305 xmlMemBlocks() - mem_base);
48307 printf(" %d", n_ctxt);
48308 printf(" %d", n_cur);
48321 test_xmlXPathNextChild(void) {
48324 #if defined(LIBXML_XPATH_ENABLED)
48326 xmlNodePtr ret_val;
48327 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48329 xmlNodePtr cur; /* the current node in the traversal */
48332 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48333 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48334 mem_base = xmlMemBlocks();
48335 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48336 cur = gen_xmlNodePtr(n_cur, 1);
48338 ret_val = xmlXPathNextChild(ctxt, cur);
48339 desret_xmlNodePtr(ret_val);
48341 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48342 des_xmlNodePtr(n_cur, cur, 1);
48343 xmlResetLastError();
48344 if (mem_base != xmlMemBlocks()) {
48345 printf("Leak of %d blocks found in xmlXPathNextChild",
48346 xmlMemBlocks() - mem_base);
48348 printf(" %d", n_ctxt);
48349 printf(" %d", n_cur);
48362 test_xmlXPathNextDescendant(void) {
48365 #if defined(LIBXML_XPATH_ENABLED)
48367 xmlNodePtr ret_val;
48368 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48370 xmlNodePtr cur; /* the current node in the traversal */
48373 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48374 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48375 mem_base = xmlMemBlocks();
48376 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48377 cur = gen_xmlNodePtr(n_cur, 1);
48379 ret_val = xmlXPathNextDescendant(ctxt, cur);
48380 desret_xmlNodePtr(ret_val);
48382 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48383 des_xmlNodePtr(n_cur, cur, 1);
48384 xmlResetLastError();
48385 if (mem_base != xmlMemBlocks()) {
48386 printf("Leak of %d blocks found in xmlXPathNextDescendant",
48387 xmlMemBlocks() - mem_base);
48389 printf(" %d", n_ctxt);
48390 printf(" %d", n_cur);
48403 test_xmlXPathNextDescendantOrSelf(void) {
48406 #if defined(LIBXML_XPATH_ENABLED)
48408 xmlNodePtr ret_val;
48409 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48411 xmlNodePtr cur; /* the current node in the traversal */
48414 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48415 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48416 mem_base = xmlMemBlocks();
48417 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48418 cur = gen_xmlNodePtr(n_cur, 1);
48420 ret_val = xmlXPathNextDescendantOrSelf(ctxt, cur);
48421 desret_xmlNodePtr(ret_val);
48423 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48424 des_xmlNodePtr(n_cur, cur, 1);
48425 xmlResetLastError();
48426 if (mem_base != xmlMemBlocks()) {
48427 printf("Leak of %d blocks found in xmlXPathNextDescendantOrSelf",
48428 xmlMemBlocks() - mem_base);
48430 printf(" %d", n_ctxt);
48431 printf(" %d", n_cur);
48444 test_xmlXPathNextFollowing(void) {
48447 #if defined(LIBXML_XPATH_ENABLED)
48449 xmlNodePtr ret_val;
48450 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48452 xmlNodePtr cur; /* the current node in the traversal */
48455 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48456 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48457 mem_base = xmlMemBlocks();
48458 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48459 cur = gen_xmlNodePtr(n_cur, 1);
48461 ret_val = xmlXPathNextFollowing(ctxt, cur);
48462 desret_xmlNodePtr(ret_val);
48464 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48465 des_xmlNodePtr(n_cur, cur, 1);
48466 xmlResetLastError();
48467 if (mem_base != xmlMemBlocks()) {
48468 printf("Leak of %d blocks found in xmlXPathNextFollowing",
48469 xmlMemBlocks() - mem_base);
48471 printf(" %d", n_ctxt);
48472 printf(" %d", n_cur);
48485 test_xmlXPathNextFollowingSibling(void) {
48488 #if defined(LIBXML_XPATH_ENABLED)
48490 xmlNodePtr ret_val;
48491 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48493 xmlNodePtr cur; /* the current node in the traversal */
48496 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48497 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48498 mem_base = xmlMemBlocks();
48499 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48500 cur = gen_xmlNodePtr(n_cur, 1);
48502 ret_val = xmlXPathNextFollowingSibling(ctxt, cur);
48503 desret_xmlNodePtr(ret_val);
48505 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48506 des_xmlNodePtr(n_cur, cur, 1);
48507 xmlResetLastError();
48508 if (mem_base != xmlMemBlocks()) {
48509 printf("Leak of %d blocks found in xmlXPathNextFollowingSibling",
48510 xmlMemBlocks() - mem_base);
48512 printf(" %d", n_ctxt);
48513 printf(" %d", n_cur);
48526 test_xmlXPathNextNamespace(void) {
48529 #if defined(LIBXML_XPATH_ENABLED)
48531 xmlNodePtr ret_val;
48532 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48534 xmlNodePtr cur; /* the current attribute in the traversal */
48537 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48538 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48539 mem_base = xmlMemBlocks();
48540 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48541 cur = gen_xmlNodePtr(n_cur, 1);
48543 ret_val = xmlXPathNextNamespace(ctxt, cur);
48544 desret_xmlNodePtr(ret_val);
48546 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48547 des_xmlNodePtr(n_cur, cur, 1);
48548 xmlResetLastError();
48549 if (mem_base != xmlMemBlocks()) {
48550 printf("Leak of %d blocks found in xmlXPathNextNamespace",
48551 xmlMemBlocks() - mem_base);
48553 printf(" %d", n_ctxt);
48554 printf(" %d", n_cur);
48567 test_xmlXPathNextParent(void) {
48570 #if defined(LIBXML_XPATH_ENABLED)
48572 xmlNodePtr ret_val;
48573 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48575 xmlNodePtr cur; /* the current node in the traversal */
48578 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48579 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48580 mem_base = xmlMemBlocks();
48581 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48582 cur = gen_xmlNodePtr(n_cur, 1);
48584 ret_val = xmlXPathNextParent(ctxt, cur);
48585 desret_xmlNodePtr(ret_val);
48587 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48588 des_xmlNodePtr(n_cur, cur, 1);
48589 xmlResetLastError();
48590 if (mem_base != xmlMemBlocks()) {
48591 printf("Leak of %d blocks found in xmlXPathNextParent",
48592 xmlMemBlocks() - mem_base);
48594 printf(" %d", n_ctxt);
48595 printf(" %d", n_cur);
48608 test_xmlXPathNextPreceding(void) {
48611 #if defined(LIBXML_XPATH_ENABLED)
48613 xmlNodePtr ret_val;
48614 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48616 xmlNodePtr cur; /* the current node in the traversal */
48619 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48620 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48621 mem_base = xmlMemBlocks();
48622 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48623 cur = gen_xmlNodePtr(n_cur, 1);
48625 ret_val = xmlXPathNextPreceding(ctxt, cur);
48626 desret_xmlNodePtr(ret_val);
48628 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48629 des_xmlNodePtr(n_cur, cur, 1);
48630 xmlResetLastError();
48631 if (mem_base != xmlMemBlocks()) {
48632 printf("Leak of %d blocks found in xmlXPathNextPreceding",
48633 xmlMemBlocks() - mem_base);
48635 printf(" %d", n_ctxt);
48636 printf(" %d", n_cur);
48649 test_xmlXPathNextPrecedingSibling(void) {
48652 #if defined(LIBXML_XPATH_ENABLED)
48654 xmlNodePtr ret_val;
48655 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48657 xmlNodePtr cur; /* the current node in the traversal */
48660 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48661 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48662 mem_base = xmlMemBlocks();
48663 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48664 cur = gen_xmlNodePtr(n_cur, 1);
48666 ret_val = xmlXPathNextPrecedingSibling(ctxt, cur);
48667 desret_xmlNodePtr(ret_val);
48669 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48670 des_xmlNodePtr(n_cur, cur, 1);
48671 xmlResetLastError();
48672 if (mem_base != xmlMemBlocks()) {
48673 printf("Leak of %d blocks found in xmlXPathNextPrecedingSibling",
48674 xmlMemBlocks() - mem_base);
48676 printf(" %d", n_ctxt);
48677 printf(" %d", n_cur);
48690 test_xmlXPathNextSelf(void) {
48693 #if defined(LIBXML_XPATH_ENABLED)
48695 xmlNodePtr ret_val;
48696 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48698 xmlNodePtr cur; /* the current node in the traversal */
48701 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48702 for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48703 mem_base = xmlMemBlocks();
48704 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48705 cur = gen_xmlNodePtr(n_cur, 1);
48707 ret_val = xmlXPathNextSelf(ctxt, cur);
48708 desret_xmlNodePtr(ret_val);
48710 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48711 des_xmlNodePtr(n_cur, cur, 1);
48712 xmlResetLastError();
48713 if (mem_base != xmlMemBlocks()) {
48714 printf("Leak of %d blocks found in xmlXPathNextSelf",
48715 xmlMemBlocks() - mem_base);
48717 printf(" %d", n_ctxt);
48718 printf(" %d", n_cur);
48731 test_xmlXPathNodeLeading(void) {
48734 #if defined(LIBXML_XPATH_ENABLED)
48736 xmlNodeSetPtr ret_val;
48737 xmlNodeSetPtr nodes; /* a node-set */
48739 xmlNodePtr node; /* a node */
48742 for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
48743 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
48744 mem_base = xmlMemBlocks();
48745 nodes = gen_xmlNodeSetPtr(n_nodes, 0);
48746 node = gen_xmlNodePtr(n_node, 1);
48748 ret_val = xmlXPathNodeLeading(nodes, node);
48749 desret_xmlNodeSetPtr(ret_val);
48751 des_xmlNodeSetPtr(n_nodes, nodes, 0);
48752 des_xmlNodePtr(n_node, node, 1);
48753 xmlResetLastError();
48754 if (mem_base != xmlMemBlocks()) {
48755 printf("Leak of %d blocks found in xmlXPathNodeLeading",
48756 xmlMemBlocks() - mem_base);
48758 printf(" %d", n_nodes);
48759 printf(" %d", n_node);
48772 test_xmlXPathNodeLeadingSorted(void) {
48775 #if defined(LIBXML_XPATH_ENABLED)
48777 xmlNodeSetPtr ret_val;
48778 xmlNodeSetPtr nodes; /* a node-set, sorted by document order */
48780 xmlNodePtr node; /* a node */
48783 for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
48784 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
48785 mem_base = xmlMemBlocks();
48786 nodes = gen_xmlNodeSetPtr(n_nodes, 0);
48787 node = gen_xmlNodePtr(n_node, 1);
48789 ret_val = xmlXPathNodeLeadingSorted(nodes, node);
48790 desret_xmlNodeSetPtr(ret_val);
48792 des_xmlNodeSetPtr(n_nodes, nodes, 0);
48793 des_xmlNodePtr(n_node, node, 1);
48794 xmlResetLastError();
48795 if (mem_base != xmlMemBlocks()) {
48796 printf("Leak of %d blocks found in xmlXPathNodeLeadingSorted",
48797 xmlMemBlocks() - mem_base);
48799 printf(" %d", n_nodes);
48800 printf(" %d", n_node);
48813 test_xmlXPathNodeSetAdd(void) {
48816 #if defined(LIBXML_XPATH_ENABLED)
48818 xmlNodeSetPtr cur; /* the initial node set */
48820 xmlNodePtr val; /* a new xmlNodePtr */
48823 for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
48824 for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
48825 mem_base = xmlMemBlocks();
48826 cur = gen_xmlNodeSetPtr(n_cur, 0);
48827 val = gen_xmlNodePtr(n_val, 1);
48829 xmlXPathNodeSetAdd(cur, val);
48831 des_xmlNodeSetPtr(n_cur, cur, 0);
48832 des_xmlNodePtr(n_val, val, 1);
48833 xmlResetLastError();
48834 if (mem_base != xmlMemBlocks()) {
48835 printf("Leak of %d blocks found in xmlXPathNodeSetAdd",
48836 xmlMemBlocks() - mem_base);
48838 printf(" %d", n_cur);
48839 printf(" %d", n_val);
48852 test_xmlXPathNodeSetAddNs(void) {
48855 #if defined(LIBXML_XPATH_ENABLED)
48857 xmlNodeSetPtr cur; /* the initial node set */
48859 xmlNodePtr node; /* the hosting node */
48861 xmlNsPtr ns; /* a the namespace node */
48864 for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
48865 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
48866 for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
48867 mem_base = xmlMemBlocks();
48868 cur = gen_xmlNodeSetPtr(n_cur, 0);
48869 node = gen_xmlNodePtr(n_node, 1);
48870 ns = gen_xmlNsPtr(n_ns, 2);
48872 xmlXPathNodeSetAddNs(cur, node, ns);
48874 des_xmlNodeSetPtr(n_cur, cur, 0);
48875 des_xmlNodePtr(n_node, node, 1);
48876 des_xmlNsPtr(n_ns, ns, 2);
48877 xmlResetLastError();
48878 if (mem_base != xmlMemBlocks()) {
48879 printf("Leak of %d blocks found in xmlXPathNodeSetAddNs",
48880 xmlMemBlocks() - mem_base);
48882 printf(" %d", n_cur);
48883 printf(" %d", n_node);
48884 printf(" %d", n_ns);
48898 test_xmlXPathNodeSetAddUnique(void) {
48901 #if defined(LIBXML_XPATH_ENABLED)
48903 xmlNodeSetPtr cur; /* the initial node set */
48905 xmlNodePtr val; /* a new xmlNodePtr */
48908 for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
48909 for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
48910 mem_base = xmlMemBlocks();
48911 cur = gen_xmlNodeSetPtr(n_cur, 0);
48912 val = gen_xmlNodePtr(n_val, 1);
48914 xmlXPathNodeSetAddUnique(cur, val);
48916 des_xmlNodeSetPtr(n_cur, cur, 0);
48917 des_xmlNodePtr(n_val, val, 1);
48918 xmlResetLastError();
48919 if (mem_base != xmlMemBlocks()) {
48920 printf("Leak of %d blocks found in xmlXPathNodeSetAddUnique",
48921 xmlMemBlocks() - mem_base);
48923 printf(" %d", n_cur);
48924 printf(" %d", n_val);
48937 test_xmlXPathNodeSetContains(void) {
48940 #if defined(LIBXML_XPATH_ENABLED)
48943 xmlNodeSetPtr cur; /* the node-set */
48945 xmlNodePtr val; /* the node */
48948 for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
48949 for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
48950 mem_base = xmlMemBlocks();
48951 cur = gen_xmlNodeSetPtr(n_cur, 0);
48952 val = gen_xmlNodePtr(n_val, 1);
48954 ret_val = xmlXPathNodeSetContains(cur, val);
48955 desret_int(ret_val);
48957 des_xmlNodeSetPtr(n_cur, cur, 0);
48958 des_xmlNodePtr(n_val, val, 1);
48959 xmlResetLastError();
48960 if (mem_base != xmlMemBlocks()) {
48961 printf("Leak of %d blocks found in xmlXPathNodeSetContains",
48962 xmlMemBlocks() - mem_base);
48964 printf(" %d", n_cur);
48965 printf(" %d", n_val);
48978 test_xmlXPathNodeSetDel(void) {
48981 #if defined(LIBXML_XPATH_ENABLED)
48983 xmlNodeSetPtr cur; /* the initial node set */
48985 xmlNodePtr val; /* an xmlNodePtr */
48988 for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
48989 for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
48990 mem_base = xmlMemBlocks();
48991 cur = gen_xmlNodeSetPtr(n_cur, 0);
48992 val = gen_xmlNodePtr(n_val, 1);
48994 xmlXPathNodeSetDel(cur, val);
48996 des_xmlNodeSetPtr(n_cur, cur, 0);
48997 des_xmlNodePtr(n_val, val, 1);
48998 xmlResetLastError();
48999 if (mem_base != xmlMemBlocks()) {
49000 printf("Leak of %d blocks found in xmlXPathNodeSetDel",
49001 xmlMemBlocks() - mem_base);
49003 printf(" %d", n_cur);
49004 printf(" %d", n_val);
49017 test_xmlXPathNodeSetMerge(void) {
49020 #if defined(LIBXML_XPATH_ENABLED)
49022 xmlNodeSetPtr ret_val;
49023 xmlNodeSetPtr val1; /* the first NodeSet or NULL */
49025 xmlNodeSetPtr val2; /* the second NodeSet */
49028 for (n_val1 = 0;n_val1 < gen_nb_xmlNodeSetPtr;n_val1++) {
49029 for (n_val2 = 0;n_val2 < gen_nb_xmlNodeSetPtr;n_val2++) {
49030 mem_base = xmlMemBlocks();
49031 val1 = gen_xmlNodeSetPtr(n_val1, 0);
49032 val2 = gen_xmlNodeSetPtr(n_val2, 1);
49034 ret_val = xmlXPathNodeSetMerge(val1, val2);
49035 desret_xmlNodeSetPtr(ret_val);
49037 des_xmlNodeSetPtr(n_val1, val1, 0);
49038 des_xmlNodeSetPtr(n_val2, val2, 1);
49039 xmlResetLastError();
49040 if (mem_base != xmlMemBlocks()) {
49041 printf("Leak of %d blocks found in xmlXPathNodeSetMerge",
49042 xmlMemBlocks() - mem_base);
49044 printf(" %d", n_val1);
49045 printf(" %d", n_val2);
49058 test_xmlXPathNodeSetRemove(void) {
49061 #if defined(LIBXML_XPATH_ENABLED)
49063 xmlNodeSetPtr cur; /* the initial node set */
49065 int val; /* the index to remove */
49068 for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
49069 for (n_val = 0;n_val < gen_nb_int;n_val++) {
49070 mem_base = xmlMemBlocks();
49071 cur = gen_xmlNodeSetPtr(n_cur, 0);
49072 val = gen_int(n_val, 1);
49074 xmlXPathNodeSetRemove(cur, val);
49076 des_xmlNodeSetPtr(n_cur, cur, 0);
49077 des_int(n_val, val, 1);
49078 xmlResetLastError();
49079 if (mem_base != xmlMemBlocks()) {
49080 printf("Leak of %d blocks found in xmlXPathNodeSetRemove",
49081 xmlMemBlocks() - mem_base);
49083 printf(" %d", n_cur);
49084 printf(" %d", n_val);
49097 test_xmlXPathNodeSetSort(void) {
49100 #if defined(LIBXML_XPATH_ENABLED)
49102 xmlNodeSetPtr set; /* the node set */
49105 for (n_set = 0;n_set < gen_nb_xmlNodeSetPtr;n_set++) {
49106 mem_base = xmlMemBlocks();
49107 set = gen_xmlNodeSetPtr(n_set, 0);
49109 xmlXPathNodeSetSort(set);
49111 des_xmlNodeSetPtr(n_set, set, 0);
49112 xmlResetLastError();
49113 if (mem_base != xmlMemBlocks()) {
49114 printf("Leak of %d blocks found in xmlXPathNodeSetSort",
49115 xmlMemBlocks() - mem_base);
49117 printf(" %d", n_set);
49129 test_xmlXPathNodeTrailing(void) {
49132 #if defined(LIBXML_XPATH_ENABLED)
49134 xmlNodeSetPtr ret_val;
49135 xmlNodeSetPtr nodes; /* a node-set */
49137 xmlNodePtr node; /* a node */
49140 for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
49141 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
49142 mem_base = xmlMemBlocks();
49143 nodes = gen_xmlNodeSetPtr(n_nodes, 0);
49144 node = gen_xmlNodePtr(n_node, 1);
49146 ret_val = xmlXPathNodeTrailing(nodes, node);
49147 desret_xmlNodeSetPtr(ret_val);
49149 des_xmlNodeSetPtr(n_nodes, nodes, 0);
49150 des_xmlNodePtr(n_node, node, 1);
49151 xmlResetLastError();
49152 if (mem_base != xmlMemBlocks()) {
49153 printf("Leak of %d blocks found in xmlXPathNodeTrailing",
49154 xmlMemBlocks() - mem_base);
49156 printf(" %d", n_nodes);
49157 printf(" %d", n_node);
49170 test_xmlXPathNodeTrailingSorted(void) {
49173 #if defined(LIBXML_XPATH_ENABLED)
49175 xmlNodeSetPtr ret_val;
49176 xmlNodeSetPtr nodes; /* a node-set, sorted by document order */
49178 xmlNodePtr node; /* a node */
49181 for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
49182 for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
49183 mem_base = xmlMemBlocks();
49184 nodes = gen_xmlNodeSetPtr(n_nodes, 0);
49185 node = gen_xmlNodePtr(n_node, 1);
49187 ret_val = xmlXPathNodeTrailingSorted(nodes, node);
49188 desret_xmlNodeSetPtr(ret_val);
49190 des_xmlNodeSetPtr(n_nodes, nodes, 0);
49191 des_xmlNodePtr(n_node, node, 1);
49192 xmlResetLastError();
49193 if (mem_base != xmlMemBlocks()) {
49194 printf("Leak of %d blocks found in xmlXPathNodeTrailingSorted",
49195 xmlMemBlocks() - mem_base);
49197 printf(" %d", n_nodes);
49198 printf(" %d", n_node);
49211 test_xmlXPathNormalizeFunction(void) {
49214 #if defined(LIBXML_XPATH_ENABLED)
49216 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49218 int nargs; /* the number of arguments */
49221 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49222 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49223 mem_base = xmlMemBlocks();
49224 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49225 nargs = gen_int(n_nargs, 1);
49227 xmlXPathNormalizeFunction(ctxt, nargs);
49229 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49230 des_int(n_nargs, nargs, 1);
49231 xmlResetLastError();
49232 if (mem_base != xmlMemBlocks()) {
49233 printf("Leak of %d blocks found in xmlXPathNormalizeFunction",
49234 xmlMemBlocks() - mem_base);
49236 printf(" %d", n_ctxt);
49237 printf(" %d", n_nargs);
49250 test_xmlXPathNotEqualValues(void) {
49253 #if defined(LIBXML_XPATH_ENABLED)
49256 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49259 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49260 mem_base = xmlMemBlocks();
49261 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49263 ret_val = xmlXPathNotEqualValues(ctxt);
49264 desret_int(ret_val);
49266 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49267 xmlResetLastError();
49268 if (mem_base != xmlMemBlocks()) {
49269 printf("Leak of %d blocks found in xmlXPathNotEqualValues",
49270 xmlMemBlocks() - mem_base);
49272 printf(" %d", n_ctxt);
49284 test_xmlXPathNotFunction(void) {
49287 #if defined(LIBXML_XPATH_ENABLED)
49289 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49291 int nargs; /* the number of arguments */
49294 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49295 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49296 mem_base = xmlMemBlocks();
49297 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49298 nargs = gen_int(n_nargs, 1);
49300 xmlXPathNotFunction(ctxt, nargs);
49302 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49303 des_int(n_nargs, nargs, 1);
49304 xmlResetLastError();
49305 if (mem_base != xmlMemBlocks()) {
49306 printf("Leak of %d blocks found in xmlXPathNotFunction",
49307 xmlMemBlocks() - mem_base);
49309 printf(" %d", n_ctxt);
49310 printf(" %d", n_nargs);
49323 test_xmlXPathNsLookup(void) {
49326 #if defined(LIBXML_XPATH_ENABLED)
49328 const xmlChar * ret_val;
49329 xmlXPathContextPtr ctxt; /* the XPath context */
49331 xmlChar * prefix; /* the namespace prefix value */
49334 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
49335 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
49336 mem_base = xmlMemBlocks();
49337 ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
49338 prefix = gen_const_xmlChar_ptr(n_prefix, 1);
49340 ret_val = xmlXPathNsLookup(ctxt, (const xmlChar *)prefix);
49341 desret_const_xmlChar_ptr(ret_val);
49343 des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
49344 des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
49345 xmlResetLastError();
49346 if (mem_base != xmlMemBlocks()) {
49347 printf("Leak of %d blocks found in xmlXPathNsLookup",
49348 xmlMemBlocks() - mem_base);
49350 printf(" %d", n_ctxt);
49351 printf(" %d", n_prefix);
49364 test_xmlXPathNumberFunction(void) {
49367 #if defined(LIBXML_XPATH_ENABLED)
49369 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49371 int nargs; /* the number of arguments */
49374 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49375 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49376 mem_base = xmlMemBlocks();
49377 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49378 nargs = gen_int(n_nargs, 1);
49380 xmlXPathNumberFunction(ctxt, nargs);
49382 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49383 des_int(n_nargs, nargs, 1);
49384 xmlResetLastError();
49385 if (mem_base != xmlMemBlocks()) {
49386 printf("Leak of %d blocks found in xmlXPathNumberFunction",
49387 xmlMemBlocks() - mem_base);
49389 printf(" %d", n_ctxt);
49390 printf(" %d", n_nargs);
49403 test_xmlXPathParseNCName(void) {
49406 #if defined(LIBXML_XPATH_ENABLED)
49409 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49412 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49413 mem_base = xmlMemBlocks();
49414 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49416 ret_val = xmlXPathParseNCName(ctxt);
49417 desret_xmlChar_ptr(ret_val);
49419 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49420 xmlResetLastError();
49421 if (mem_base != xmlMemBlocks()) {
49422 printf("Leak of %d blocks found in xmlXPathParseNCName",
49423 xmlMemBlocks() - mem_base);
49425 printf(" %d", n_ctxt);
49437 test_xmlXPathParseName(void) {
49440 #if defined(LIBXML_XPATH_ENABLED)
49443 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49446 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49447 mem_base = xmlMemBlocks();
49448 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49450 ret_val = xmlXPathParseName(ctxt);
49451 desret_xmlChar_ptr(ret_val);
49453 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49454 xmlResetLastError();
49455 if (mem_base != xmlMemBlocks()) {
49456 printf("Leak of %d blocks found in xmlXPathParseName",
49457 xmlMemBlocks() - mem_base);
49459 printf(" %d", n_ctxt);
49471 test_xmlXPathPopBoolean(void) {
49474 #if defined(LIBXML_XPATH_ENABLED)
49477 xmlXPathParserContextPtr ctxt; /* an XPath parser context */
49480 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49481 mem_base = xmlMemBlocks();
49482 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49484 ret_val = xmlXPathPopBoolean(ctxt);
49485 desret_int(ret_val);
49487 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49488 xmlResetLastError();
49489 if (mem_base != xmlMemBlocks()) {
49490 printf("Leak of %d blocks found in xmlXPathPopBoolean",
49491 xmlMemBlocks() - mem_base);
49493 printf(" %d", n_ctxt);
49505 test_xmlXPathPopExternal(void) {
49508 #if defined(LIBXML_XPATH_ENABLED)
49511 xmlXPathParserContextPtr ctxt; /* an XPath parser context */
49514 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49515 mem_base = xmlMemBlocks();
49516 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49518 ret_val = xmlXPathPopExternal(ctxt);
49519 desret_void_ptr(ret_val);
49521 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49522 xmlResetLastError();
49523 if (mem_base != xmlMemBlocks()) {
49524 printf("Leak of %d blocks found in xmlXPathPopExternal",
49525 xmlMemBlocks() - mem_base);
49527 printf(" %d", n_ctxt);
49539 test_xmlXPathPopNodeSet(void) {
49542 #if defined(LIBXML_XPATH_ENABLED)
49544 xmlNodeSetPtr ret_val;
49545 xmlXPathParserContextPtr ctxt; /* an XPath parser context */
49548 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49549 mem_base = xmlMemBlocks();
49550 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49552 ret_val = xmlXPathPopNodeSet(ctxt);
49553 desret_xmlNodeSetPtr(ret_val);
49555 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49556 xmlResetLastError();
49557 if (mem_base != xmlMemBlocks()) {
49558 printf("Leak of %d blocks found in xmlXPathPopNodeSet",
49559 xmlMemBlocks() - mem_base);
49561 printf(" %d", n_ctxt);
49573 test_xmlXPathPopNumber(void) {
49576 #if defined(LIBXML_XPATH_ENABLED)
49579 xmlXPathParserContextPtr ctxt; /* an XPath parser context */
49582 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49583 mem_base = xmlMemBlocks();
49584 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49586 ret_val = xmlXPathPopNumber(ctxt);
49587 desret_double(ret_val);
49589 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49590 xmlResetLastError();
49591 if (mem_base != xmlMemBlocks()) {
49592 printf("Leak of %d blocks found in xmlXPathPopNumber",
49593 xmlMemBlocks() - mem_base);
49595 printf(" %d", n_ctxt);
49607 test_xmlXPathPopString(void) {
49610 #if defined(LIBXML_XPATH_ENABLED)
49613 xmlXPathParserContextPtr ctxt; /* an XPath parser context */
49616 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49617 mem_base = xmlMemBlocks();
49618 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49620 ret_val = xmlXPathPopString(ctxt);
49621 desret_xmlChar_ptr(ret_val);
49623 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49624 xmlResetLastError();
49625 if (mem_base != xmlMemBlocks()) {
49626 printf("Leak of %d blocks found in xmlXPathPopString",
49627 xmlMemBlocks() - mem_base);
49629 printf(" %d", n_ctxt);
49641 test_xmlXPathPositionFunction(void) {
49644 #if defined(LIBXML_XPATH_ENABLED)
49646 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49648 int nargs; /* the number of arguments */
49651 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49652 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49653 mem_base = xmlMemBlocks();
49654 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49655 nargs = gen_int(n_nargs, 1);
49657 xmlXPathPositionFunction(ctxt, nargs);
49659 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49660 des_int(n_nargs, nargs, 1);
49661 xmlResetLastError();
49662 if (mem_base != xmlMemBlocks()) {
49663 printf("Leak of %d blocks found in xmlXPathPositionFunction",
49664 xmlMemBlocks() - mem_base);
49666 printf(" %d", n_ctxt);
49667 printf(" %d", n_nargs);
49680 test_xmlXPathRegisterAllFunctions(void) {
49683 #if defined(LIBXML_XPATH_ENABLED)
49685 xmlXPathContextPtr ctxt; /* the XPath context */
49688 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
49689 mem_base = xmlMemBlocks();
49690 ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
49692 xmlXPathRegisterAllFunctions(ctxt);
49694 des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
49695 xmlResetLastError();
49696 if (mem_base != xmlMemBlocks()) {
49697 printf("Leak of %d blocks found in xmlXPathRegisterAllFunctions",
49698 xmlMemBlocks() - mem_base);
49700 printf(" %d", n_ctxt);
49712 test_xmlXPathRegisterFunc(void) {
49716 /* missing type support */
49722 test_xmlXPathRegisterFuncLookup(void) {
49726 /* missing type support */
49732 test_xmlXPathRegisterFuncNS(void) {
49736 /* missing type support */
49742 test_xmlXPathRegisterNs(void) {
49745 #if defined(LIBXML_XPATH_ENABLED)
49748 xmlXPathContextPtr ctxt; /* the XPath context */
49750 xmlChar * prefix; /* the namespace prefix cannot be NULL or empty string */
49752 xmlChar * ns_uri; /* the namespace name */
49755 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
49756 for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
49757 for (n_ns_uri = 0;n_ns_uri < gen_nb_const_xmlChar_ptr;n_ns_uri++) {
49758 mem_base = xmlMemBlocks();
49759 ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
49760 prefix = gen_const_xmlChar_ptr(n_prefix, 1);
49761 ns_uri = gen_const_xmlChar_ptr(n_ns_uri, 2);
49763 ret_val = xmlXPathRegisterNs(ctxt, (const xmlChar *)prefix, (const xmlChar *)ns_uri);
49764 desret_int(ret_val);
49766 des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
49767 des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
49768 des_const_xmlChar_ptr(n_ns_uri, (const xmlChar *)ns_uri, 2);
49769 xmlResetLastError();
49770 if (mem_base != xmlMemBlocks()) {
49771 printf("Leak of %d blocks found in xmlXPathRegisterNs",
49772 xmlMemBlocks() - mem_base);
49774 printf(" %d", n_ctxt);
49775 printf(" %d", n_prefix);
49776 printf(" %d", n_ns_uri);
49790 test_xmlXPathRegisterVariable(void) {
49793 #if defined(LIBXML_XPATH_ENABLED)
49796 xmlXPathContextPtr ctxt; /* the XPath context */
49798 xmlChar * name; /* the variable name */
49800 xmlXPathObjectPtr value; /* the variable value or NULL */
49803 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
49804 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
49805 for (n_value = 0;n_value < gen_nb_xmlXPathObjectPtr;n_value++) {
49806 mem_base = xmlMemBlocks();
49807 ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
49808 name = gen_const_xmlChar_ptr(n_name, 1);
49809 value = gen_xmlXPathObjectPtr(n_value, 2);
49811 ret_val = xmlXPathRegisterVariable(ctxt, (const xmlChar *)name, value);
49812 desret_int(ret_val);
49814 des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
49815 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
49816 des_xmlXPathObjectPtr(n_value, value, 2);
49817 xmlResetLastError();
49818 if (mem_base != xmlMemBlocks()) {
49819 printf("Leak of %d blocks found in xmlXPathRegisterVariable",
49820 xmlMemBlocks() - mem_base);
49822 printf(" %d", n_ctxt);
49823 printf(" %d", n_name);
49824 printf(" %d", n_value);
49838 test_xmlXPathRegisterVariableLookup(void) {
49842 /* missing type support */
49848 test_xmlXPathRegisterVariableNS(void) {
49851 #if defined(LIBXML_XPATH_ENABLED)
49854 xmlXPathContextPtr ctxt; /* the XPath context */
49856 xmlChar * name; /* the variable name */
49858 xmlChar * ns_uri; /* the variable namespace URI */
49860 xmlXPathObjectPtr value; /* the variable value or NULL */
49863 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
49864 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
49865 for (n_ns_uri = 0;n_ns_uri < gen_nb_const_xmlChar_ptr;n_ns_uri++) {
49866 for (n_value = 0;n_value < gen_nb_xmlXPathObjectPtr;n_value++) {
49867 mem_base = xmlMemBlocks();
49868 ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
49869 name = gen_const_xmlChar_ptr(n_name, 1);
49870 ns_uri = gen_const_xmlChar_ptr(n_ns_uri, 2);
49871 value = gen_xmlXPathObjectPtr(n_value, 3);
49873 ret_val = xmlXPathRegisterVariableNS(ctxt, (const xmlChar *)name, (const xmlChar *)ns_uri, value);
49874 desret_int(ret_val);
49876 des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
49877 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
49878 des_const_xmlChar_ptr(n_ns_uri, (const xmlChar *)ns_uri, 2);
49879 des_xmlXPathObjectPtr(n_value, value, 3);
49880 xmlResetLastError();
49881 if (mem_base != xmlMemBlocks()) {
49882 printf("Leak of %d blocks found in xmlXPathRegisterVariableNS",
49883 xmlMemBlocks() - mem_base);
49885 printf(" %d", n_ctxt);
49886 printf(" %d", n_name);
49887 printf(" %d", n_ns_uri);
49888 printf(" %d", n_value);
49903 test_xmlXPathRegisteredFuncsCleanup(void) {
49906 #if defined(LIBXML_XPATH_ENABLED)
49908 xmlXPathContextPtr ctxt; /* the XPath context */
49911 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
49912 mem_base = xmlMemBlocks();
49913 ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
49915 xmlXPathRegisteredFuncsCleanup(ctxt);
49917 des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
49918 xmlResetLastError();
49919 if (mem_base != xmlMemBlocks()) {
49920 printf("Leak of %d blocks found in xmlXPathRegisteredFuncsCleanup",
49921 xmlMemBlocks() - mem_base);
49923 printf(" %d", n_ctxt);
49935 test_xmlXPathRegisteredNsCleanup(void) {
49938 #if defined(LIBXML_XPATH_ENABLED)
49940 xmlXPathContextPtr ctxt; /* the XPath context */
49943 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
49944 mem_base = xmlMemBlocks();
49945 ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
49947 xmlXPathRegisteredNsCleanup(ctxt);
49949 des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
49950 xmlResetLastError();
49951 if (mem_base != xmlMemBlocks()) {
49952 printf("Leak of %d blocks found in xmlXPathRegisteredNsCleanup",
49953 xmlMemBlocks() - mem_base);
49955 printf(" %d", n_ctxt);
49967 test_xmlXPathRegisteredVariablesCleanup(void) {
49970 #if defined(LIBXML_XPATH_ENABLED)
49972 xmlXPathContextPtr ctxt; /* the XPath context */
49975 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
49976 mem_base = xmlMemBlocks();
49977 ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
49979 xmlXPathRegisteredVariablesCleanup(ctxt);
49981 des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
49982 xmlResetLastError();
49983 if (mem_base != xmlMemBlocks()) {
49984 printf("Leak of %d blocks found in xmlXPathRegisteredVariablesCleanup",
49985 xmlMemBlocks() - mem_base);
49987 printf(" %d", n_ctxt);
49999 test_xmlXPathRoot(void) {
50002 #if defined(LIBXML_XPATH_ENABLED)
50004 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50007 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50008 mem_base = xmlMemBlocks();
50009 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50011 xmlXPathRoot(ctxt);
50013 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50014 xmlResetLastError();
50015 if (mem_base != xmlMemBlocks()) {
50016 printf("Leak of %d blocks found in xmlXPathRoot",
50017 xmlMemBlocks() - mem_base);
50019 printf(" %d", n_ctxt);
50031 test_xmlXPathRoundFunction(void) {
50034 #if defined(LIBXML_XPATH_ENABLED)
50036 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50038 int nargs; /* the number of arguments */
50041 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50042 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50043 mem_base = xmlMemBlocks();
50044 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50045 nargs = gen_int(n_nargs, 1);
50047 xmlXPathRoundFunction(ctxt, nargs);
50049 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50050 des_int(n_nargs, nargs, 1);
50051 xmlResetLastError();
50052 if (mem_base != xmlMemBlocks()) {
50053 printf("Leak of %d blocks found in xmlXPathRoundFunction",
50054 xmlMemBlocks() - mem_base);
50056 printf(" %d", n_ctxt);
50057 printf(" %d", n_nargs);
50070 test_xmlXPathStartsWithFunction(void) {
50073 #if defined(LIBXML_XPATH_ENABLED)
50075 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50077 int nargs; /* the number of arguments */
50080 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50081 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50082 mem_base = xmlMemBlocks();
50083 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50084 nargs = gen_int(n_nargs, 1);
50086 xmlXPathStartsWithFunction(ctxt, nargs);
50088 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50089 des_int(n_nargs, nargs, 1);
50090 xmlResetLastError();
50091 if (mem_base != xmlMemBlocks()) {
50092 printf("Leak of %d blocks found in xmlXPathStartsWithFunction",
50093 xmlMemBlocks() - mem_base);
50095 printf(" %d", n_ctxt);
50096 printf(" %d", n_nargs);
50109 test_xmlXPathStringEvalNumber(void) {
50112 #if defined(LIBXML_XPATH_ENABLED)
50115 xmlChar * str; /* A string to scan */
50118 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
50119 mem_base = xmlMemBlocks();
50120 str = gen_const_xmlChar_ptr(n_str, 0);
50122 ret_val = xmlXPathStringEvalNumber((const xmlChar *)str);
50123 desret_double(ret_val);
50125 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
50126 xmlResetLastError();
50127 if (mem_base != xmlMemBlocks()) {
50128 printf("Leak of %d blocks found in xmlXPathStringEvalNumber",
50129 xmlMemBlocks() - mem_base);
50131 printf(" %d", n_str);
50143 test_xmlXPathStringFunction(void) {
50146 #if defined(LIBXML_XPATH_ENABLED)
50148 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50150 int nargs; /* the number of arguments */
50153 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50154 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50155 mem_base = xmlMemBlocks();
50156 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50157 nargs = gen_int(n_nargs, 1);
50159 xmlXPathStringFunction(ctxt, nargs);
50161 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50162 des_int(n_nargs, nargs, 1);
50163 xmlResetLastError();
50164 if (mem_base != xmlMemBlocks()) {
50165 printf("Leak of %d blocks found in xmlXPathStringFunction",
50166 xmlMemBlocks() - mem_base);
50168 printf(" %d", n_ctxt);
50169 printf(" %d", n_nargs);
50182 test_xmlXPathStringLengthFunction(void) {
50185 #if defined(LIBXML_XPATH_ENABLED)
50187 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50189 int nargs; /* the number of arguments */
50192 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50193 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50194 mem_base = xmlMemBlocks();
50195 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50196 nargs = gen_int(n_nargs, 1);
50198 xmlXPathStringLengthFunction(ctxt, nargs);
50200 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50201 des_int(n_nargs, nargs, 1);
50202 xmlResetLastError();
50203 if (mem_base != xmlMemBlocks()) {
50204 printf("Leak of %d blocks found in xmlXPathStringLengthFunction",
50205 xmlMemBlocks() - mem_base);
50207 printf(" %d", n_ctxt);
50208 printf(" %d", n_nargs);
50221 test_xmlXPathSubValues(void) {
50224 #if defined(LIBXML_XPATH_ENABLED)
50226 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50229 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50230 mem_base = xmlMemBlocks();
50231 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50233 xmlXPathSubValues(ctxt);
50235 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50236 xmlResetLastError();
50237 if (mem_base != xmlMemBlocks()) {
50238 printf("Leak of %d blocks found in xmlXPathSubValues",
50239 xmlMemBlocks() - mem_base);
50241 printf(" %d", n_ctxt);
50253 test_xmlXPathSubstringAfterFunction(void) {
50256 #if defined(LIBXML_XPATH_ENABLED)
50258 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50260 int nargs; /* the number of arguments */
50263 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50264 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50265 mem_base = xmlMemBlocks();
50266 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50267 nargs = gen_int(n_nargs, 1);
50269 xmlXPathSubstringAfterFunction(ctxt, nargs);
50271 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50272 des_int(n_nargs, nargs, 1);
50273 xmlResetLastError();
50274 if (mem_base != xmlMemBlocks()) {
50275 printf("Leak of %d blocks found in xmlXPathSubstringAfterFunction",
50276 xmlMemBlocks() - mem_base);
50278 printf(" %d", n_ctxt);
50279 printf(" %d", n_nargs);
50292 test_xmlXPathSubstringBeforeFunction(void) {
50295 #if defined(LIBXML_XPATH_ENABLED)
50297 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50299 int nargs; /* the number of arguments */
50302 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50303 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50304 mem_base = xmlMemBlocks();
50305 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50306 nargs = gen_int(n_nargs, 1);
50308 xmlXPathSubstringBeforeFunction(ctxt, nargs);
50310 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50311 des_int(n_nargs, nargs, 1);
50312 xmlResetLastError();
50313 if (mem_base != xmlMemBlocks()) {
50314 printf("Leak of %d blocks found in xmlXPathSubstringBeforeFunction",
50315 xmlMemBlocks() - mem_base);
50317 printf(" %d", n_ctxt);
50318 printf(" %d", n_nargs);
50331 test_xmlXPathSubstringFunction(void) {
50334 #if defined(LIBXML_XPATH_ENABLED)
50336 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50338 int nargs; /* the number of arguments */
50341 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50342 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50343 mem_base = xmlMemBlocks();
50344 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50345 nargs = gen_int(n_nargs, 1);
50347 xmlXPathSubstringFunction(ctxt, nargs);
50349 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50350 des_int(n_nargs, nargs, 1);
50351 xmlResetLastError();
50352 if (mem_base != xmlMemBlocks()) {
50353 printf("Leak of %d blocks found in xmlXPathSubstringFunction",
50354 xmlMemBlocks() - mem_base);
50356 printf(" %d", n_ctxt);
50357 printf(" %d", n_nargs);
50370 test_xmlXPathSumFunction(void) {
50373 #if defined(LIBXML_XPATH_ENABLED)
50375 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50377 int nargs; /* the number of arguments */
50380 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50381 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50382 mem_base = xmlMemBlocks();
50383 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50384 nargs = gen_int(n_nargs, 1);
50386 xmlXPathSumFunction(ctxt, nargs);
50388 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50389 des_int(n_nargs, nargs, 1);
50390 xmlResetLastError();
50391 if (mem_base != xmlMemBlocks()) {
50392 printf("Leak of %d blocks found in xmlXPathSumFunction",
50393 xmlMemBlocks() - mem_base);
50395 printf(" %d", n_ctxt);
50396 printf(" %d", n_nargs);
50409 test_xmlXPathTrailing(void) {
50412 #if defined(LIBXML_XPATH_ENABLED)
50414 xmlNodeSetPtr ret_val;
50415 xmlNodeSetPtr nodes1; /* a node-set */
50417 xmlNodeSetPtr nodes2; /* a node-set */
50420 for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
50421 for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
50422 mem_base = xmlMemBlocks();
50423 nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
50424 nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
50426 ret_val = xmlXPathTrailing(nodes1, nodes2);
50427 desret_xmlNodeSetPtr(ret_val);
50429 des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
50430 des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
50431 xmlResetLastError();
50432 if (mem_base != xmlMemBlocks()) {
50433 printf("Leak of %d blocks found in xmlXPathTrailing",
50434 xmlMemBlocks() - mem_base);
50436 printf(" %d", n_nodes1);
50437 printf(" %d", n_nodes2);
50450 test_xmlXPathTrailingSorted(void) {
50453 #if defined(LIBXML_XPATH_ENABLED)
50455 xmlNodeSetPtr ret_val;
50456 xmlNodeSetPtr nodes1; /* a node-set, sorted by document order */
50458 xmlNodeSetPtr nodes2; /* a node-set, sorted by document order */
50461 for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
50462 for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
50463 mem_base = xmlMemBlocks();
50464 nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
50465 nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
50467 ret_val = xmlXPathTrailingSorted(nodes1, nodes2);
50468 desret_xmlNodeSetPtr(ret_val);
50470 des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
50471 des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
50472 xmlResetLastError();
50473 if (mem_base != xmlMemBlocks()) {
50474 printf("Leak of %d blocks found in xmlXPathTrailingSorted",
50475 xmlMemBlocks() - mem_base);
50477 printf(" %d", n_nodes1);
50478 printf(" %d", n_nodes2);
50491 test_xmlXPathTranslateFunction(void) {
50494 #if defined(LIBXML_XPATH_ENABLED)
50496 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50498 int nargs; /* the number of arguments */
50501 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50502 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50503 mem_base = xmlMemBlocks();
50504 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50505 nargs = gen_int(n_nargs, 1);
50507 xmlXPathTranslateFunction(ctxt, nargs);
50509 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50510 des_int(n_nargs, nargs, 1);
50511 xmlResetLastError();
50512 if (mem_base != xmlMemBlocks()) {
50513 printf("Leak of %d blocks found in xmlXPathTranslateFunction",
50514 xmlMemBlocks() - mem_base);
50516 printf(" %d", n_ctxt);
50517 printf(" %d", n_nargs);
50530 test_xmlXPathTrueFunction(void) {
50533 #if defined(LIBXML_XPATH_ENABLED)
50535 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50537 int nargs; /* the number of arguments */
50540 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50541 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50542 mem_base = xmlMemBlocks();
50543 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50544 nargs = gen_int(n_nargs, 1);
50546 xmlXPathTrueFunction(ctxt, nargs);
50548 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50549 des_int(n_nargs, nargs, 1);
50550 xmlResetLastError();
50551 if (mem_base != xmlMemBlocks()) {
50552 printf("Leak of %d blocks found in xmlXPathTrueFunction",
50553 xmlMemBlocks() - mem_base);
50555 printf(" %d", n_ctxt);
50556 printf(" %d", n_nargs);
50569 test_xmlXPathValueFlipSign(void) {
50572 #if defined(LIBXML_XPATH_ENABLED)
50574 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50577 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50578 mem_base = xmlMemBlocks();
50579 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50581 xmlXPathValueFlipSign(ctxt);
50583 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50584 xmlResetLastError();
50585 if (mem_base != xmlMemBlocks()) {
50586 printf("Leak of %d blocks found in xmlXPathValueFlipSign",
50587 xmlMemBlocks() - mem_base);
50589 printf(" %d", n_ctxt);
50601 test_xmlXPathVariableLookup(void) {
50604 #if defined(LIBXML_XPATH_ENABLED)
50606 xmlXPathObjectPtr ret_val;
50607 xmlXPathContextPtr ctxt; /* the XPath context */
50609 xmlChar * name; /* the variable name */
50612 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
50613 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
50614 mem_base = xmlMemBlocks();
50615 ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
50616 name = gen_const_xmlChar_ptr(n_name, 1);
50618 ret_val = xmlXPathVariableLookup(ctxt, (const xmlChar *)name);
50619 desret_xmlXPathObjectPtr(ret_val);
50621 des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
50622 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
50623 xmlResetLastError();
50624 if (mem_base != xmlMemBlocks()) {
50625 printf("Leak of %d blocks found in xmlXPathVariableLookup",
50626 xmlMemBlocks() - mem_base);
50628 printf(" %d", n_ctxt);
50629 printf(" %d", n_name);
50642 test_xmlXPathVariableLookupNS(void) {
50645 #if defined(LIBXML_XPATH_ENABLED)
50647 xmlXPathObjectPtr ret_val;
50648 xmlXPathContextPtr ctxt; /* the XPath context */
50650 xmlChar * name; /* the variable name */
50652 xmlChar * ns_uri; /* the variable namespace URI */
50655 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
50656 for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
50657 for (n_ns_uri = 0;n_ns_uri < gen_nb_const_xmlChar_ptr;n_ns_uri++) {
50658 mem_base = xmlMemBlocks();
50659 ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
50660 name = gen_const_xmlChar_ptr(n_name, 1);
50661 ns_uri = gen_const_xmlChar_ptr(n_ns_uri, 2);
50663 ret_val = xmlXPathVariableLookupNS(ctxt, (const xmlChar *)name, (const xmlChar *)ns_uri);
50664 desret_xmlXPathObjectPtr(ret_val);
50666 des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
50667 des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
50668 des_const_xmlChar_ptr(n_ns_uri, (const xmlChar *)ns_uri, 2);
50669 xmlResetLastError();
50670 if (mem_base != xmlMemBlocks()) {
50671 printf("Leak of %d blocks found in xmlXPathVariableLookupNS",
50672 xmlMemBlocks() - mem_base);
50674 printf(" %d", n_ctxt);
50675 printf(" %d", n_name);
50676 printf(" %d", n_ns_uri);
50690 test_xmlXPathWrapCString(void) {
50693 #if defined(LIBXML_XPATH_ENABLED)
50695 xmlXPathObjectPtr ret_val;
50696 char * val; /* the char * value */
50699 for (n_val = 0;n_val < gen_nb_char_ptr;n_val++) {
50700 mem_base = xmlMemBlocks();
50701 val = gen_char_ptr(n_val, 0);
50703 ret_val = xmlXPathWrapCString(val);
50704 desret_xmlXPathObjectPtr(ret_val);
50706 des_char_ptr(n_val, val, 0);
50707 xmlResetLastError();
50708 if (mem_base != xmlMemBlocks()) {
50709 printf("Leak of %d blocks found in xmlXPathWrapCString",
50710 xmlMemBlocks() - mem_base);
50712 printf(" %d", n_val);
50724 test_xmlXPathWrapExternal(void) {
50727 #if defined(LIBXML_XPATH_ENABLED)
50729 xmlXPathObjectPtr ret_val;
50730 void * val; /* the user data */
50733 for (n_val = 0;n_val < gen_nb_void_ptr;n_val++) {
50734 mem_base = xmlMemBlocks();
50735 val = gen_void_ptr(n_val, 0);
50737 ret_val = xmlXPathWrapExternal(val);
50738 desret_xmlXPathObjectPtr(ret_val);
50740 des_void_ptr(n_val, val, 0);
50741 xmlResetLastError();
50742 if (mem_base != xmlMemBlocks()) {
50743 printf("Leak of %d blocks found in xmlXPathWrapExternal",
50744 xmlMemBlocks() - mem_base);
50746 printf(" %d", n_val);
50758 test_xmlXPathWrapNodeSet(void) {
50761 #if defined(LIBXML_XPATH_ENABLED)
50763 xmlXPathObjectPtr ret_val;
50764 xmlNodeSetPtr val; /* the NodePtr value */
50767 for (n_val = 0;n_val < gen_nb_xmlNodeSetPtr;n_val++) {
50768 mem_base = xmlMemBlocks();
50769 val = gen_xmlNodeSetPtr(n_val, 0);
50771 ret_val = xmlXPathWrapNodeSet(val);
50772 desret_xmlXPathObjectPtr(ret_val);
50774 des_xmlNodeSetPtr(n_val, val, 0);
50775 xmlResetLastError();
50776 if (mem_base != xmlMemBlocks()) {
50777 printf("Leak of %d blocks found in xmlXPathWrapNodeSet",
50778 xmlMemBlocks() - mem_base);
50780 printf(" %d", n_val);
50792 test_xmlXPatherror(void) {
50795 #if defined(LIBXML_XPATH_ENABLED)
50797 xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50799 const char * file; /* the file name */
50801 int line; /* the line number */
50803 int no; /* the error number */
50806 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50807 for (n_file = 0;n_file < gen_nb_filepath;n_file++) {
50808 for (n_line = 0;n_line < gen_nb_int;n_line++) {
50809 for (n_no = 0;n_no < gen_nb_int;n_no++) {
50810 mem_base = xmlMemBlocks();
50811 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50812 file = gen_filepath(n_file, 1);
50813 line = gen_int(n_line, 2);
50814 no = gen_int(n_no, 3);
50816 xmlXPatherror(ctxt, file, line, no);
50818 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50819 des_filepath(n_file, file, 1);
50820 des_int(n_line, line, 2);
50821 des_int(n_no, no, 3);
50822 xmlResetLastError();
50823 if (mem_base != xmlMemBlocks()) {
50824 printf("Leak of %d blocks found in xmlXPatherror",
50825 xmlMemBlocks() - mem_base);
50827 printf(" %d", n_ctxt);
50828 printf(" %d", n_file);
50829 printf(" %d", n_line);
50830 printf(" %d", n_no);
50844 test_xpathInternals(void) {
50847 if (quiet == 0) printf("Testing xpathInternals : 106 of 117 functions ...\n");
50848 test_ret += test_valuePop();
50849 test_ret += test_valuePush();
50850 test_ret += test_xmlXPathAddValues();
50851 test_ret += test_xmlXPathBooleanFunction();
50852 test_ret += test_xmlXPathCeilingFunction();
50853 test_ret += test_xmlXPathCompareValues();
50854 test_ret += test_xmlXPathConcatFunction();
50855 test_ret += test_xmlXPathContainsFunction();
50856 test_ret += test_xmlXPathCountFunction();
50857 test_ret += test_xmlXPathDebugDumpCompExpr();
50858 test_ret += test_xmlXPathDebugDumpObject();
50859 test_ret += test_xmlXPathDifference();
50860 test_ret += test_xmlXPathDistinct();
50861 test_ret += test_xmlXPathDistinctSorted();
50862 test_ret += test_xmlXPathDivValues();
50863 test_ret += test_xmlXPathEqualValues();
50864 test_ret += test_xmlXPathErr();
50865 test_ret += test_xmlXPathEvalExpr();
50866 test_ret += test_xmlXPathEvaluatePredicateResult();
50867 test_ret += test_xmlXPathFalseFunction();
50868 test_ret += test_xmlXPathFloorFunction();
50869 test_ret += test_xmlXPathFunctionLookup();
50870 test_ret += test_xmlXPathFunctionLookupNS();
50871 test_ret += test_xmlXPathHasSameNodes();
50872 test_ret += test_xmlXPathIdFunction();
50873 test_ret += test_xmlXPathIntersection();
50874 test_ret += test_xmlXPathIsNodeType();
50875 test_ret += test_xmlXPathLangFunction();
50876 test_ret += test_xmlXPathLastFunction();
50877 test_ret += test_xmlXPathLeading();
50878 test_ret += test_xmlXPathLeadingSorted();
50879 test_ret += test_xmlXPathLocalNameFunction();
50880 test_ret += test_xmlXPathModValues();
50881 test_ret += test_xmlXPathMultValues();
50882 test_ret += test_xmlXPathNamespaceURIFunction();
50883 test_ret += test_xmlXPathNewBoolean();
50884 test_ret += test_xmlXPathNewCString();
50885 test_ret += test_xmlXPathNewFloat();
50886 test_ret += test_xmlXPathNewNodeSet();
50887 test_ret += test_xmlXPathNewNodeSetList();
50888 test_ret += test_xmlXPathNewParserContext();
50889 test_ret += test_xmlXPathNewString();
50890 test_ret += test_xmlXPathNextAncestor();
50891 test_ret += test_xmlXPathNextAncestorOrSelf();
50892 test_ret += test_xmlXPathNextAttribute();
50893 test_ret += test_xmlXPathNextChild();
50894 test_ret += test_xmlXPathNextDescendant();
50895 test_ret += test_xmlXPathNextDescendantOrSelf();
50896 test_ret += test_xmlXPathNextFollowing();
50897 test_ret += test_xmlXPathNextFollowingSibling();
50898 test_ret += test_xmlXPathNextNamespace();
50899 test_ret += test_xmlXPathNextParent();
50900 test_ret += test_xmlXPathNextPreceding();
50901 test_ret += test_xmlXPathNextPrecedingSibling();
50902 test_ret += test_xmlXPathNextSelf();
50903 test_ret += test_xmlXPathNodeLeading();
50904 test_ret += test_xmlXPathNodeLeadingSorted();
50905 test_ret += test_xmlXPathNodeSetAdd();
50906 test_ret += test_xmlXPathNodeSetAddNs();
50907 test_ret += test_xmlXPathNodeSetAddUnique();
50908 test_ret += test_xmlXPathNodeSetContains();
50909 test_ret += test_xmlXPathNodeSetDel();
50910 test_ret += test_xmlXPathNodeSetMerge();
50911 test_ret += test_xmlXPathNodeSetRemove();
50912 test_ret += test_xmlXPathNodeSetSort();
50913 test_ret += test_xmlXPathNodeTrailing();
50914 test_ret += test_xmlXPathNodeTrailingSorted();
50915 test_ret += test_xmlXPathNormalizeFunction();
50916 test_ret += test_xmlXPathNotEqualValues();
50917 test_ret += test_xmlXPathNotFunction();
50918 test_ret += test_xmlXPathNsLookup();
50919 test_ret += test_xmlXPathNumberFunction();
50920 test_ret += test_xmlXPathParseNCName();
50921 test_ret += test_xmlXPathParseName();
50922 test_ret += test_xmlXPathPopBoolean();
50923 test_ret += test_xmlXPathPopExternal();
50924 test_ret += test_xmlXPathPopNodeSet();
50925 test_ret += test_xmlXPathPopNumber();
50926 test_ret += test_xmlXPathPopString();
50927 test_ret += test_xmlXPathPositionFunction();
50928 test_ret += test_xmlXPathRegisterAllFunctions();
50929 test_ret += test_xmlXPathRegisterFunc();
50930 test_ret += test_xmlXPathRegisterFuncLookup();
50931 test_ret += test_xmlXPathRegisterFuncNS();
50932 test_ret += test_xmlXPathRegisterNs();
50933 test_ret += test_xmlXPathRegisterVariable();
50934 test_ret += test_xmlXPathRegisterVariableLookup();
50935 test_ret += test_xmlXPathRegisterVariableNS();
50936 test_ret += test_xmlXPathRegisteredFuncsCleanup();
50937 test_ret += test_xmlXPathRegisteredNsCleanup();
50938 test_ret += test_xmlXPathRegisteredVariablesCleanup();
50939 test_ret += test_xmlXPathRoot();
50940 test_ret += test_xmlXPathRoundFunction();
50941 test_ret += test_xmlXPathStartsWithFunction();
50942 test_ret += test_xmlXPathStringEvalNumber();
50943 test_ret += test_xmlXPathStringFunction();
50944 test_ret += test_xmlXPathStringLengthFunction();
50945 test_ret += test_xmlXPathSubValues();
50946 test_ret += test_xmlXPathSubstringAfterFunction();
50947 test_ret += test_xmlXPathSubstringBeforeFunction();
50948 test_ret += test_xmlXPathSubstringFunction();
50949 test_ret += test_xmlXPathSumFunction();
50950 test_ret += test_xmlXPathTrailing();
50951 test_ret += test_xmlXPathTrailingSorted();
50952 test_ret += test_xmlXPathTranslateFunction();
50953 test_ret += test_xmlXPathTrueFunction();
50954 test_ret += test_xmlXPathValueFlipSign();
50955 test_ret += test_xmlXPathVariableLookup();
50956 test_ret += test_xmlXPathVariableLookupNS();
50957 test_ret += test_xmlXPathWrapCString();
50958 test_ret += test_xmlXPathWrapExternal();
50959 test_ret += test_xmlXPathWrapNodeSet();
50960 test_ret += test_xmlXPatherror();
50963 printf("Module xpathInternals: %d errors\n", test_ret);
50968 test_xmlXPtrBuildNodeList(void) {
50971 #if defined(LIBXML_XPTR_ENABLED)
50973 xmlNodePtr ret_val;
50974 xmlXPathObjectPtr obj; /* the XPointer result from the evaluation. */
50977 for (n_obj = 0;n_obj < gen_nb_xmlXPathObjectPtr;n_obj++) {
50978 mem_base = xmlMemBlocks();
50979 obj = gen_xmlXPathObjectPtr(n_obj, 0);
50981 ret_val = xmlXPtrBuildNodeList(obj);
50982 desret_xmlNodePtr(ret_val);
50984 des_xmlXPathObjectPtr(n_obj, obj, 0);
50985 xmlResetLastError();
50986 if (mem_base != xmlMemBlocks()) {
50987 printf("Leak of %d blocks found in xmlXPtrBuildNodeList",
50988 xmlMemBlocks() - mem_base);
50990 printf(" %d", n_obj);
51002 test_xmlXPtrEval(void) {
51005 #if defined(LIBXML_XPTR_ENABLED)
51007 xmlXPathObjectPtr ret_val;
51008 xmlChar * str; /* the XPointer expression */
51010 xmlXPathContextPtr ctx; /* the XPointer context */
51013 for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
51014 for (n_ctx = 0;n_ctx < gen_nb_xmlXPathContextPtr;n_ctx++) {
51015 mem_base = xmlMemBlocks();
51016 str = gen_const_xmlChar_ptr(n_str, 0);
51017 ctx = gen_xmlXPathContextPtr(n_ctx, 1);
51019 ret_val = xmlXPtrEval((const xmlChar *)str, ctx);
51020 desret_xmlXPathObjectPtr(ret_val);
51022 des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
51023 des_xmlXPathContextPtr(n_ctx, ctx, 1);
51024 xmlResetLastError();
51025 if (mem_base != xmlMemBlocks()) {
51026 printf("Leak of %d blocks found in xmlXPtrEval",
51027 xmlMemBlocks() - mem_base);
51029 printf(" %d", n_str);
51030 printf(" %d", n_ctx);
51043 test_xmlXPtrEvalRangePredicate(void) {
51046 #if defined(LIBXML_XPTR_ENABLED)
51048 xmlXPathParserContextPtr ctxt; /* the XPointer Parser context */
51051 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
51052 mem_base = xmlMemBlocks();
51053 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
51055 xmlXPtrEvalRangePredicate(ctxt);
51057 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
51058 xmlResetLastError();
51059 if (mem_base != xmlMemBlocks()) {
51060 printf("Leak of %d blocks found in xmlXPtrEvalRangePredicate",
51061 xmlMemBlocks() - mem_base);
51063 printf(" %d", n_ctxt);
51073 #ifdef LIBXML_XPTR_ENABLED
51075 #define gen_nb_xmlLocationSetPtr 1
51076 static xmlLocationSetPtr gen_xmlLocationSetPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
51079 static void des_xmlLocationSetPtr(int no ATTRIBUTE_UNUSED, xmlLocationSetPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
51085 test_xmlXPtrLocationSetAdd(void) {
51088 #if defined(LIBXML_XPTR_ENABLED)
51090 xmlLocationSetPtr cur; /* the initial range set */
51092 xmlXPathObjectPtr val; /* a new xmlXPathObjectPtr */
51095 for (n_cur = 0;n_cur < gen_nb_xmlLocationSetPtr;n_cur++) {
51096 for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
51097 mem_base = xmlMemBlocks();
51098 cur = gen_xmlLocationSetPtr(n_cur, 0);
51099 val = gen_xmlXPathObjectPtr(n_val, 1);
51101 xmlXPtrLocationSetAdd(cur, val);
51103 des_xmlLocationSetPtr(n_cur, cur, 0);
51104 des_xmlXPathObjectPtr(n_val, val, 1);
51105 xmlResetLastError();
51106 if (mem_base != xmlMemBlocks()) {
51107 printf("Leak of %d blocks found in xmlXPtrLocationSetAdd",
51108 xmlMemBlocks() - mem_base);
51110 printf(" %d", n_cur);
51111 printf(" %d", n_val);
51124 test_xmlXPtrLocationSetCreate(void) {
51128 /* missing type support */
51134 test_xmlXPtrLocationSetDel(void) {
51137 #if defined(LIBXML_XPTR_ENABLED)
51139 xmlLocationSetPtr cur; /* the initial range set */
51141 xmlXPathObjectPtr val; /* an xmlXPathObjectPtr */
51144 for (n_cur = 0;n_cur < gen_nb_xmlLocationSetPtr;n_cur++) {
51145 for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
51146 mem_base = xmlMemBlocks();
51147 cur = gen_xmlLocationSetPtr(n_cur, 0);
51148 val = gen_xmlXPathObjectPtr(n_val, 1);
51150 xmlXPtrLocationSetDel(cur, val);
51152 des_xmlLocationSetPtr(n_cur, cur, 0);
51153 des_xmlXPathObjectPtr(n_val, val, 1);
51154 xmlResetLastError();
51155 if (mem_base != xmlMemBlocks()) {
51156 printf("Leak of %d blocks found in xmlXPtrLocationSetDel",
51157 xmlMemBlocks() - mem_base);
51159 printf(" %d", n_cur);
51160 printf(" %d", n_val);
51173 test_xmlXPtrLocationSetMerge(void) {
51177 /* missing type support */
51183 test_xmlXPtrLocationSetRemove(void) {
51186 #if defined(LIBXML_XPTR_ENABLED)
51188 xmlLocationSetPtr cur; /* the initial range set */
51190 int val; /* the index to remove */
51193 for (n_cur = 0;n_cur < gen_nb_xmlLocationSetPtr;n_cur++) {
51194 for (n_val = 0;n_val < gen_nb_int;n_val++) {
51195 mem_base = xmlMemBlocks();
51196 cur = gen_xmlLocationSetPtr(n_cur, 0);
51197 val = gen_int(n_val, 1);
51199 xmlXPtrLocationSetRemove(cur, val);
51201 des_xmlLocationSetPtr(n_cur, cur, 0);
51202 des_int(n_val, val, 1);
51203 xmlResetLastError();
51204 if (mem_base != xmlMemBlocks()) {
51205 printf("Leak of %d blocks found in xmlXPtrLocationSetRemove",
51206 xmlMemBlocks() - mem_base);
51208 printf(" %d", n_cur);
51209 printf(" %d", n_val);
51222 test_xmlXPtrNewCollapsedRange(void) {
51225 #if defined(LIBXML_XPTR_ENABLED)
51227 xmlXPathObjectPtr ret_val;
51228 xmlNodePtr start; /* the starting and ending node */
51231 for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
51232 mem_base = xmlMemBlocks();
51233 start = gen_xmlNodePtr(n_start, 0);
51235 ret_val = xmlXPtrNewCollapsedRange(start);
51236 desret_xmlXPathObjectPtr(ret_val);
51238 des_xmlNodePtr(n_start, start, 0);
51239 xmlResetLastError();
51240 if (mem_base != xmlMemBlocks()) {
51241 printf("Leak of %d blocks found in xmlXPtrNewCollapsedRange",
51242 xmlMemBlocks() - mem_base);
51244 printf(" %d", n_start);
51256 test_xmlXPtrNewContext(void) {
51260 /* missing type support */
51266 test_xmlXPtrNewLocationSetNodeSet(void) {
51269 #if defined(LIBXML_XPTR_ENABLED)
51271 xmlXPathObjectPtr ret_val;
51272 xmlNodeSetPtr set; /* a node set */
51275 for (n_set = 0;n_set < gen_nb_xmlNodeSetPtr;n_set++) {
51276 mem_base = xmlMemBlocks();
51277 set = gen_xmlNodeSetPtr(n_set, 0);
51279 ret_val = xmlXPtrNewLocationSetNodeSet(set);
51280 desret_xmlXPathObjectPtr(ret_val);
51282 des_xmlNodeSetPtr(n_set, set, 0);
51283 xmlResetLastError();
51284 if (mem_base != xmlMemBlocks()) {
51285 printf("Leak of %d blocks found in xmlXPtrNewLocationSetNodeSet",
51286 xmlMemBlocks() - mem_base);
51288 printf(" %d", n_set);
51300 test_xmlXPtrNewLocationSetNodes(void) {
51303 #if defined(LIBXML_XPTR_ENABLED)
51305 xmlXPathObjectPtr ret_val;
51306 xmlNodePtr start; /* the start NodePtr value */
51308 xmlNodePtr end; /* the end NodePtr value or NULL */
51311 for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
51312 for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) {
51313 mem_base = xmlMemBlocks();
51314 start = gen_xmlNodePtr(n_start, 0);
51315 end = gen_xmlNodePtr(n_end, 1);
51317 ret_val = xmlXPtrNewLocationSetNodes(start, end);
51318 desret_xmlXPathObjectPtr(ret_val);
51320 des_xmlNodePtr(n_start, start, 0);
51321 des_xmlNodePtr(n_end, end, 1);
51322 xmlResetLastError();
51323 if (mem_base != xmlMemBlocks()) {
51324 printf("Leak of %d blocks found in xmlXPtrNewLocationSetNodes",
51325 xmlMemBlocks() - mem_base);
51327 printf(" %d", n_start);
51328 printf(" %d", n_end);
51341 test_xmlXPtrNewRange(void) {
51344 #if defined(LIBXML_XPTR_ENABLED)
51346 xmlXPathObjectPtr ret_val;
51347 xmlNodePtr start; /* the starting node */
51349 int startindex; /* the start index */
51351 xmlNodePtr end; /* the ending point */
51353 int endindex; /* the ending index */
51356 for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
51357 for (n_startindex = 0;n_startindex < gen_nb_int;n_startindex++) {
51358 for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) {
51359 for (n_endindex = 0;n_endindex < gen_nb_int;n_endindex++) {
51360 mem_base = xmlMemBlocks();
51361 start = gen_xmlNodePtr(n_start, 0);
51362 startindex = gen_int(n_startindex, 1);
51363 end = gen_xmlNodePtr(n_end, 2);
51364 endindex = gen_int(n_endindex, 3);
51366 ret_val = xmlXPtrNewRange(start, startindex, end, endindex);
51367 desret_xmlXPathObjectPtr(ret_val);
51369 des_xmlNodePtr(n_start, start, 0);
51370 des_int(n_startindex, startindex, 1);
51371 des_xmlNodePtr(n_end, end, 2);
51372 des_int(n_endindex, endindex, 3);
51373 xmlResetLastError();
51374 if (mem_base != xmlMemBlocks()) {
51375 printf("Leak of %d blocks found in xmlXPtrNewRange",
51376 xmlMemBlocks() - mem_base);
51378 printf(" %d", n_start);
51379 printf(" %d", n_startindex);
51380 printf(" %d", n_end);
51381 printf(" %d", n_endindex);
51396 test_xmlXPtrNewRangeNodeObject(void) {
51399 #if defined(LIBXML_XPTR_ENABLED)
51401 xmlXPathObjectPtr ret_val;
51402 xmlNodePtr start; /* the starting node */
51404 xmlXPathObjectPtr end; /* the ending object */
51407 for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
51408 for (n_end = 0;n_end < gen_nb_xmlXPathObjectPtr;n_end++) {
51409 mem_base = xmlMemBlocks();
51410 start = gen_xmlNodePtr(n_start, 0);
51411 end = gen_xmlXPathObjectPtr(n_end, 1);
51413 ret_val = xmlXPtrNewRangeNodeObject(start, end);
51414 desret_xmlXPathObjectPtr(ret_val);
51416 des_xmlNodePtr(n_start, start, 0);
51417 des_xmlXPathObjectPtr(n_end, end, 1);
51418 xmlResetLastError();
51419 if (mem_base != xmlMemBlocks()) {
51420 printf("Leak of %d blocks found in xmlXPtrNewRangeNodeObject",
51421 xmlMemBlocks() - mem_base);
51423 printf(" %d", n_start);
51424 printf(" %d", n_end);
51437 test_xmlXPtrNewRangeNodePoint(void) {
51440 #if defined(LIBXML_XPTR_ENABLED)
51442 xmlXPathObjectPtr ret_val;
51443 xmlNodePtr start; /* the starting node */
51445 xmlXPathObjectPtr end; /* the ending point */
51448 for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
51449 for (n_end = 0;n_end < gen_nb_xmlXPathObjectPtr;n_end++) {
51450 mem_base = xmlMemBlocks();
51451 start = gen_xmlNodePtr(n_start, 0);
51452 end = gen_xmlXPathObjectPtr(n_end, 1);
51454 ret_val = xmlXPtrNewRangeNodePoint(start, end);
51455 desret_xmlXPathObjectPtr(ret_val);
51457 des_xmlNodePtr(n_start, start, 0);
51458 des_xmlXPathObjectPtr(n_end, end, 1);
51459 xmlResetLastError();
51460 if (mem_base != xmlMemBlocks()) {
51461 printf("Leak of %d blocks found in xmlXPtrNewRangeNodePoint",
51462 xmlMemBlocks() - mem_base);
51464 printf(" %d", n_start);
51465 printf(" %d", n_end);
51478 test_xmlXPtrNewRangeNodes(void) {
51481 #if defined(LIBXML_XPTR_ENABLED)
51483 xmlXPathObjectPtr ret_val;
51484 xmlNodePtr start; /* the starting node */
51486 xmlNodePtr end; /* the ending node */
51489 for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
51490 for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) {
51491 mem_base = xmlMemBlocks();
51492 start = gen_xmlNodePtr(n_start, 0);
51493 end = gen_xmlNodePtr(n_end, 1);
51495 ret_val = xmlXPtrNewRangeNodes(start, end);
51496 desret_xmlXPathObjectPtr(ret_val);
51498 des_xmlNodePtr(n_start, start, 0);
51499 des_xmlNodePtr(n_end, end, 1);
51500 xmlResetLastError();
51501 if (mem_base != xmlMemBlocks()) {
51502 printf("Leak of %d blocks found in xmlXPtrNewRangeNodes",
51503 xmlMemBlocks() - mem_base);
51505 printf(" %d", n_start);
51506 printf(" %d", n_end);
51519 test_xmlXPtrNewRangePointNode(void) {
51522 #if defined(LIBXML_XPTR_ENABLED)
51524 xmlXPathObjectPtr ret_val;
51525 xmlXPathObjectPtr start; /* the starting point */
51527 xmlNodePtr end; /* the ending node */
51530 for (n_start = 0;n_start < gen_nb_xmlXPathObjectPtr;n_start++) {
51531 for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) {
51532 mem_base = xmlMemBlocks();
51533 start = gen_xmlXPathObjectPtr(n_start, 0);
51534 end = gen_xmlNodePtr(n_end, 1);
51536 ret_val = xmlXPtrNewRangePointNode(start, end);
51537 desret_xmlXPathObjectPtr(ret_val);
51539 des_xmlXPathObjectPtr(n_start, start, 0);
51540 des_xmlNodePtr(n_end, end, 1);
51541 xmlResetLastError();
51542 if (mem_base != xmlMemBlocks()) {
51543 printf("Leak of %d blocks found in xmlXPtrNewRangePointNode",
51544 xmlMemBlocks() - mem_base);
51546 printf(" %d", n_start);
51547 printf(" %d", n_end);
51560 test_xmlXPtrNewRangePoints(void) {
51563 #if defined(LIBXML_XPTR_ENABLED)
51565 xmlXPathObjectPtr ret_val;
51566 xmlXPathObjectPtr start; /* the starting point */
51568 xmlXPathObjectPtr end; /* the ending point */
51571 for (n_start = 0;n_start < gen_nb_xmlXPathObjectPtr;n_start++) {
51572 for (n_end = 0;n_end < gen_nb_xmlXPathObjectPtr;n_end++) {
51573 mem_base = xmlMemBlocks();
51574 start = gen_xmlXPathObjectPtr(n_start, 0);
51575 end = gen_xmlXPathObjectPtr(n_end, 1);
51577 ret_val = xmlXPtrNewRangePoints(start, end);
51578 desret_xmlXPathObjectPtr(ret_val);
51580 des_xmlXPathObjectPtr(n_start, start, 0);
51581 des_xmlXPathObjectPtr(n_end, end, 1);
51582 xmlResetLastError();
51583 if (mem_base != xmlMemBlocks()) {
51584 printf("Leak of %d blocks found in xmlXPtrNewRangePoints",
51585 xmlMemBlocks() - mem_base);
51587 printf(" %d", n_start);
51588 printf(" %d", n_end);
51601 test_xmlXPtrRangeToFunction(void) {
51604 #if defined(LIBXML_XPTR_ENABLED)
51606 xmlXPathParserContextPtr ctxt; /* the XPointer Parser context */
51608 int nargs; /* the number of args */
51611 for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
51612 for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
51613 mem_base = xmlMemBlocks();
51614 ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
51615 nargs = gen_int(n_nargs, 1);
51617 xmlXPtrRangeToFunction(ctxt, nargs);
51619 des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
51620 des_int(n_nargs, nargs, 1);
51621 xmlResetLastError();
51622 if (mem_base != xmlMemBlocks()) {
51623 printf("Leak of %d blocks found in xmlXPtrRangeToFunction",
51624 xmlMemBlocks() - mem_base);
51626 printf(" %d", n_ctxt);
51627 printf(" %d", n_nargs);
51640 test_xmlXPtrWrapLocationSet(void) {
51643 #if defined(LIBXML_XPTR_ENABLED)
51645 xmlXPathObjectPtr ret_val;
51646 xmlLocationSetPtr val; /* the LocationSet value */
51649 for (n_val = 0;n_val < gen_nb_xmlLocationSetPtr;n_val++) {
51650 mem_base = xmlMemBlocks();
51651 val = gen_xmlLocationSetPtr(n_val, 0);
51653 ret_val = xmlXPtrWrapLocationSet(val);
51654 desret_xmlXPathObjectPtr(ret_val);
51656 des_xmlLocationSetPtr(n_val, val, 0);
51657 xmlResetLastError();
51658 if (mem_base != xmlMemBlocks()) {
51659 printf("Leak of %d blocks found in xmlXPtrWrapLocationSet",
51660 xmlMemBlocks() - mem_base);
51662 printf(" %d", n_val);
51673 test_xpointer(void) {
51676 if (quiet == 0) printf("Testing xpointer : 17 of 21 functions ...\n");
51677 test_ret += test_xmlXPtrBuildNodeList();
51678 test_ret += test_xmlXPtrEval();
51679 test_ret += test_xmlXPtrEvalRangePredicate();
51680 test_ret += test_xmlXPtrLocationSetAdd();
51681 test_ret += test_xmlXPtrLocationSetCreate();
51682 test_ret += test_xmlXPtrLocationSetDel();
51683 test_ret += test_xmlXPtrLocationSetMerge();
51684 test_ret += test_xmlXPtrLocationSetRemove();
51685 test_ret += test_xmlXPtrNewCollapsedRange();
51686 test_ret += test_xmlXPtrNewContext();
51687 test_ret += test_xmlXPtrNewLocationSetNodeSet();
51688 test_ret += test_xmlXPtrNewLocationSetNodes();
51689 test_ret += test_xmlXPtrNewRange();
51690 test_ret += test_xmlXPtrNewRangeNodeObject();
51691 test_ret += test_xmlXPtrNewRangeNodePoint();
51692 test_ret += test_xmlXPtrNewRangeNodes();
51693 test_ret += test_xmlXPtrNewRangePointNode();
51694 test_ret += test_xmlXPtrNewRangePoints();
51695 test_ret += test_xmlXPtrRangeToFunction();
51696 test_ret += test_xmlXPtrWrapLocationSet();
51699 printf("Module xpointer: %d errors\n", test_ret);
51703 test_module(const char *module) {
51704 if (!strcmp(module, "HTMLparser")) return(test_HTMLparser());
51705 if (!strcmp(module, "HTMLtree")) return(test_HTMLtree());
51706 if (!strcmp(module, "SAX2")) return(test_SAX2());
51707 if (!strcmp(module, "c14n")) return(test_c14n());
51708 if (!strcmp(module, "catalog")) return(test_catalog());
51709 if (!strcmp(module, "chvalid")) return(test_chvalid());
51710 if (!strcmp(module, "debugXML")) return(test_debugXML());
51711 if (!strcmp(module, "dict")) return(test_dict());
51712 if (!strcmp(module, "encoding")) return(test_encoding());
51713 if (!strcmp(module, "entities")) return(test_entities());
51714 if (!strcmp(module, "hash")) return(test_hash());
51715 if (!strcmp(module, "list")) return(test_list());
51716 if (!strcmp(module, "nanoftp")) return(test_nanoftp());
51717 if (!strcmp(module, "nanohttp")) return(test_nanohttp());
51718 if (!strcmp(module, "parser")) return(test_parser());
51719 if (!strcmp(module, "parserInternals")) return(test_parserInternals());
51720 if (!strcmp(module, "pattern")) return(test_pattern());
51721 if (!strcmp(module, "relaxng")) return(test_relaxng());
51722 if (!strcmp(module, "schemasInternals")) return(test_schemasInternals());
51723 if (!strcmp(module, "schematron")) return(test_schematron());
51724 if (!strcmp(module, "tree")) return(test_tree());
51725 if (!strcmp(module, "uri")) return(test_uri());
51726 if (!strcmp(module, "valid")) return(test_valid());
51727 if (!strcmp(module, "xinclude")) return(test_xinclude());
51728 if (!strcmp(module, "xmlIO")) return(test_xmlIO());
51729 if (!strcmp(module, "xmlautomata")) return(test_xmlautomata());
51730 if (!strcmp(module, "xmlerror")) return(test_xmlerror());
51731 if (!strcmp(module, "xmlmodule")) return(test_xmlmodule());
51732 if (!strcmp(module, "xmlreader")) return(test_xmlreader());
51733 if (!strcmp(module, "xmlregexp")) return(test_xmlregexp());
51734 if (!strcmp(module, "xmlsave")) return(test_xmlsave());
51735 if (!strcmp(module, "xmlschemas")) return(test_xmlschemas());
51736 if (!strcmp(module, "xmlschemastypes")) return(test_xmlschemastypes());
51737 if (!strcmp(module, "xmlstring")) return(test_xmlstring());
51738 if (!strcmp(module, "xmlunicode")) return(test_xmlunicode());
51739 if (!strcmp(module, "xmlwriter")) return(test_xmlwriter());
51740 if (!strcmp(module, "xpath")) return(test_xpath());
51741 if (!strcmp(module, "xpathInternals")) return(test_xpathInternals());
51742 if (!strcmp(module, "xpointer")) return(test_xpointer());