Annotation of embedaddon/libxml2/testapi.c, revision 1.1.1.1
1.1 misho 1: /*
2: * testapi.c: libxml2 API tester program.
3: *
4: * Automatically generated by gentest.py from libxml2-api.xml
5: *
6: * See Copyright for the status of this software.
7: *
8: * daniel@veillard.com
9: */
10:
11: #ifdef HAVE_CONFIG_H
12: #include "libxml.h"
13: #else
14: #include <stdio.h>
15: #endif
16:
17: #include <stdlib.h> /* for putenv() */
18: #include <string.h>
19: #include <libxml/xmlerror.h>
20: #include <libxml/relaxng.h>
21:
22: #if defined(_WIN32) && !defined(__CYGWIN__)
23: #define snprintf _snprintf
24: #endif
25:
26: static int testlibxml2(void);
27: static int test_module(const char *module);
28:
29: static int generic_errors = 0;
30: static int call_tests = 0;
31: static int function_tests = 0;
32:
33: static xmlChar chartab[1024];
34: static int inttab[1024];
35: static unsigned long longtab[1024];
36:
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;
42:
43: static void
44: structured_errors(void *userData ATTRIBUTE_UNUSED,
45: xmlErrorPtr error ATTRIBUTE_UNUSED) {
46: generic_errors++;
47: }
48:
49: static void
50: free_api_doc(void) {
51: xmlFreeDoc(api_doc);
52: api_doc = NULL;
53: api_dtd = NULL;
54: api_root = NULL;
55: api_attr = NULL;
56: api_ns = NULL;
57: }
58:
59: static xmlDocPtr
60: get_api_doc(void) {
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);
63: api_root = NULL;
64: api_attr = NULL;
65: }
66: return(api_doc);
67: }
68:
69: static xmlDtdPtr
70: get_api_dtd(void) {
71: if ((api_dtd == NULL) || (api_dtd->type != XML_DTD_NODE)) {
72: get_api_doc();
73: if ((api_doc != NULL) && (api_doc->children != NULL) &&
74: (api_doc->children->type == XML_DTD_NODE))
75: api_dtd = (xmlDtdPtr) api_doc->children;
76: }
77: return(api_dtd);
78: }
79:
80: static xmlNodePtr
81: get_api_root(void) {
82: if ((api_root == NULL) || (api_root->type != XML_ELEMENT_NODE)) {
83: get_api_doc();
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;
88: }
89: return(api_root);
90: }
91:
92: static xmlNsPtr
93: get_api_ns(void) {
94: get_api_root();
95: if (api_root != NULL)
96: api_ns = api_root->nsDef;
97: return(api_ns);
98: }
99:
100: static xmlAttrPtr
101: get_api_attr(void) {
102: #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED)
103: static int nr = 0;
104: xmlChar name[20];
105: #endif
106:
107: if ((api_root == NULL) || (api_root->type != XML_ELEMENT_NODE)) {
108: get_api_root();
109: }
110: if (api_root == NULL)
111: return(NULL);
112: if (api_root->properties != NULL) {
113: api_attr = api_root->properties;
114: return(api_root->properties);
115: }
116: api_attr = NULL;
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");
120: #endif
121: return(api_attr);
122: }
123:
124: static int quiet = 0;
125:
126: int main(int argc, char **argv) {
127: int ret;
128: int blocks, mem;
129:
130: /* access to the proxy can slow up regression tests a lot */
131: putenv((char *) "http_proxy=");
132:
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));
137:
138: xmlInitParser();
139: #ifdef LIBXML_SCHEMAS_ENABLED
140: xmlRelaxNGInitTypes();
141: #endif
142:
143: LIBXML_TEST_VERSION
144:
145: xmlSetStructuredErrorFunc(NULL, structured_errors);
146:
147: if (argc >= 2) {
148: if (!strcmp(argv[1], "-q")) {
149: quiet = 1;
150: if (argc >= 3)
151: ret = test_module(argv[2]);
152: else
153: ret = testlibxml2();
154: } else {
155: ret = test_module(argv[1]);
156: }
157: } else
158: ret = testlibxml2();
159:
160: xmlCleanupParser();
161: blocks = xmlMemBlocks();
162: mem = xmlMemUsed();
163: if ((blocks != 0) || (mem != 0)) {
164: printf("testapi leaked %d bytes in %d blocks\n", mem, blocks);
165: }
166: xmlMemoryDump();
167:
168: return (ret != 0);
169: }
170:
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>
203:
204: /*
205: We manually define xmlErrMemory because it's normal declaration
206: is "hidden" by #ifdef IN_LIBXML
207: */
208: void xmlErrMemory(xmlParserCtxtPtr ctxt, const char *extra);
209:
210: /*
211: We need some "remote" addresses, but want to avoid getting into
212: name resolution delays, so we use these
213: */
214: #define REMOTE1GOOD "http://localhost/"
215: #define REMOTE1BAD "http:http://http"
216: #define REMOTE2GOOD "ftp://localhost/foo"
217:
218: #define gen_nb_void_ptr 2
219:
220: static void *gen_void_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
221: return(NULL);
222: }
223: static void des_void_ptr(int no ATTRIBUTE_UNUSED, void *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
224: }
225:
226: #if 0
227: #define gen_nb_const_void_ptr 2
228:
229: static const void *gen_const_void_ptr(int no, int nr ATTRIBUTE_UNUSED) {
230: if (no == 0) return((const void *) "immutable string");
231: return(NULL);
232: }
233: static void des_const_void_ptr(int no ATTRIBUTE_UNUSED, const void *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
234: }
235: #endif
236:
237: #define gen_nb_userdata 3
238:
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);
242: return(NULL);
243: }
244: static void des_userdata(int no ATTRIBUTE_UNUSED, void *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
245: }
246:
247:
248: #define gen_nb_int 4
249:
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);
255: return(-1);
256: }
257:
258: static void des_int(int no ATTRIBUTE_UNUSED, int val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
259: }
260:
261: #define gen_nb_parseroptions 5
262:
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);
269: }
270:
271: static void des_parseroptions(int no ATTRIBUTE_UNUSED, int val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
272: }
273:
274: #if 0
275: #define gen_nb_long 5
276:
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);
282: return(-1);
283: }
284:
285: static void des_long(int no ATTRIBUTE_UNUSED, long val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
286: }
287: #endif
288:
289: #define gen_nb_xmlChar 4
290:
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) 'ø');
295: return(0);
296: }
297:
298: static void des_xmlChar(int no ATTRIBUTE_UNUSED, xmlChar val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
299: }
300:
301: #define gen_nb_unsigned_int 3
302:
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);
308: }
309:
310: static void des_unsigned_int(int no ATTRIBUTE_UNUSED, unsigned int val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
311: }
312:
313: #define gen_nb_unsigned_long 4
314:
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);
320: }
321:
322: static void des_unsigned_long(int no ATTRIBUTE_UNUSED, unsigned long val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
323: }
324:
325: #define gen_nb_double 4
326:
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);
332: #endif
333: return(-1);
334: }
335:
336: static void des_double(int no ATTRIBUTE_UNUSED, double val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
337: }
338:
339: #define gen_nb_unsigned_long_ptr 2
340:
341: static unsigned long *gen_unsigned_long_ptr(int no, int nr) {
342: if (no == 0) return(&longtab[nr]);
343: return(NULL);
344: }
345:
346: static void des_unsigned_long_ptr(int no ATTRIBUTE_UNUSED, unsigned long *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
347: }
348:
349: #define gen_nb_int_ptr 2
350:
351: static int *gen_int_ptr(int no, int nr) {
352: if (no == 0) return(&inttab[nr]);
353: return(NULL);
354: }
355:
356: static void des_int_ptr(int no ATTRIBUTE_UNUSED, int *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
357: }
358:
359: #define gen_nb_const_char_ptr 4
360:
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");
365: return(NULL);
366: }
367: static void des_const_char_ptr(int no ATTRIBUTE_UNUSED, const char *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
368: }
369:
370: #define gen_nb_xmlChar_ptr 2
371:
372: static xmlChar *gen_xmlChar_ptr(int no, int nr ATTRIBUTE_UNUSED) {
373: if (no == 0) return(&chartab[0]);
374: return(NULL);
375: }
376: static void des_xmlChar_ptr(int no ATTRIBUTE_UNUSED, xmlChar *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
377: }
378:
379: #define gen_nb_FILE_ptr 2
380:
381: static FILE *gen_FILE_ptr(int no, int nr ATTRIBUTE_UNUSED) {
382: if (no == 0) return(fopen("test.out", "a+"));
383: return(NULL);
384: }
385: static void des_FILE_ptr(int no ATTRIBUTE_UNUSED, FILE *val, int nr ATTRIBUTE_UNUSED) {
386: if (val != NULL) fclose(val);
387: }
388:
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+"));
392: }
393: static void des_debug_FILE_ptr(int no ATTRIBUTE_UNUSED, FILE *val, int nr ATTRIBUTE_UNUSED) {
394: if (val != NULL) fclose(val);
395: }
396:
397: #define gen_nb_const_xmlChar_ptr 5
398:
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 ");
404: return(NULL);
405: }
406: static void des_const_xmlChar_ptr(int no ATTRIBUTE_UNUSED, const xmlChar *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
407: }
408:
409: #define gen_nb_filepath 8
410:
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);
419: return(NULL);
420: }
421: static void des_filepath(int no ATTRIBUTE_UNUSED, const char *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
422: }
423:
424: #define gen_nb_eaten_name 2
425:
426: static xmlChar *gen_eaten_name(int no, int nr ATTRIBUTE_UNUSED) {
427: if (no == 0) return(xmlStrdup(BAD_CAST "eaten"));
428: return(NULL);
429: }
430: static void des_eaten_name(int no ATTRIBUTE_UNUSED, xmlChar *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
431: }
432:
433: #define gen_nb_fileoutput 6
434:
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);
441: return(NULL);
442: }
443: static void des_fileoutput(int no ATTRIBUTE_UNUSED, const char *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
444: }
445:
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));
450: return(NULL);
451: }
452: static void des_xmlParserCtxtPtr(int no ATTRIBUTE_UNUSED, xmlParserCtxtPtr val, int nr ATTRIBUTE_UNUSED) {
453: if (val != NULL)
454: xmlFreeParserCtxt(val);
455: }
456:
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);
461: #endif
462: return(NULL);
463: }
464: static void des_xmlSAXHandlerPtr(int no ATTRIBUTE_UNUSED, xmlSAXHandlerPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
465: }
466:
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());
471: #endif
472: return(NULL);
473: }
474: static void des_xmlValidCtxtPtr(int no ATTRIBUTE_UNUSED, xmlValidCtxtPtr val, int nr ATTRIBUTE_UNUSED) {
475: #ifdef LIBXML_VALID_ENABLED
476: if (val != NULL)
477: xmlFreeValidCtxt(val);
478: #endif
479: }
480:
481: #define gen_nb_xmlParserInputBufferPtr 8
482:
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));
491: return(NULL);
492: }
493: static void des_xmlParserInputBufferPtr(int no ATTRIBUTE_UNUSED, xmlParserInputBufferPtr val, int nr ATTRIBUTE_UNUSED) {
494: xmlFreeParserInputBuffer(val);
495: }
496:
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));
502: return(NULL);
503: }
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))
506: xmlFreeDoc(val);
507: }
508:
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());
512: return(NULL);
513: }
514: static void des_xmlAttrPtr(int no, xmlAttrPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
515: if (no == 0) free_api_doc();
516: }
517:
518: #define gen_nb_xmlDictPtr 2
519: static xmlDictPtr gen_xmlDictPtr(int no, int nr ATTRIBUTE_UNUSED) {
520: if (no == 0) return(xmlDictCreate());
521: return(NULL);
522: }
523: static void des_xmlDictPtr(int no ATTRIBUTE_UNUSED, xmlDictPtr val, int nr ATTRIBUTE_UNUSED) {
524: if (val != NULL)
525: xmlDictFree(val);
526: }
527:
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());
532: return(NULL);
533: /* if (no == 2) return((xmlNodePtr) get_api_doc()); */
534: }
535: static void des_xmlNodePtr(int no, xmlNodePtr val, int nr ATTRIBUTE_UNUSED) {
536: if (no == 1) {
537: free_api_doc();
538: } else if (val != NULL) {
539: xmlUnlinkNode(val);
540: xmlFreeNode(val);
541: }
542: }
543:
544: #define gen_nb_xmlDtdPtr 3
545: static xmlDtdPtr gen_xmlDtdPtr(int no, int nr ATTRIBUTE_UNUSED) {
546: if (no == 0)
547: return(xmlNewDtd(NULL, BAD_CAST "dtd", BAD_CAST"foo", BAD_CAST"bar"));
548: if (no == 1) return(get_api_dtd());
549: return(NULL);
550: }
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);
556: }
557: }
558:
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());
562: return(NULL);
563: }
564: static void des_xmlNsPtr(int no, xmlNsPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
565: if (no == 0) free_api_doc();
566: }
567:
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"));
572: return(NULL);
573: }
574: static void des_xmlNodePtr_in(int no ATTRIBUTE_UNUSED, xmlNodePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
575: }
576:
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));
581: return(NULL);
582: }
583: static void des_xmlTextWriterPtr(int no ATTRIBUTE_UNUSED, xmlTextWriterPtr val, int nr ATTRIBUTE_UNUSED) {
584: if (val != NULL) xmlFreeTextWriter(val);
585: }
586: #endif
587:
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"));
594: return(NULL);
595: }
596: static void des_xmlTextReaderPtr(int no ATTRIBUTE_UNUSED, xmlTextReaderPtr val, int nr ATTRIBUTE_UNUSED) {
597: if (val != NULL) xmlFreeTextReader(val);
598: }
599: #endif
600:
601: #define gen_nb_xmlBufferPtr 3
602: static const char *static_buf_content = "a static buffer";
603: static xmlBufferPtr gen_xmlBufferPtr(int no, int nr ATTRIBUTE_UNUSED) {
604: if (no == 0) return(xmlBufferCreate());
605: if (no == 1) return(xmlBufferCreateStatic((void *)static_buf_content, 13));
606: return(NULL);
607: }
608: static void des_xmlBufferPtr(int no ATTRIBUTE_UNUSED, xmlBufferPtr val, int nr ATTRIBUTE_UNUSED) {
609: if (val != NULL) {
610: xmlBufferFree(val);
611: }
612: }
613:
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));
617: return(NULL);
618: }
619: static void des_xmlListPtr(int no ATTRIBUTE_UNUSED, xmlListPtr val, int nr ATTRIBUTE_UNUSED) {
620: if (val != NULL) {
621: xmlListDelete(val);
622: }
623: }
624:
625: #define gen_nb_xmlHashTablePtr 2
626: static xmlHashTablePtr gen_xmlHashTablePtr(int no, int nr ATTRIBUTE_UNUSED) {
627: if (no == 0) return(xmlHashCreate(10));
628: return(NULL);
629: }
630: static void des_xmlHashTablePtr(int no ATTRIBUTE_UNUSED, xmlHashTablePtr val, int nr ATTRIBUTE_UNUSED) {
631: if (val != NULL) {
632: xmlHashFree(val, NULL);
633: }
634: }
635:
636: #include <libxml/xpathInternals.h>
637:
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));
645: return(NULL);
646: }
647: static void des_xmlXPathObjectPtr(int no ATTRIBUTE_UNUSED, xmlXPathObjectPtr val, int nr ATTRIBUTE_UNUSED) {
648: if (val != NULL) {
649: xmlXPathFreeObject(val);
650: }
651: }
652: #endif
653:
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));
658: return(NULL);
659: }
660: static void des_xmlOutputBufferPtr(int no ATTRIBUTE_UNUSED, xmlOutputBufferPtr val, int nr ATTRIBUTE_UNUSED) {
661: if (val != NULL) {
662: xmlOutputBufferClose(val);
663: }
664: }
665: #endif
666:
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"));
673: return(NULL);
674: }
675: static void des_xmlNanoFTPCtxtPtr(int no ATTRIBUTE_UNUSED, void *val, int nr ATTRIBUTE_UNUSED) {
676: if (val != NULL) {
677: xmlNanoFTPFreeCtxt(val);
678: }
679: }
680: #endif
681:
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));
688: return(NULL);
689: }
690: static void des_xmlNanoHTTPCtxtPtr(int no ATTRIBUTE_UNUSED, void *val, int nr ATTRIBUTE_UNUSED) {
691: if (val != NULL) {
692: xmlNanoHTTPClose(val);
693: }
694: }
695: #endif
696:
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);
703: }
704: static void des_xmlCharEncoding(int no ATTRIBUTE_UNUSED, xmlCharEncoding val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
705: }
706:
707: #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
708:
709: #define gen_nb_xmlExpCtxtPtr 1
710: static xmlExpCtxtPtr gen_xmlExpCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
711: return(NULL);
712: }
713: static void des_xmlExpCtxtPtr(int no ATTRIBUTE_UNUSED, xmlExpCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
714: }
715:
716: #define gen_nb_xmlExpNodePtr 1
717: static xmlExpNodePtr gen_xmlExpNodePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
718: return(NULL);
719: }
720: static void des_xmlExpNodePtr(int no ATTRIBUTE_UNUSED, xmlExpNodePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
721: }
722:
723: #endif
724:
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) {
728: return(NULL);
729: }
730: static void des_xmlSchemaPtr(int no ATTRIBUTE_UNUSED, xmlSchemaPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
731: }
732:
733: #define gen_nb_xmlSchemaValidCtxtPtr 1
734: static xmlSchemaValidCtxtPtr gen_xmlSchemaValidCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
735: return(NULL);
736: }
737: static void des_xmlSchemaValidCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSchemaValidCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
738: }
739:
740: #endif /* LIBXML_SCHEMAS_ENABLED */
741:
742: #define gen_nb_xmlHashDeallocator 2
743: static void
744: test_xmlHashDeallocator(void *payload ATTRIBUTE_UNUSED, xmlChar *name ATTRIBUTE_UNUSED) {
745: }
746:
747: static xmlHashDeallocator gen_xmlHashDeallocator(int no, int nr ATTRIBUTE_UNUSED) {
748: if (no == 0) return(test_xmlHashDeallocator);
749: return(NULL);
750: }
751: static void des_xmlHashDeallocator(int no ATTRIBUTE_UNUSED, xmlHashDeallocator val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
752: }
753:
754:
755: static void desret_int(int val ATTRIBUTE_UNUSED) {
756: }
757: static void desret_xmlChar(xmlChar val ATTRIBUTE_UNUSED) {
758: }
759: static void desret_long(long val ATTRIBUTE_UNUSED) {
760: }
761: static void desret_unsigned_long(unsigned long val ATTRIBUTE_UNUSED) {
762: }
763: static void desret_double(double val ATTRIBUTE_UNUSED) {
764: }
765: static void desret_xmlCharEncoding(xmlCharEncoding val ATTRIBUTE_UNUSED) {
766: }
767: #if 0
768: static void desret_const_void_ptr(void *val ATTRIBUTE_UNUSED) {
769: }
770: #endif
771: static void desret_void_ptr(void *val ATTRIBUTE_UNUSED) {
772: }
773: static void desret_const_char_ptr(const char *val ATTRIBUTE_UNUSED) {
774: }
775: static void desret_const_xmlChar_ptr(const xmlChar *val ATTRIBUTE_UNUSED) {
776: }
777: static void desret_xmlChar_ptr(xmlChar *val) {
778: if (val != NULL)
779: xmlFree(val);
780: }
781: static void desret_xmlDocPtr(xmlDocPtr val) {
782: if (val != api_doc)
783: xmlFreeDoc(val);
784: }
785: static void desret_xmlDictPtr(xmlDictPtr val) {
786: xmlDictFree(val);
787: }
788: #ifdef LIBXML_OUTPUT_ENABLED
789: static void desret_xmlOutputBufferPtr(xmlOutputBufferPtr val) {
790: xmlOutputBufferClose(val);
791: }
792: #endif
793: #ifdef LIBXML_READER_ENABLED
794: static void desret_xmlTextReaderPtr(xmlTextReaderPtr val) {
795: xmlFreeTextReader(val);
796: }
797: #endif
798: static void desret_xmlNodePtr(xmlNodePtr val) {
799: if ((val != NULL) && (val != api_root) && (val != (xmlNodePtr) api_doc)) {
800: xmlUnlinkNode(val);
801: xmlFreeNode(val);
802: }
803: }
804: static void desret_xmlAttrPtr(xmlAttrPtr val) {
805: if (val != NULL) {
806: xmlUnlinkNode((xmlNodePtr) val);
807: xmlFreeNode((xmlNodePtr) val);
808: }
809: }
810: static void desret_xmlEntityPtr(xmlEntityPtr val) {
811: if (val != NULL) {
812: xmlUnlinkNode((xmlNodePtr) val);
813: xmlFreeNode((xmlNodePtr) val);
814: }
815: }
816: static void desret_xmlElementPtr(xmlElementPtr val) {
817: if (val != NULL) {
818: xmlUnlinkNode((xmlNodePtr) val);
819: }
820: }
821: static void desret_xmlAttributePtr(xmlAttributePtr val) {
822: if (val != NULL) {
823: xmlUnlinkNode((xmlNodePtr) val);
824: }
825: }
826: static void desret_xmlNsPtr(xmlNsPtr val ATTRIBUTE_UNUSED) {
827: }
828: static void desret_xmlDtdPtr(xmlDtdPtr val) {
829: desret_xmlNodePtr((xmlNodePtr)val);
830: }
831: #ifdef LIBXML_XPATH_ENABLED
832: static void desret_xmlXPathObjectPtr(xmlXPathObjectPtr val) {
833: xmlXPathFreeObject(val);
834: }
835: static void desret_xmlNodeSetPtr(xmlNodeSetPtr val) {
836: xmlXPathFreeNodeSet(val);
837: }
838: #endif
839: static void desret_xmlParserCtxtPtr(xmlParserCtxtPtr val) {
840: xmlFreeParserCtxt(val);
841: }
842: static void desret_xmlParserInputBufferPtr(xmlParserInputBufferPtr val) {
843: xmlFreeParserInputBuffer(val);
844: }
845: static void desret_xmlParserInputPtr(xmlParserInputPtr val) {
846: xmlFreeInputStream(val);
847: }
848: #ifdef LIBXML_WRITER_ENABLED
849: static void desret_xmlTextWriterPtr(xmlTextWriterPtr val) {
850: xmlFreeTextWriter(val);
851: }
852: #endif
853: static void desret_xmlBufferPtr(xmlBufferPtr val) {
854: xmlBufferFree(val);
855: }
856: #ifdef LIBXML_SCHEMAS_ENABLED
857: static void desret_xmlSchemaParserCtxtPtr(xmlSchemaParserCtxtPtr val) {
858: xmlSchemaFreeParserCtxt(val);
859: }
860: static void desret_xmlSchemaTypePtr(xmlSchemaTypePtr val ATTRIBUTE_UNUSED) {
861: }
862: static void desret_xmlRelaxNGParserCtxtPtr(xmlRelaxNGParserCtxtPtr val) {
863: xmlRelaxNGFreeParserCtxt(val);
864: }
865: #endif
866: #ifdef LIBXML_HTML_ENABLED
867: static void desret_const_htmlEntityDesc_ptr(const htmlEntityDesc * val ATTRIBUTE_UNUSED) {
868: }
869: #endif
870: #ifdef LIBXML_HTTP_ENABLED
871: static void desret_xmlNanoHTTPCtxtPtr(void *val) {
872: xmlNanoHTTPClose(val);
873: }
874: #endif
875: #ifdef LIBXML_FTP_ENABLED
876: static void desret_xmlNanoFTPCtxtPtr(void *val) {
877: xmlNanoFTPClose(val);
878: }
879: #endif
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) {
883: return(NULL);
884: }
885: static void des_const_xmlChar_ptr_ptr(int no ATTRIBUTE_UNUSED, const xmlChar ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
886: }
887:
888: #define gen_nb_unsigned_char_ptr 1
889: static unsigned char * gen_unsigned_char_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
890: return(NULL);
891: }
892: static void des_unsigned_char_ptr(int no ATTRIBUTE_UNUSED, unsigned char * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
893: }
894:
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) {
897: return(NULL);
898: }
899: static void des_const_unsigned_char_ptr(int no ATTRIBUTE_UNUSED, const unsigned char * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
900: }
901:
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) {
905: return(NULL);
906: }
907: static void des_const_htmlNodePtr(int no ATTRIBUTE_UNUSED, const htmlNodePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
908: }
909: #endif
910:
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));
916: return(NULL);
917: }
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))
920: xmlFreeDoc(val);
921: }
922: static void desret_htmlDocPtr(htmlDocPtr val) {
923: if ((val != NULL) && (val != api_doc) && (val->doc != api_doc))
924: xmlFreeDoc(val);
925: }
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));
930: return(NULL);
931: }
932: static void des_htmlParserCtxtPtr(int no ATTRIBUTE_UNUSED, htmlParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
933: if (val != NULL)
934: htmlFreeParserCtxt(val);
935: }
936: static void desret_htmlParserCtxtPtr(htmlParserCtxtPtr val) {
937: if (val != NULL)
938: htmlFreeParserCtxt(val);
939: }
940: #endif
941:
942: #ifdef LIBXML_XPATH_ENABLED
943: #define gen_nb_xmlNodeSetPtr 1
944: static xmlNodeSetPtr gen_xmlNodeSetPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
945: return(NULL);
946: }
947: static void des_xmlNodeSetPtr(int no ATTRIBUTE_UNUSED, xmlNodeSetPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
948: }
949: #endif
950:
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) {
955: return(NULL);
956: }
957: static void des_xmlShellCtxtPtr(int no ATTRIBUTE_UNUSED, xmlShellCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
958: }
959: #endif
960: #endif
961:
962: #ifdef LIBXML_PATTERN_ENABLED
963: #define gen_nb_xmlPatternPtr 1
964: static xmlPatternPtr gen_xmlPatternPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
965: return(NULL);
966: }
967: static void des_xmlPatternPtr(int no ATTRIBUTE_UNUSED, xmlPatternPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
968: }
969: #endif
970:
971: #define gen_nb_xmlElementContentPtr 1
972: static xmlElementContentPtr gen_xmlElementContentPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
973: return(NULL);
974: }
975: static void des_xmlElementContentPtr(int no ATTRIBUTE_UNUSED, xmlElementContentPtr val, int nr ATTRIBUTE_UNUSED) {
976: if (val != NULL)
977: xmlFreeElementContent(val);
978: }
979: static void desret_xmlElementContentPtr(xmlElementContentPtr val) {
980: if (val != NULL)
981: xmlFreeElementContent(val);
982: }
983:
984: #define gen_nb_xmlParserNodeInfoSeqPtr 1
985: static xmlParserNodeInfoSeqPtr gen_xmlParserNodeInfoSeqPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
986: return(NULL);
987: }
988: static void des_xmlParserNodeInfoSeqPtr(int no ATTRIBUTE_UNUSED, xmlParserNodeInfoSeqPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
989: }
990:
991: static void desret_const_xmlParserNodeInfo_ptr(const xmlParserNodeInfo *val ATTRIBUTE_UNUSED) {
992: }
993:
994: #define gen_nb_void_ptr_ptr 1
995: static void ** gen_void_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
996: return(NULL);
997: }
998: static void des_void_ptr_ptr(int no ATTRIBUTE_UNUSED, void ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
999: }
1000:
1001: /************************************************************************
1002: * *
1003: * WARNING: end of the manually maintained part of the test code *
1004: * do not remove or alter the CUT HERE line *
1005: * *
1006: ************************************************************************/
1007:
1008: /* CUT HERE: everything below that line is generated */
1009: #ifdef LIBXML_HTML_ENABLED
1010: static void desret_htmlStatus(htmlStatus val ATTRIBUTE_UNUSED) {
1011: }
1012:
1013: #endif
1014:
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);
1021: return(0);
1022: }
1023:
1024: static void des_xmlAttributeDefault(int no ATTRIBUTE_UNUSED, xmlAttributeDefault val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1025: }
1026:
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);
1033: return(0);
1034: }
1035:
1036: static void des_xmlAttributeType(int no ATTRIBUTE_UNUSED, xmlAttributeType val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1037: }
1038:
1039: #define gen_nb_xmlBufferAllocationScheme 4
1040: static xmlBufferAllocationScheme gen_xmlBufferAllocationScheme(int no, int nr ATTRIBUTE_UNUSED) {
1041: if (no == 1) return(XML_BUFFER_ALLOC_DOUBLEIT);
1042: if (no == 2) return(XML_BUFFER_ALLOC_EXACT);
1043: if (no == 3) return(XML_BUFFER_ALLOC_IMMUTABLE);
1044: if (no == 4) return(XML_BUFFER_ALLOC_IO);
1045: return(0);
1046: }
1047:
1048: static void des_xmlBufferAllocationScheme(int no ATTRIBUTE_UNUSED, xmlBufferAllocationScheme val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1049: }
1050:
1051: static void desret_xmlBufferAllocationScheme(xmlBufferAllocationScheme val ATTRIBUTE_UNUSED) {
1052: }
1053:
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);
1061: return(0);
1062: }
1063:
1064: static void des_xmlCatalogAllow(int no ATTRIBUTE_UNUSED, xmlCatalogAllow val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1065: }
1066:
1067: static void desret_xmlCatalogAllow(xmlCatalogAllow val ATTRIBUTE_UNUSED) {
1068: }
1069:
1070: #endif
1071:
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);
1078: return(0);
1079: }
1080:
1081: static void des_xmlCatalogPrefer(int no ATTRIBUTE_UNUSED, xmlCatalogPrefer val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1082: }
1083:
1084: static void desret_xmlCatalogPrefer(xmlCatalogPrefer val ATTRIBUTE_UNUSED) {
1085: }
1086:
1087: #endif
1088:
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);
1095: return(0);
1096: }
1097:
1098: static void des_xmlElementContentType(int no ATTRIBUTE_UNUSED, xmlElementContentType val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1099: }
1100:
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);
1107: return(0);
1108: }
1109:
1110: static void des_xmlElementTypeVal(int no ATTRIBUTE_UNUSED, xmlElementTypeVal val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1111: }
1112:
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);
1119: return(0);
1120: }
1121:
1122: static void des_xmlFeature(int no ATTRIBUTE_UNUSED, xmlFeature val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1123: }
1124:
1125: static void desret_xmlParserErrors(xmlParserErrors val ATTRIBUTE_UNUSED) {
1126: }
1127:
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);
1135: return(0);
1136: }
1137:
1138: static void des_xmlSchemaValType(int no ATTRIBUTE_UNUSED, xmlSchemaValType val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1139: }
1140:
1141: static void desret_xmlSchemaValType(xmlSchemaValType val ATTRIBUTE_UNUSED) {
1142: }
1143:
1144: #endif
1145:
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);
1153: return(0);
1154: }
1155:
1156: static void des_xmlSchemaWhitespaceValueType(int no ATTRIBUTE_UNUSED, xmlSchemaWhitespaceValueType val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1157: }
1158:
1159: #endif
1160:
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);
1239:
1240: /**
1241: * testlibxml2:
1242: *
1243: * Main entry point of the tester for the full libxml2 module,
1244: * it calls all the tester entry point for each module.
1245: *
1246: * Returns the number of error found
1247: */
1248: static int
1249: testlibxml2(void)
1250: {
1251: int test_ret = 0;
1252:
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();
1292:
1293: printf("Total: %d functions, %d tests, %d errors\n",
1294: function_tests, call_tests, test_ret);
1295: return(test_ret);
1296: }
1297:
1298:
1299: static int
1300: test_UTF8ToHtml(void) {
1301: int test_ret = 0;
1302:
1303: #if defined(LIBXML_HTML_ENABLED)
1304: int mem_base;
1305: int ret_val;
1306: unsigned char * out; /* a pointer to an array of bytes to store the result */
1307: int n_out;
1308: int * outlen; /* the length of @out */
1309: int n_outlen;
1310: unsigned char * in; /* a pointer to an array of UTF-8 chars */
1311: int n_in;
1312: int * inlen; /* the length of @in */
1313: int n_inlen;
1314:
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);
1324:
1325: ret_val = UTF8ToHtml(out, outlen, (const unsigned char *)in, inlen);
1326: desret_int(ret_val);
1327: call_tests++;
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);
1336: test_ret++;
1337: printf(" %d", n_out);
1338: printf(" %d", n_outlen);
1339: printf(" %d", n_in);
1340: printf(" %d", n_inlen);
1341: printf("\n");
1342: }
1343: }
1344: }
1345: }
1346: }
1347: function_tests++;
1348: #endif
1349:
1350: return(test_ret);
1351: }
1352:
1353: #ifdef LIBXML_HTML_ENABLED
1354:
1355: #define gen_nb_const_htmlElemDesc_ptr 1
1356: static htmlElemDesc * gen_const_htmlElemDesc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1357: return(NULL);
1358: }
1359: static void des_const_htmlElemDesc_ptr(int no ATTRIBUTE_UNUSED, const htmlElemDesc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1360: }
1361: #endif
1362:
1363:
1364: static int
1365: test_htmlAttrAllowed(void) {
1366: int test_ret = 0;
1367:
1368: #if defined(LIBXML_HTML_ENABLED)
1369: int mem_base;
1370: htmlStatus ret_val;
1371: htmlElemDesc * elt; /* HTML element */
1372: int n_elt;
1373: xmlChar * attr; /* HTML attribute */
1374: int n_attr;
1375: int legacy; /* whether to allow deprecated attributes */
1376: int n_legacy;
1377:
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);
1385:
1386: ret_val = htmlAttrAllowed((const htmlElemDesc *)elt, (const xmlChar *)attr, legacy);
1387: desret_htmlStatus(ret_val);
1388: call_tests++;
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);
1396: test_ret++;
1397: printf(" %d", n_elt);
1398: printf(" %d", n_attr);
1399: printf(" %d", n_legacy);
1400: printf("\n");
1401: }
1402: }
1403: }
1404: }
1405: function_tests++;
1406: #endif
1407:
1408: return(test_ret);
1409: }
1410:
1411: #ifdef LIBXML_HTML_ENABLED
1412:
1413: #define gen_nb_htmlNodePtr 1
1414: static htmlNodePtr gen_htmlNodePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1415: return(NULL);
1416: }
1417: static void des_htmlNodePtr(int no ATTRIBUTE_UNUSED, htmlNodePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1418: }
1419: #endif
1420:
1421:
1422: static int
1423: test_htmlAutoCloseTag(void) {
1424: int test_ret = 0;
1425:
1426: #if defined(LIBXML_HTML_ENABLED)
1427: int mem_base;
1428: int ret_val;
1429: htmlDocPtr doc; /* the HTML document */
1430: int n_doc;
1431: xmlChar * name; /* The tag name */
1432: int n_name;
1433: htmlNodePtr elem; /* the HTML element */
1434: int n_elem;
1435:
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);
1443:
1444: ret_val = htmlAutoCloseTag(doc, (const xmlChar *)name, elem);
1445: desret_int(ret_val);
1446: call_tests++;
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);
1454: test_ret++;
1455: printf(" %d", n_doc);
1456: printf(" %d", n_name);
1457: printf(" %d", n_elem);
1458: printf("\n");
1459: }
1460: }
1461: }
1462: }
1463: function_tests++;
1464: #endif
1465:
1466: return(test_ret);
1467: }
1468:
1469:
1470: static int
1471: test_htmlCreateMemoryParserCtxt(void) {
1472: int test_ret = 0;
1473:
1474: #if defined(LIBXML_HTML_ENABLED)
1475: int mem_base;
1476: htmlParserCtxtPtr ret_val;
1477: char * buffer; /* a pointer to a char array */
1478: int n_buffer;
1479: int size; /* the size of the array */
1480: int n_size;
1481:
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);
1487:
1488: ret_val = htmlCreateMemoryParserCtxt((const char *)buffer, size);
1489: desret_htmlParserCtxtPtr(ret_val);
1490: call_tests++;
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);
1497: test_ret++;
1498: printf(" %d", n_buffer);
1499: printf(" %d", n_size);
1500: printf("\n");
1501: }
1502: }
1503: }
1504: function_tests++;
1505: #endif
1506:
1507: return(test_ret);
1508: }
1509:
1510: #ifdef LIBXML_HTML_ENABLED
1511:
1512: #define gen_nb_htmlSAXHandlerPtr 1
1513: static htmlSAXHandlerPtr gen_htmlSAXHandlerPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1514: return(NULL);
1515: }
1516: static void des_htmlSAXHandlerPtr(int no ATTRIBUTE_UNUSED, htmlSAXHandlerPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1517: }
1518: #endif
1519:
1520:
1521: static int
1522: test_htmlCreatePushParserCtxt(void) {
1523: int test_ret = 0;
1524:
1525: #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_PUSH_ENABLED)
1526: int mem_base;
1527: htmlParserCtxtPtr ret_val;
1528: htmlSAXHandlerPtr sax; /* a SAX handler */
1529: int n_sax;
1530: void * user_data; /* The user data returned on SAX callbacks */
1531: int n_user_data;
1532: char * chunk; /* a pointer to an array of chars */
1533: int n_chunk;
1534: int size; /* number of chars in the array */
1535: int n_size;
1536: const char * filename; /* an optional file name or URI */
1537: int n_filename;
1538: xmlCharEncoding enc; /* an optional encoding */
1539: int n_enc;
1540:
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);
1554:
1555: ret_val = htmlCreatePushParserCtxt(sax, user_data, (const char *)chunk, size, filename, enc);
1556: desret_htmlParserCtxtPtr(ret_val);
1557: call_tests++;
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);
1568: test_ret++;
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);
1575: printf("\n");
1576: }
1577: }
1578: }
1579: }
1580: }
1581: }
1582: }
1583: function_tests++;
1584: #endif
1585:
1586: return(test_ret);
1587: }
1588:
1589:
1590: static int
1591: test_htmlCtxtReadDoc(void) {
1592: int test_ret = 0;
1593:
1594: #if defined(LIBXML_HTML_ENABLED)
1595: int mem_base;
1596: htmlDocPtr ret_val;
1597: htmlParserCtxtPtr ctxt; /* an HTML parser context */
1598: int n_ctxt;
1599: xmlChar * cur; /* a pointer to a zero terminated string */
1600: int n_cur;
1601: const char * URL; /* the base URL to use for the document */
1602: int n_URL;
1603: char * encoding; /* the document encoding, or NULL */
1604: int n_encoding;
1605: int options; /* a combination of htmlParserOption(s) */
1606: int n_options;
1607:
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);
1619:
1620: ret_val = htmlCtxtReadDoc(ctxt, (const xmlChar *)cur, URL, (const char *)encoding, options);
1621: desret_htmlDocPtr(ret_val);
1622: call_tests++;
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);
1632: test_ret++;
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);
1638: printf("\n");
1639: }
1640: }
1641: }
1642: }
1643: }
1644: }
1645: function_tests++;
1646: #endif
1647:
1648: return(test_ret);
1649: }
1650:
1651:
1652: static int
1653: test_htmlCtxtReadFile(void) {
1654: int test_ret = 0;
1655:
1656: #if defined(LIBXML_HTML_ENABLED)
1657: htmlDocPtr ret_val;
1658: htmlParserCtxtPtr ctxt; /* an HTML parser context */
1659: int n_ctxt;
1660: const char * filename; /* a file or URL */
1661: int n_filename;
1662: char * encoding; /* the document encoding, or NULL */
1663: int n_encoding;
1664: int options; /* a combination of htmlParserOption(s) */
1665: int n_options;
1666:
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);
1675:
1676: ret_val = htmlCtxtReadFile(ctxt, filename, (const char *)encoding, options);
1677: desret_htmlDocPtr(ret_val);
1678: call_tests++;
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();
1684: }
1685: }
1686: }
1687: }
1688: function_tests++;
1689: #endif
1690:
1691: return(test_ret);
1692: }
1693:
1694:
1695: static int
1696: test_htmlCtxtReadMemory(void) {
1697: int test_ret = 0;
1698:
1699: #if defined(LIBXML_HTML_ENABLED)
1700: int mem_base;
1701: htmlDocPtr ret_val;
1702: htmlParserCtxtPtr ctxt; /* an HTML parser context */
1703: int n_ctxt;
1704: char * buffer; /* a pointer to a char array */
1705: int n_buffer;
1706: int size; /* the size of the array */
1707: int n_size;
1708: const char * URL; /* the base URL to use for the document */
1709: int n_URL;
1710: char * encoding; /* the document encoding, or NULL */
1711: int n_encoding;
1712: int options; /* a combination of htmlParserOption(s) */
1713: int n_options;
1714:
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);
1728:
1729: ret_val = htmlCtxtReadMemory(ctxt, (const char *)buffer, size, URL, (const char *)encoding, options);
1730: desret_htmlDocPtr(ret_val);
1731: call_tests++;
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);
1742: test_ret++;
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);
1749: printf("\n");
1750: }
1751: }
1752: }
1753: }
1754: }
1755: }
1756: }
1757: function_tests++;
1758: #endif
1759:
1760: return(test_ret);
1761: }
1762:
1763:
1764: static int
1765: test_htmlCtxtReset(void) {
1766: int test_ret = 0;
1767:
1768: #if defined(LIBXML_HTML_ENABLED)
1769: int mem_base;
1770: htmlParserCtxtPtr ctxt; /* an HTML parser context */
1771: int n_ctxt;
1772:
1773: for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
1774: mem_base = xmlMemBlocks();
1775: ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
1776:
1777: htmlCtxtReset(ctxt);
1778: call_tests++;
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);
1784: test_ret++;
1785: printf(" %d", n_ctxt);
1786: printf("\n");
1787: }
1788: }
1789: function_tests++;
1790: #endif
1791:
1792: return(test_ret);
1793: }
1794:
1795:
1796: static int
1797: test_htmlCtxtUseOptions(void) {
1798: int test_ret = 0;
1799:
1800: #if defined(LIBXML_HTML_ENABLED)
1801: int mem_base;
1802: int ret_val;
1803: htmlParserCtxtPtr ctxt; /* an HTML parser context */
1804: int n_ctxt;
1805: int options; /* a combination of htmlParserOption(s) */
1806: int n_options;
1807:
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);
1813:
1814: ret_val = htmlCtxtUseOptions(ctxt, options);
1815: desret_int(ret_val);
1816: call_tests++;
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);
1823: test_ret++;
1824: printf(" %d", n_ctxt);
1825: printf(" %d", n_options);
1826: printf("\n");
1827: }
1828: }
1829: }
1830: function_tests++;
1831: #endif
1832:
1833: return(test_ret);
1834: }
1835:
1836:
1837: static int
1838: test_htmlElementAllowedHere(void) {
1839: int test_ret = 0;
1840:
1841: #if defined(LIBXML_HTML_ENABLED)
1842: int mem_base;
1843: int ret_val;
1844: htmlElemDesc * parent; /* HTML parent element */
1845: int n_parent;
1846: xmlChar * elt; /* HTML element */
1847: int n_elt;
1848:
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);
1854:
1855: ret_val = htmlElementAllowedHere((const htmlElemDesc *)parent, (const xmlChar *)elt);
1856: desret_int(ret_val);
1857: call_tests++;
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);
1864: test_ret++;
1865: printf(" %d", n_parent);
1866: printf(" %d", n_elt);
1867: printf("\n");
1868: }
1869: }
1870: }
1871: function_tests++;
1872: #endif
1873:
1874: return(test_ret);
1875: }
1876:
1877:
1878: static int
1879: test_htmlElementStatusHere(void) {
1880: int test_ret = 0;
1881:
1882: #if defined(LIBXML_HTML_ENABLED)
1883: int mem_base;
1884: htmlStatus ret_val;
1885: htmlElemDesc * parent; /* HTML parent element */
1886: int n_parent;
1887: htmlElemDesc * elt; /* HTML element */
1888: int n_elt;
1889:
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);
1895:
1896: ret_val = htmlElementStatusHere((const htmlElemDesc *)parent, (const htmlElemDesc *)elt);
1897: desret_htmlStatus(ret_val);
1898: call_tests++;
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);
1905: test_ret++;
1906: printf(" %d", n_parent);
1907: printf(" %d", n_elt);
1908: printf("\n");
1909: }
1910: }
1911: }
1912: function_tests++;
1913: #endif
1914:
1915: return(test_ret);
1916: }
1917:
1918:
1919: static int
1920: test_htmlEncodeEntities(void) {
1921: int test_ret = 0;
1922:
1923: #if defined(LIBXML_HTML_ENABLED)
1924: int mem_base;
1925: int ret_val;
1926: unsigned char * out; /* a pointer to an array of bytes to store the result */
1927: int n_out;
1928: int * outlen; /* the length of @out */
1929: int n_outlen;
1930: unsigned char * in; /* a pointer to an array of UTF-8 chars */
1931: int n_in;
1932: int * inlen; /* the length of @in */
1933: int n_inlen;
1934: int quoteChar; /* the quote character to escape (' or ") or zero. */
1935: int n_quoteChar;
1936:
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);
1948:
1949: ret_val = htmlEncodeEntities(out, outlen, (const unsigned char *)in, inlen, quoteChar);
1950: desret_int(ret_val);
1951: call_tests++;
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);
1961: test_ret++;
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);
1967: printf("\n");
1968: }
1969: }
1970: }
1971: }
1972: }
1973: }
1974: function_tests++;
1975: #endif
1976:
1977: return(test_ret);
1978: }
1979:
1980:
1981: static int
1982: test_htmlEntityLookup(void) {
1983: int test_ret = 0;
1984:
1985: #if defined(LIBXML_HTML_ENABLED)
1986: int mem_base;
1987: const htmlEntityDesc * ret_val;
1988: xmlChar * name; /* the entity name */
1989: int n_name;
1990:
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);
1994:
1995: ret_val = htmlEntityLookup((const xmlChar *)name);
1996: desret_const_htmlEntityDesc_ptr(ret_val);
1997: call_tests++;
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);
2003: test_ret++;
2004: printf(" %d", n_name);
2005: printf("\n");
2006: }
2007: }
2008: function_tests++;
2009: #endif
2010:
2011: return(test_ret);
2012: }
2013:
2014:
2015: static int
2016: test_htmlEntityValueLookup(void) {
2017: int test_ret = 0;
2018:
2019: #if defined(LIBXML_HTML_ENABLED)
2020: int mem_base;
2021: const htmlEntityDesc * ret_val;
2022: unsigned int value; /* the entity's unicode value */
2023: int n_value;
2024:
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);
2028:
2029: ret_val = htmlEntityValueLookup(value);
2030: desret_const_htmlEntityDesc_ptr(ret_val);
2031: call_tests++;
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);
2037: test_ret++;
2038: printf(" %d", n_value);
2039: printf("\n");
2040: }
2041: }
2042: function_tests++;
2043: #endif
2044:
2045: return(test_ret);
2046: }
2047:
2048:
2049: static int
2050: test_htmlHandleOmittedElem(void) {
2051: int test_ret = 0;
2052:
2053: #if defined(LIBXML_HTML_ENABLED)
2054: int mem_base;
2055: int ret_val;
2056: int val; /* int 0 or 1 */
2057: int n_val;
2058:
2059: for (n_val = 0;n_val < gen_nb_int;n_val++) {
2060: mem_base = xmlMemBlocks();
2061: val = gen_int(n_val, 0);
2062:
2063: ret_val = htmlHandleOmittedElem(val);
2064: desret_int(ret_val);
2065: call_tests++;
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);
2071: test_ret++;
2072: printf(" %d", n_val);
2073: printf("\n");
2074: }
2075: }
2076: function_tests++;
2077: #endif
2078:
2079: return(test_ret);
2080: }
2081:
2082:
2083: static int
2084: test_htmlIsAutoClosed(void) {
2085: int test_ret = 0;
2086:
2087: #if defined(LIBXML_HTML_ENABLED)
2088: int mem_base;
2089: int ret_val;
2090: htmlDocPtr doc; /* the HTML document */
2091: int n_doc;
2092: htmlNodePtr elem; /* the HTML element */
2093: int n_elem;
2094:
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);
2100:
2101: ret_val = htmlIsAutoClosed(doc, elem);
2102: desret_int(ret_val);
2103: call_tests++;
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);
2110: test_ret++;
2111: printf(" %d", n_doc);
2112: printf(" %d", n_elem);
2113: printf("\n");
2114: }
2115: }
2116: }
2117: function_tests++;
2118: #endif
2119:
2120: return(test_ret);
2121: }
2122:
2123:
2124: static int
2125: test_htmlIsScriptAttribute(void) {
2126: int test_ret = 0;
2127:
2128: #if defined(LIBXML_HTML_ENABLED)
2129: int mem_base;
2130: int ret_val;
2131: xmlChar * name; /* an attribute name */
2132: int n_name;
2133:
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);
2137:
2138: ret_val = htmlIsScriptAttribute((const xmlChar *)name);
2139: desret_int(ret_val);
2140: call_tests++;
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);
2146: test_ret++;
2147: printf(" %d", n_name);
2148: printf("\n");
2149: }
2150: }
2151: function_tests++;
2152: #endif
2153:
2154: return(test_ret);
2155: }
2156:
2157:
2158: static int
2159: test_htmlNewParserCtxt(void) {
2160: int test_ret = 0;
2161:
2162: #if defined(LIBXML_HTML_ENABLED)
2163: int mem_base;
2164: htmlParserCtxtPtr ret_val;
2165:
2166: mem_base = xmlMemBlocks();
2167:
2168: ret_val = htmlNewParserCtxt();
2169: desret_htmlParserCtxtPtr(ret_val);
2170: call_tests++;
2171: xmlResetLastError();
2172: if (mem_base != xmlMemBlocks()) {
2173: printf("Leak of %d blocks found in htmlNewParserCtxt",
2174: xmlMemBlocks() - mem_base);
2175: test_ret++;
2176: printf("\n");
2177: }
2178: function_tests++;
2179: #endif
2180:
2181: return(test_ret);
2182: }
2183:
2184:
2185: static int
2186: test_htmlNodeStatus(void) {
2187: int test_ret = 0;
2188:
2189: #if defined(LIBXML_HTML_ENABLED)
2190: int mem_base;
2191: htmlStatus ret_val;
2192: htmlNodePtr node; /* an htmlNodePtr in a tree */
2193: int n_node;
2194: int legacy; /* whether to allow deprecated elements (YES is faster here for Element nodes) */
2195: int n_legacy;
2196:
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);
2202:
2203: ret_val = htmlNodeStatus((const htmlNodePtr)node, legacy);
2204: desret_htmlStatus(ret_val);
2205: call_tests++;
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);
2212: test_ret++;
2213: printf(" %d", n_node);
2214: printf(" %d", n_legacy);
2215: printf("\n");
2216: }
2217: }
2218: }
2219: function_tests++;
2220: #endif
2221:
2222: return(test_ret);
2223: }
2224:
2225:
2226: static int
2227: test_htmlParseCharRef(void) {
2228: int test_ret = 0;
2229:
2230: #if defined(LIBXML_HTML_ENABLED)
2231: int mem_base;
2232: int ret_val;
2233: htmlParserCtxtPtr ctxt; /* an HTML parser context */
2234: int n_ctxt;
2235:
2236: for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
2237: mem_base = xmlMemBlocks();
2238: ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
2239:
2240: ret_val = htmlParseCharRef(ctxt);
2241: desret_int(ret_val);
2242: call_tests++;
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);
2248: test_ret++;
2249: printf(" %d", n_ctxt);
2250: printf("\n");
2251: }
2252: }
2253: function_tests++;
2254: #endif
2255:
2256: return(test_ret);
2257: }
2258:
2259:
2260: static int
2261: test_htmlParseChunk(void) {
2262: int test_ret = 0;
2263:
2264: #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_PUSH_ENABLED)
2265: int mem_base;
2266: int ret_val;
2267: htmlParserCtxtPtr ctxt; /* an HTML parser context */
2268: int n_ctxt;
2269: char * chunk; /* an char array */
2270: int n_chunk;
2271: int size; /* the size in byte of the chunk */
2272: int n_size;
2273: int terminate; /* last chunk indicator */
2274: int n_terminate;
2275:
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);
2285:
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);
2289: call_tests++;
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);
2298: test_ret++;
2299: printf(" %d", n_ctxt);
2300: printf(" %d", n_chunk);
2301: printf(" %d", n_size);
2302: printf(" %d", n_terminate);
2303: printf("\n");
2304: }
2305: }
2306: }
2307: }
2308: }
2309: function_tests++;
2310: #endif
2311:
2312: return(test_ret);
2313: }
2314:
2315:
2316: static int
2317: test_htmlParseDoc(void) {
2318: int test_ret = 0;
2319:
2320: #if defined(LIBXML_HTML_ENABLED)
2321: int mem_base;
2322: htmlDocPtr ret_val;
2323: xmlChar * cur; /* a pointer to an array of xmlChar */
2324: int n_cur;
2325: char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
2326: int n_encoding;
2327:
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);
2333:
2334: ret_val = htmlParseDoc(cur, (const char *)encoding);
2335: desret_htmlDocPtr(ret_val);
2336: call_tests++;
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);
2343: test_ret++;
2344: printf(" %d", n_cur);
2345: printf(" %d", n_encoding);
2346: printf("\n");
2347: }
2348: }
2349: }
2350: function_tests++;
2351: #endif
2352:
2353: return(test_ret);
2354: }
2355:
2356:
2357: static int
2358: test_htmlParseDocument(void) {
2359: int test_ret = 0;
2360:
2361: #if defined(LIBXML_HTML_ENABLED)
2362: int mem_base;
2363: int ret_val;
2364: htmlParserCtxtPtr ctxt; /* an HTML parser context */
2365: int n_ctxt;
2366:
2367: for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
2368: mem_base = xmlMemBlocks();
2369: ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
2370:
2371: ret_val = htmlParseDocument(ctxt);
2372: if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}
2373: desret_int(ret_val);
2374: call_tests++;
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);
2380: test_ret++;
2381: printf(" %d", n_ctxt);
2382: printf("\n");
2383: }
2384: }
2385: function_tests++;
2386: #endif
2387:
2388: return(test_ret);
2389: }
2390:
2391:
2392: static int
2393: test_htmlParseElement(void) {
2394: int test_ret = 0;
2395:
2396: #if defined(LIBXML_HTML_ENABLED)
2397: int mem_base;
2398: htmlParserCtxtPtr ctxt; /* an HTML parser context */
2399: int n_ctxt;
2400:
2401: for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
2402: mem_base = xmlMemBlocks();
2403: ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
2404:
2405: htmlParseElement(ctxt);
2406: call_tests++;
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);
2412: test_ret++;
2413: printf(" %d", n_ctxt);
2414: printf("\n");
2415: }
2416: }
2417: function_tests++;
2418: #endif
2419:
2420: return(test_ret);
2421: }
2422:
2423:
2424: static int
2425: test_htmlParseEntityRef(void) {
2426: int test_ret = 0;
2427:
2428: #if defined(LIBXML_HTML_ENABLED)
2429: int mem_base;
2430: const htmlEntityDesc * ret_val;
2431: htmlParserCtxtPtr ctxt; /* an HTML parser context */
2432: int n_ctxt;
2433: xmlChar ** str; /* location to store the entity name */
2434: int n_str;
2435:
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);
2441:
2442: ret_val = htmlParseEntityRef(ctxt, (const xmlChar **)str);
2443: desret_const_htmlEntityDesc_ptr(ret_val);
2444: call_tests++;
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);
2451: test_ret++;
2452: printf(" %d", n_ctxt);
2453: printf(" %d", n_str);
2454: printf("\n");
2455: }
2456: }
2457: }
2458: function_tests++;
2459: #endif
2460:
2461: return(test_ret);
2462: }
2463:
2464:
2465: static int
2466: test_htmlParseFile(void) {
2467: int test_ret = 0;
2468:
2469: #if defined(LIBXML_HTML_ENABLED)
2470: htmlDocPtr ret_val;
2471: const char * filename; /* the filename */
2472: int n_filename;
2473: char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
2474: int n_encoding;
2475:
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);
2480:
2481: ret_val = htmlParseFile(filename, (const char *)encoding);
2482: desret_htmlDocPtr(ret_val);
2483: call_tests++;
2484: des_filepath(n_filename, filename, 0);
2485: des_const_char_ptr(n_encoding, (const char *)encoding, 1);
2486: xmlResetLastError();
2487: }
2488: }
2489: function_tests++;
2490: #endif
2491:
2492: return(test_ret);
2493: }
2494:
2495:
2496: static int
2497: test_htmlReadDoc(void) {
2498: int test_ret = 0;
2499:
2500: #if defined(LIBXML_HTML_ENABLED)
2501: int mem_base;
2502: htmlDocPtr ret_val;
2503: xmlChar * cur; /* a pointer to a zero terminated string */
2504: int n_cur;
2505: const char * URL; /* the base URL to use for the document */
2506: int n_URL;
2507: char * encoding; /* the document encoding, or NULL */
2508: int n_encoding;
2509: int options; /* a combination of htmlParserOption(s) */
2510: int n_options;
2511:
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);
2521:
2522: ret_val = htmlReadDoc((const xmlChar *)cur, URL, (const char *)encoding, options);
2523: desret_htmlDocPtr(ret_val);
2524: call_tests++;
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);
2533: test_ret++;
2534: printf(" %d", n_cur);
2535: printf(" %d", n_URL);
2536: printf(" %d", n_encoding);
2537: printf(" %d", n_options);
2538: printf("\n");
2539: }
2540: }
2541: }
2542: }
2543: }
2544: function_tests++;
2545: #endif
2546:
2547: return(test_ret);
2548: }
2549:
2550:
2551: static int
2552: test_htmlReadFile(void) {
2553: int test_ret = 0;
2554:
2555: #if defined(LIBXML_HTML_ENABLED)
2556: int mem_base;
2557: htmlDocPtr ret_val;
2558: const char * filename; /* a file or URL */
2559: int n_filename;
2560: char * encoding; /* the document encoding, or NULL */
2561: int n_encoding;
2562: int options; /* a combination of htmlParserOption(s) */
2563: int n_options;
2564:
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);
2572:
2573: ret_val = htmlReadFile(filename, (const char *)encoding, options);
2574: desret_htmlDocPtr(ret_val);
2575: call_tests++;
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);
2583: test_ret++;
2584: printf(" %d", n_filename);
2585: printf(" %d", n_encoding);
2586: printf(" %d", n_options);
2587: printf("\n");
2588: }
2589: }
2590: }
2591: }
2592: function_tests++;
2593: #endif
2594:
2595: return(test_ret);
2596: }
2597:
2598:
2599: static int
2600: test_htmlReadMemory(void) {
2601: int test_ret = 0;
2602:
2603: #if defined(LIBXML_HTML_ENABLED)
2604: int mem_base;
2605: htmlDocPtr ret_val;
2606: char * buffer; /* a pointer to a char array */
2607: int n_buffer;
2608: int size; /* the size of the array */
2609: int n_size;
2610: const char * URL; /* the base URL to use for the document */
2611: int n_URL;
2612: char * encoding; /* the document encoding, or NULL */
2613: int n_encoding;
2614: int options; /* a combination of htmlParserOption(s) */
2615: int n_options;
2616:
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);
2628:
2629: ret_val = htmlReadMemory((const char *)buffer, size, URL, (const char *)encoding, options);
2630: desret_htmlDocPtr(ret_val);
2631: call_tests++;
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);
2641: test_ret++;
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);
2647: printf("\n");
2648: }
2649: }
2650: }
2651: }
2652: }
2653: }
2654: function_tests++;
2655: #endif
2656:
2657: return(test_ret);
2658: }
2659:
2660:
2661: static int
2662: test_htmlSAXParseDoc(void) {
2663: int test_ret = 0;
2664:
2665: #if defined(LIBXML_HTML_ENABLED)
2666: int mem_base;
2667: htmlDocPtr ret_val;
2668: xmlChar * cur; /* a pointer to an array of xmlChar */
2669: int n_cur;
2670: char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
2671: int n_encoding;
2672: htmlSAXHandlerPtr sax; /* the SAX handler block */
2673: int n_sax;
2674: void * userData; /* if using SAX, this pointer will be provided on callbacks. */
2675: int n_userData;
2676:
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);
2686:
2687: ret_val = htmlSAXParseDoc(cur, (const char *)encoding, sax, userData);
2688: desret_htmlDocPtr(ret_val);
2689: call_tests++;
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);
2698: test_ret++;
2699: printf(" %d", n_cur);
2700: printf(" %d", n_encoding);
2701: printf(" %d", n_sax);
2702: printf(" %d", n_userData);
2703: printf("\n");
2704: }
2705: }
2706: }
2707: }
2708: }
2709: function_tests++;
2710: #endif
2711:
2712: return(test_ret);
2713: }
2714:
2715:
2716: static int
2717: test_htmlSAXParseFile(void) {
2718: int test_ret = 0;
2719:
2720: #if defined(LIBXML_HTML_ENABLED)
2721: int mem_base;
2722: htmlDocPtr ret_val;
2723: const char * filename; /* the filename */
2724: int n_filename;
2725: char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
2726: int n_encoding;
2727: htmlSAXHandlerPtr sax; /* the SAX handler block */
2728: int n_sax;
2729: void * userData; /* if using SAX, this pointer will be provided on callbacks. */
2730: int n_userData;
2731:
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);
2741:
2742: ret_val = htmlSAXParseFile(filename, (const char *)encoding, sax, userData);
2743: desret_htmlDocPtr(ret_val);
2744: call_tests++;
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);
2753: test_ret++;
2754: printf(" %d", n_filename);
2755: printf(" %d", n_encoding);
2756: printf(" %d", n_sax);
2757: printf(" %d", n_userData);
2758: printf("\n");
2759: }
2760: }
2761: }
2762: }
2763: }
2764: function_tests++;
2765: #endif
2766:
2767: return(test_ret);
2768: }
2769:
2770:
2771: static int
2772: test_htmlTagLookup(void) {
2773: int test_ret = 0;
2774:
2775:
2776: /* missing type support */
2777: return(test_ret);
2778: }
2779:
2780: static int
2781: test_HTMLparser(void) {
2782: int test_ret = 0;
2783:
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();
2818:
2819: if (test_ret != 0)
2820: printf("Module HTMLparser: %d errors\n", test_ret);
2821: return(test_ret);
2822: }
2823:
2824: static int
2825: test_htmlDocContentDumpFormatOutput(void) {
2826: int test_ret = 0;
2827:
2828: #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
2829: int mem_base;
2830: xmlOutputBufferPtr buf; /* the HTML buffer output */
2831: int n_buf;
2832: xmlDocPtr cur; /* the document */
2833: int n_cur;
2834: char * encoding; /* the encoding string */
2835: int n_encoding;
2836: int format; /* should formatting spaces been added */
2837: int n_format;
2838:
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);
2848:
2849: htmlDocContentDumpFormatOutput(buf, cur, (const char *)encoding, format);
2850: call_tests++;
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);
2859: test_ret++;
2860: printf(" %d", n_buf);
2861: printf(" %d", n_cur);
2862: printf(" %d", n_encoding);
2863: printf(" %d", n_format);
2864: printf("\n");
2865: }
2866: }
2867: }
2868: }
2869: }
2870: function_tests++;
2871: #endif
2872:
2873: return(test_ret);
2874: }
2875:
2876:
2877: static int
2878: test_htmlDocContentDumpOutput(void) {
2879: int test_ret = 0;
2880:
2881: #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
2882: int mem_base;
2883: xmlOutputBufferPtr buf; /* the HTML buffer output */
2884: int n_buf;
2885: xmlDocPtr cur; /* the document */
2886: int n_cur;
2887: char * encoding; /* the encoding string */
2888: int n_encoding;
2889:
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);
2897:
2898: htmlDocContentDumpOutput(buf, cur, (const char *)encoding);
2899: call_tests++;
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);
2907: test_ret++;
2908: printf(" %d", n_buf);
2909: printf(" %d", n_cur);
2910: printf(" %d", n_encoding);
2911: printf("\n");
2912: }
2913: }
2914: }
2915: }
2916: function_tests++;
2917: #endif
2918:
2919: return(test_ret);
2920: }
2921:
2922:
2923: static int
2924: test_htmlDocDump(void) {
2925: int test_ret = 0;
2926:
2927: #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
2928: int mem_base;
2929: int ret_val;
2930: FILE * f; /* the FILE* */
2931: int n_f;
2932: xmlDocPtr cur; /* the document */
2933: int n_cur;
2934:
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);
2940:
2941: ret_val = htmlDocDump(f, cur);
2942: desret_int(ret_val);
2943: call_tests++;
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);
2950: test_ret++;
2951: printf(" %d", n_f);
2952: printf(" %d", n_cur);
2953: printf("\n");
2954: }
2955: }
2956: }
2957: function_tests++;
2958: #endif
2959:
2960: return(test_ret);
2961: }
2962:
2963:
2964: #define gen_nb_xmlChar_ptr_ptr 1
2965: static xmlChar ** gen_xmlChar_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
2966: return(NULL);
2967: }
2968: static void des_xmlChar_ptr_ptr(int no ATTRIBUTE_UNUSED, xmlChar ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
2969: }
2970:
2971: static int
2972: test_htmlDocDumpMemory(void) {
2973: int test_ret = 0;
2974:
2975: #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
2976: int mem_base;
2977: xmlDocPtr cur; /* the document */
2978: int n_cur;
2979: xmlChar ** mem; /* OUT: the memory pointer */
2980: int n_mem;
2981: int * size; /* OUT: the memory length */
2982: int n_size;
2983:
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);
2991:
2992: htmlDocDumpMemory(cur, mem, size);
2993: call_tests++;
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);
3001: test_ret++;
3002: printf(" %d", n_cur);
3003: printf(" %d", n_mem);
3004: printf(" %d", n_size);
3005: printf("\n");
3006: }
3007: }
3008: }
3009: }
3010: function_tests++;
3011: #endif
3012:
3013: return(test_ret);
3014: }
3015:
3016:
3017: static int
3018: test_htmlDocDumpMemoryFormat(void) {
3019: int test_ret = 0;
3020:
3021: #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3022: int mem_base;
3023: xmlDocPtr cur; /* the document */
3024: int n_cur;
3025: xmlChar ** mem; /* OUT: the memory pointer */
3026: int n_mem;
3027: int * size; /* OUT: the memory length */
3028: int n_size;
3029: int format; /* should formatting spaces been added */
3030: int n_format;
3031:
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);
3041:
3042: htmlDocDumpMemoryFormat(cur, mem, size, format);
3043: call_tests++;
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);
3052: test_ret++;
3053: printf(" %d", n_cur);
3054: printf(" %d", n_mem);
3055: printf(" %d", n_size);
3056: printf(" %d", n_format);
3057: printf("\n");
3058: }
3059: }
3060: }
3061: }
3062: }
3063: function_tests++;
3064: #endif
3065:
3066: return(test_ret);
3067: }
3068:
3069:
3070: static int
3071: test_htmlGetMetaEncoding(void) {
3072: int test_ret = 0;
3073:
3074: #if defined(LIBXML_HTML_ENABLED)
3075: int mem_base;
3076: const xmlChar * ret_val;
3077: htmlDocPtr doc; /* the document */
3078: int n_doc;
3079:
3080: for (n_doc = 0;n_doc < gen_nb_htmlDocPtr;n_doc++) {
3081: mem_base = xmlMemBlocks();
3082: doc = gen_htmlDocPtr(n_doc, 0);
3083:
3084: ret_val = htmlGetMetaEncoding(doc);
3085: desret_const_xmlChar_ptr(ret_val);
3086: call_tests++;
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);
3092: test_ret++;
3093: printf(" %d", n_doc);
3094: printf("\n");
3095: }
3096: }
3097: function_tests++;
3098: #endif
3099:
3100: return(test_ret);
3101: }
3102:
3103:
3104: static int
3105: test_htmlIsBooleanAttr(void) {
3106: int test_ret = 0;
3107:
3108: #if defined(LIBXML_HTML_ENABLED)
3109: int mem_base;
3110: int ret_val;
3111: xmlChar * name; /* the name of the attribute to check */
3112: int n_name;
3113:
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);
3117:
3118: ret_val = htmlIsBooleanAttr((const xmlChar *)name);
3119: desret_int(ret_val);
3120: call_tests++;
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);
3126: test_ret++;
3127: printf(" %d", n_name);
3128: printf("\n");
3129: }
3130: }
3131: function_tests++;
3132: #endif
3133:
3134: return(test_ret);
3135: }
3136:
3137:
3138: static int
3139: test_htmlNewDoc(void) {
3140: int test_ret = 0;
3141:
3142: #if defined(LIBXML_HTML_ENABLED)
3143: int mem_base;
3144: htmlDocPtr ret_val;
3145: xmlChar * URI; /* URI for the dtd, or NULL */
3146: int n_URI;
3147: xmlChar * ExternalID; /* the external ID of the DTD, or NULL */
3148: int n_ExternalID;
3149:
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);
3155:
3156: ret_val = htmlNewDoc((const xmlChar *)URI, (const xmlChar *)ExternalID);
3157: desret_htmlDocPtr(ret_val);
3158: call_tests++;
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);
3165: test_ret++;
3166: printf(" %d", n_URI);
3167: printf(" %d", n_ExternalID);
3168: printf("\n");
3169: }
3170: }
3171: }
3172: function_tests++;
3173: #endif
3174:
3175: return(test_ret);
3176: }
3177:
3178:
3179: static int
3180: test_htmlNewDocNoDtD(void) {
3181: int test_ret = 0;
3182:
3183: #if defined(LIBXML_HTML_ENABLED)
3184: int mem_base;
3185: htmlDocPtr ret_val;
3186: xmlChar * URI; /* URI for the dtd, or NULL */
3187: int n_URI;
3188: xmlChar * ExternalID; /* the external ID of the DTD, or NULL */
3189: int n_ExternalID;
3190:
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);
3196:
3197: ret_val = htmlNewDocNoDtD((const xmlChar *)URI, (const xmlChar *)ExternalID);
3198: desret_htmlDocPtr(ret_val);
3199: call_tests++;
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);
3206: test_ret++;
3207: printf(" %d", n_URI);
3208: printf(" %d", n_ExternalID);
3209: printf("\n");
3210: }
3211: }
3212: }
3213: function_tests++;
3214: #endif
3215:
3216: return(test_ret);
3217: }
3218:
3219:
3220: static int
3221: test_htmlNodeDump(void) {
3222: int test_ret = 0;
3223:
3224: #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3225: int mem_base;
3226: int ret_val;
3227: xmlBufferPtr buf; /* the HTML buffer output */
3228: int n_buf;
3229: xmlDocPtr doc; /* the document */
3230: int n_doc;
3231: xmlNodePtr cur; /* the current node */
3232: int n_cur;
3233:
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);
3241:
3242: ret_val = htmlNodeDump(buf, doc, cur);
3243: desret_int(ret_val);
3244: call_tests++;
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);
3252: test_ret++;
3253: printf(" %d", n_buf);
3254: printf(" %d", n_doc);
3255: printf(" %d", n_cur);
3256: printf("\n");
3257: }
3258: }
3259: }
3260: }
3261: function_tests++;
3262: #endif
3263:
3264: return(test_ret);
3265: }
3266:
3267:
3268: static int
3269: test_htmlNodeDumpFile(void) {
3270: int test_ret = 0;
3271:
3272: #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3273: int mem_base;
3274: FILE * out; /* the FILE pointer */
3275: int n_out;
3276: xmlDocPtr doc; /* the document */
3277: int n_doc;
3278: xmlNodePtr cur; /* the current node */
3279: int n_cur;
3280:
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);
3288:
3289: htmlNodeDumpFile(out, doc, cur);
3290: call_tests++;
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);
3298: test_ret++;
3299: printf(" %d", n_out);
3300: printf(" %d", n_doc);
3301: printf(" %d", n_cur);
3302: printf("\n");
3303: }
3304: }
3305: }
3306: }
3307: function_tests++;
3308: #endif
3309:
3310: return(test_ret);
3311: }
3312:
3313:
3314: static int
3315: test_htmlNodeDumpFileFormat(void) {
3316: int test_ret = 0;
3317:
3318: #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3319: int mem_base;
3320: int ret_val;
3321: FILE * out; /* the FILE pointer */
3322: int n_out;
3323: xmlDocPtr doc; /* the document */
3324: int n_doc;
3325: xmlNodePtr cur; /* the current node */
3326: int n_cur;
3327: char * encoding; /* the document encoding */
3328: int n_encoding;
3329: int format; /* should formatting spaces been added */
3330: int n_format;
3331:
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);
3343:
3344: ret_val = htmlNodeDumpFileFormat(out, doc, cur, (const char *)encoding, format);
3345: desret_int(ret_val);
3346: call_tests++;
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);
3356: test_ret++;
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);
3362: printf("\n");
3363: }
3364: }
3365: }
3366: }
3367: }
3368: }
3369: function_tests++;
3370: #endif
3371:
3372: return(test_ret);
3373: }
3374:
3375:
3376: static int
3377: test_htmlNodeDumpFormatOutput(void) {
3378: int test_ret = 0;
3379:
3380: #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3381: int mem_base;
3382: xmlOutputBufferPtr buf; /* the HTML buffer output */
3383: int n_buf;
3384: xmlDocPtr doc; /* the document */
3385: int n_doc;
3386: xmlNodePtr cur; /* the current node */
3387: int n_cur;
3388: char * encoding; /* the encoding string */
3389: int n_encoding;
3390: int format; /* should formatting spaces been added */
3391: int n_format;
3392:
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);
3404:
3405: htmlNodeDumpFormatOutput(buf, doc, cur, (const char *)encoding, format);
3406: call_tests++;
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);
3416: test_ret++;
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);
3422: printf("\n");
3423: }
3424: }
3425: }
3426: }
3427: }
3428: }
3429: function_tests++;
3430: #endif
3431:
3432: return(test_ret);
3433: }
3434:
3435:
3436: static int
3437: test_htmlNodeDumpOutput(void) {
3438: int test_ret = 0;
3439:
3440: #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3441: int mem_base;
3442: xmlOutputBufferPtr buf; /* the HTML buffer output */
3443: int n_buf;
3444: xmlDocPtr doc; /* the document */
3445: int n_doc;
3446: xmlNodePtr cur; /* the current node */
3447: int n_cur;
3448: char * encoding; /* the encoding string */
3449: int n_encoding;
3450:
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);
3460:
3461: htmlNodeDumpOutput(buf, doc, cur, (const char *)encoding);
3462: call_tests++;
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);
3471: test_ret++;
3472: printf(" %d", n_buf);
3473: printf(" %d", n_doc);
3474: printf(" %d", n_cur);
3475: printf(" %d", n_encoding);
3476: printf("\n");
3477: }
3478: }
3479: }
3480: }
3481: }
3482: function_tests++;
3483: #endif
3484:
3485: return(test_ret);
3486: }
3487:
3488:
3489: static int
3490: test_htmlSaveFile(void) {
3491: int test_ret = 0;
3492:
3493: #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3494: int mem_base;
3495: int ret_val;
3496: const char * filename; /* the filename (or URL) */
3497: int n_filename;
3498: xmlDocPtr cur; /* the document */
3499: int n_cur;
3500:
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);
3506:
3507: ret_val = htmlSaveFile(filename, cur);
3508: desret_int(ret_val);
3509: call_tests++;
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);
3516: test_ret++;
3517: printf(" %d", n_filename);
3518: printf(" %d", n_cur);
3519: printf("\n");
3520: }
3521: }
3522: }
3523: function_tests++;
3524: #endif
3525:
3526: return(test_ret);
3527: }
3528:
3529:
3530: static int
3531: test_htmlSaveFileEnc(void) {
3532: int test_ret = 0;
3533:
3534: #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3535: int mem_base;
3536: int ret_val;
3537: const char * filename; /* the filename */
3538: int n_filename;
3539: xmlDocPtr cur; /* the document */
3540: int n_cur;
3541: char * encoding; /* the document encoding */
3542: int n_encoding;
3543:
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);
3551:
3552: ret_val = htmlSaveFileEnc(filename, cur, (const char *)encoding);
3553: desret_int(ret_val);
3554: call_tests++;
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);
3562: test_ret++;
3563: printf(" %d", n_filename);
3564: printf(" %d", n_cur);
3565: printf(" %d", n_encoding);
3566: printf("\n");
3567: }
3568: }
3569: }
3570: }
3571: function_tests++;
3572: #endif
3573:
3574: return(test_ret);
3575: }
3576:
3577:
3578: static int
3579: test_htmlSaveFileFormat(void) {
3580: int test_ret = 0;
3581:
3582: #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3583: int mem_base;
3584: int ret_val;
3585: const char * filename; /* the filename */
3586: int n_filename;
3587: xmlDocPtr cur; /* the document */
3588: int n_cur;
3589: char * encoding; /* the document encoding */
3590: int n_encoding;
3591: int format; /* should formatting spaces been added */
3592: int n_format;
3593:
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);
3603:
3604: ret_val = htmlSaveFileFormat(filename, cur, (const char *)encoding, format);
3605: desret_int(ret_val);
3606: call_tests++;
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);
3615: test_ret++;
3616: printf(" %d", n_filename);
3617: printf(" %d", n_cur);
3618: printf(" %d", n_encoding);
3619: printf(" %d", n_format);
3620: printf("\n");
3621: }
3622: }
3623: }
3624: }
3625: }
3626: function_tests++;
3627: #endif
3628:
3629: return(test_ret);
3630: }
3631:
3632:
3633: static int
3634: test_htmlSetMetaEncoding(void) {
3635: int test_ret = 0;
3636:
3637: #if defined(LIBXML_HTML_ENABLED)
3638: int mem_base;
3639: int ret_val;
3640: htmlDocPtr doc; /* the document */
3641: int n_doc;
3642: xmlChar * encoding; /* the encoding string */
3643: int n_encoding;
3644:
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);
3650:
3651: ret_val = htmlSetMetaEncoding(doc, (const xmlChar *)encoding);
3652: desret_int(ret_val);
3653: call_tests++;
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);
3660: test_ret++;
3661: printf(" %d", n_doc);
3662: printf(" %d", n_encoding);
3663: printf("\n");
3664: }
3665: }
3666: }
3667: function_tests++;
3668: #endif
3669:
3670: return(test_ret);
3671: }
3672:
3673: static int
3674: test_HTMLtree(void) {
3675: int test_ret = 0;
3676:
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();
3696:
3697: if (test_ret != 0)
3698: printf("Module HTMLtree: %d errors\n", test_ret);
3699: return(test_ret);
3700: }
3701:
3702: static int
3703: test_docbDefaultSAXHandlerInit(void) {
3704: int test_ret = 0;
3705:
3706: #if defined(LIBXML_DOCB_ENABLED)
3707: #ifdef LIBXML_DOCB_ENABLED
3708: int mem_base;
3709:
3710: mem_base = xmlMemBlocks();
3711:
3712: docbDefaultSAXHandlerInit();
3713: call_tests++;
3714: xmlResetLastError();
3715: if (mem_base != xmlMemBlocks()) {
3716: printf("Leak of %d blocks found in docbDefaultSAXHandlerInit",
3717: xmlMemBlocks() - mem_base);
3718: test_ret++;
3719: printf("\n");
3720: }
3721: function_tests++;
3722: #endif
3723: #endif
3724:
3725: return(test_ret);
3726: }
3727:
3728:
3729: static int
3730: test_htmlDefaultSAXHandlerInit(void) {
3731: int test_ret = 0;
3732:
3733: #if defined(LIBXML_HTML_ENABLED)
3734: #ifdef LIBXML_HTML_ENABLED
3735: int mem_base;
3736:
3737: mem_base = xmlMemBlocks();
3738:
3739: htmlDefaultSAXHandlerInit();
3740: call_tests++;
3741: xmlResetLastError();
3742: if (mem_base != xmlMemBlocks()) {
3743: printf("Leak of %d blocks found in htmlDefaultSAXHandlerInit",
3744: xmlMemBlocks() - mem_base);
3745: test_ret++;
3746: printf("\n");
3747: }
3748: function_tests++;
3749: #endif
3750: #endif
3751:
3752: return(test_ret);
3753: }
3754:
3755:
3756: static int
3757: test_xmlDefaultSAXHandlerInit(void) {
3758: int test_ret = 0;
3759:
3760: int mem_base;
3761:
3762: mem_base = xmlMemBlocks();
3763:
3764: xmlDefaultSAXHandlerInit();
3765: call_tests++;
3766: xmlResetLastError();
3767: if (mem_base != xmlMemBlocks()) {
3768: printf("Leak of %d blocks found in xmlDefaultSAXHandlerInit",
3769: xmlMemBlocks() - mem_base);
3770: test_ret++;
3771: printf("\n");
3772: }
3773: function_tests++;
3774:
3775: return(test_ret);
3776: }
3777:
3778:
3779: #define gen_nb_xmlEnumerationPtr 1
3780: static xmlEnumerationPtr gen_xmlEnumerationPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
3781: return(NULL);
3782: }
3783: static void des_xmlEnumerationPtr(int no ATTRIBUTE_UNUSED, xmlEnumerationPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
3784: }
3785:
3786: static int
3787: test_xmlSAX2AttributeDecl(void) {
3788: int test_ret = 0;
3789:
3790: int mem_base;
3791: void * ctx; /* the user data (XML parser context) */
3792: int n_ctx;
3793: xmlChar * elem; /* the name of the element */
3794: int n_elem;
3795: xmlChar * fullname; /* the attribute name */
3796: int n_fullname;
3797: int type; /* the attribute type */
3798: int n_type;
3799: int def; /* the type of default value */
3800: int n_def;
3801: xmlChar * defaultValue; /* the attribute default value */
3802: int n_defaultValue;
3803: xmlEnumerationPtr tree; /* the tree of enumerated value set */
3804: int n_tree;
3805:
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);
3821:
3822: xmlSAX2AttributeDecl(ctx, (const xmlChar *)elem, (const xmlChar *)fullname, type, def, (const xmlChar *)defaultValue, tree);
3823: call_tests++;
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);
3835: test_ret++;
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);
3843: printf("\n");
3844: }
3845: }
3846: }
3847: }
3848: }
3849: }
3850: }
3851: }
3852: function_tests++;
3853:
3854: return(test_ret);
3855: }
3856:
3857:
3858: static int
3859: test_xmlSAX2CDataBlock(void) {
3860: int test_ret = 0;
3861:
3862: int mem_base;
3863: void * ctx; /* the user data (XML parser context) */
3864: int n_ctx;
3865: xmlChar * value; /* The pcdata content */
3866: int n_value;
3867: int len; /* the block length */
3868: int n_len;
3869:
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);
3877:
3878: xmlSAX2CDataBlock(ctx, (const xmlChar *)value, len);
3879: call_tests++;
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);
3887: test_ret++;
3888: printf(" %d", n_ctx);
3889: printf(" %d", n_value);
3890: printf(" %d", n_len);
3891: printf("\n");
3892: }
3893: }
3894: }
3895: }
3896: function_tests++;
3897:
3898: return(test_ret);
3899: }
3900:
3901:
3902: static int
3903: test_xmlSAX2Characters(void) {
3904: int test_ret = 0;
3905:
3906: int mem_base;
3907: void * ctx; /* the user data (XML parser context) */
3908: int n_ctx;
3909: xmlChar * ch; /* a xmlChar string */
3910: int n_ch;
3911: int len; /* the number of xmlChar */
3912: int n_len;
3913:
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);
3921:
3922: xmlSAX2Characters(ctx, (const xmlChar *)ch, len);
3923: call_tests++;
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);
3931: test_ret++;
3932: printf(" %d", n_ctx);
3933: printf(" %d", n_ch);
3934: printf(" %d", n_len);
3935: printf("\n");
3936: }
3937: }
3938: }
3939: }
3940: function_tests++;
3941:
3942: return(test_ret);
3943: }
3944:
3945:
3946: static int
3947: test_xmlSAX2Comment(void) {
3948: int test_ret = 0;
3949:
3950: int mem_base;
3951: void * ctx; /* the user data (XML parser context) */
3952: int n_ctx;
3953: xmlChar * value; /* the xmlSAX2Comment content */
3954: int n_value;
3955:
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);
3961:
3962: xmlSAX2Comment(ctx, (const xmlChar *)value);
3963: call_tests++;
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);
3970: test_ret++;
3971: printf(" %d", n_ctx);
3972: printf(" %d", n_value);
3973: printf("\n");
3974: }
3975: }
3976: }
3977: function_tests++;
3978:
3979: return(test_ret);
3980: }
3981:
3982:
3983: static int
3984: test_xmlSAX2ElementDecl(void) {
3985: int test_ret = 0;
3986:
3987: int mem_base;
3988: void * ctx; /* the user data (XML parser context) */
3989: int n_ctx;
3990: xmlChar * name; /* the element name */
3991: int n_name;
3992: int type; /* the element type */
3993: int n_type;
3994: xmlElementContentPtr content; /* the element value tree */
3995: int n_content;
3996:
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);
4006:
4007: xmlSAX2ElementDecl(ctx, (const xmlChar *)name, type, content);
4008: call_tests++;
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);
4017: test_ret++;
4018: printf(" %d", n_ctx);
4019: printf(" %d", n_name);
4020: printf(" %d", n_type);
4021: printf(" %d", n_content);
4022: printf("\n");
4023: }
4024: }
4025: }
4026: }
4027: }
4028: function_tests++;
4029:
4030: return(test_ret);
4031: }
4032:
4033:
4034: static int
4035: test_xmlSAX2EndDocument(void) {
4036: int test_ret = 0;
4037:
4038: int mem_base;
4039: void * ctx; /* the user data (XML parser context) */
4040: int n_ctx;
4041:
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);
4045:
4046: xmlSAX2EndDocument(ctx);
4047: call_tests++;
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);
4053: test_ret++;
4054: printf(" %d", n_ctx);
4055: printf("\n");
4056: }
4057: }
4058: function_tests++;
4059:
4060: return(test_ret);
4061: }
4062:
4063:
4064: static int
4065: test_xmlSAX2EndElement(void) {
4066: int test_ret = 0;
4067:
4068: #if defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_DOCB_ENABLED)
4069: #ifdef LIBXML_SAX1_ENABLED
4070: int mem_base;
4071: void * ctx; /* the user data (XML parser context) */
4072: int n_ctx;
4073: xmlChar * name; /* The element name */
4074: int n_name;
4075:
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);
4081:
4082: xmlSAX2EndElement(ctx, (const xmlChar *)name);
4083: call_tests++;
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);
4090: test_ret++;
4091: printf(" %d", n_ctx);
4092: printf(" %d", n_name);
4093: printf("\n");
4094: }
4095: }
4096: }
4097: function_tests++;
4098: #endif
4099: #endif
4100:
4101: return(test_ret);
4102: }
4103:
4104:
4105: static int
4106: test_xmlSAX2EndElementNs(void) {
4107: int test_ret = 0;
4108:
4109: int mem_base;
4110: void * ctx; /* the user data (XML parser context) */
4111: int n_ctx;
4112: xmlChar * localname; /* the local name of the element */
4113: int n_localname;
4114: xmlChar * prefix; /* the element namespace prefix if available */
4115: int n_prefix;
4116: xmlChar * URI; /* the element namespace name if available */
4117: int n_URI;
4118:
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);
4128:
4129: xmlSAX2EndElementNs(ctx, (const xmlChar *)localname, (const xmlChar *)prefix, (const xmlChar *)URI);
4130: call_tests++;
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);
4139: test_ret++;
4140: printf(" %d", n_ctx);
4141: printf(" %d", n_localname);
4142: printf(" %d", n_prefix);
4143: printf(" %d", n_URI);
4144: printf("\n");
4145: }
4146: }
4147: }
4148: }
4149: }
4150: function_tests++;
4151:
4152: return(test_ret);
4153: }
4154:
4155:
4156: static int
4157: test_xmlSAX2EntityDecl(void) {
4158: int test_ret = 0;
4159:
4160: int mem_base;
4161: void * ctx; /* the user data (XML parser context) */
4162: int n_ctx;
4163: xmlChar * name; /* the entity name */
4164: int n_name;
4165: int type; /* the entity type */
4166: int n_type;
4167: xmlChar * publicId; /* The public ID of the entity */
4168: int n_publicId;
4169: xmlChar * systemId; /* The system ID of the entity */
4170: int n_systemId;
4171: xmlChar * content; /* the entity value (without processing). */
4172: int n_content;
4173:
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);
4187:
4188: xmlSAX2EntityDecl(ctx, (const xmlChar *)name, type, (const xmlChar *)publicId, (const xmlChar *)systemId, content);
4189: call_tests++;
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);
4200: test_ret++;
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);
4207: printf("\n");
4208: }
4209: }
4210: }
4211: }
4212: }
4213: }
4214: }
4215: function_tests++;
4216:
4217: return(test_ret);
4218: }
4219:
4220:
4221: static int
4222: test_xmlSAX2ExternalSubset(void) {
4223: int test_ret = 0;
4224:
4225: int mem_base;
4226: void * ctx; /* the user data (XML parser context) */
4227: int n_ctx;
4228: xmlChar * name; /* the root element name */
4229: int n_name;
4230: xmlChar * ExternalID; /* the external ID */
4231: int n_ExternalID;
4232: xmlChar * SystemID; /* the SYSTEM ID (e.g. filename or URL) */
4233: int n_SystemID;
4234:
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);
4244:
4245: xmlSAX2ExternalSubset(ctx, (const xmlChar *)name, (const xmlChar *)ExternalID, (const xmlChar *)SystemID);
4246: call_tests++;
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);
4255: test_ret++;
4256: printf(" %d", n_ctx);
4257: printf(" %d", n_name);
4258: printf(" %d", n_ExternalID);
4259: printf(" %d", n_SystemID);
4260: printf("\n");
4261: }
4262: }
4263: }
4264: }
4265: }
4266: function_tests++;
4267:
4268: return(test_ret);
4269: }
4270:
4271:
4272: static int
4273: test_xmlSAX2GetColumnNumber(void) {
4274: int test_ret = 0;
4275:
4276: int mem_base;
4277: int ret_val;
4278: void * ctx; /* the user data (XML parser context) */
4279: int n_ctx;
4280:
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);
4284:
4285: ret_val = xmlSAX2GetColumnNumber(ctx);
4286: desret_int(ret_val);
4287: call_tests++;
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);
4293: test_ret++;
4294: printf(" %d", n_ctx);
4295: printf("\n");
4296: }
4297: }
4298: function_tests++;
4299:
4300: return(test_ret);
4301: }
4302:
4303:
4304: static int
4305: test_xmlSAX2GetEntity(void) {
4306: int test_ret = 0;
4307:
4308: int mem_base;
4309: xmlEntityPtr ret_val;
4310: void * ctx; /* the user data (XML parser context) */
4311: int n_ctx;
4312: xmlChar * name; /* The entity name */
4313: int n_name;
4314:
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);
4320:
4321: ret_val = xmlSAX2GetEntity(ctx, (const xmlChar *)name);
4322: desret_xmlEntityPtr(ret_val);
4323: call_tests++;
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);
4330: test_ret++;
4331: printf(" %d", n_ctx);
4332: printf(" %d", n_name);
4333: printf("\n");
4334: }
4335: }
4336: }
4337: function_tests++;
4338:
4339: return(test_ret);
4340: }
4341:
4342:
4343: static int
4344: test_xmlSAX2GetLineNumber(void) {
4345: int test_ret = 0;
4346:
4347: int mem_base;
4348: int ret_val;
4349: void * ctx; /* the user data (XML parser context) */
4350: int n_ctx;
4351:
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);
4355:
4356: ret_val = xmlSAX2GetLineNumber(ctx);
4357: desret_int(ret_val);
4358: call_tests++;
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);
4364: test_ret++;
4365: printf(" %d", n_ctx);
4366: printf("\n");
4367: }
4368: }
4369: function_tests++;
4370:
4371: return(test_ret);
4372: }
4373:
4374:
4375: static int
4376: test_xmlSAX2GetParameterEntity(void) {
4377: int test_ret = 0;
4378:
4379: int mem_base;
4380: xmlEntityPtr ret_val;
4381: void * ctx; /* the user data (XML parser context) */
4382: int n_ctx;
4383: xmlChar * name; /* The entity name */
4384: int n_name;
4385:
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);
4391:
4392: ret_val = xmlSAX2GetParameterEntity(ctx, (const xmlChar *)name);
4393: desret_xmlEntityPtr(ret_val);
4394: call_tests++;
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);
4401: test_ret++;
4402: printf(" %d", n_ctx);
4403: printf(" %d", n_name);
4404: printf("\n");
4405: }
4406: }
4407: }
4408: function_tests++;
4409:
4410: return(test_ret);
4411: }
4412:
4413:
4414: static int
4415: test_xmlSAX2GetPublicId(void) {
4416: int test_ret = 0;
4417:
4418: int mem_base;
4419: const xmlChar * ret_val;
4420: void * ctx; /* the user data (XML parser context) */
4421: int n_ctx;
4422:
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);
4426:
4427: ret_val = xmlSAX2GetPublicId(ctx);
4428: desret_const_xmlChar_ptr(ret_val);
4429: call_tests++;
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);
4435: test_ret++;
4436: printf(" %d", n_ctx);
4437: printf("\n");
4438: }
4439: }
4440: function_tests++;
4441:
4442: return(test_ret);
4443: }
4444:
4445:
4446: static int
4447: test_xmlSAX2GetSystemId(void) {
4448: int test_ret = 0;
4449:
4450: int mem_base;
4451: const xmlChar * ret_val;
4452: void * ctx; /* the user data (XML parser context) */
4453: int n_ctx;
4454:
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);
4458:
4459: ret_val = xmlSAX2GetSystemId(ctx);
4460: desret_const_xmlChar_ptr(ret_val);
4461: call_tests++;
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);
4467: test_ret++;
4468: printf(" %d", n_ctx);
4469: printf("\n");
4470: }
4471: }
4472: function_tests++;
4473:
4474: return(test_ret);
4475: }
4476:
4477:
4478: static int
4479: test_xmlSAX2HasExternalSubset(void) {
4480: int test_ret = 0;
4481:
4482: int mem_base;
4483: int ret_val;
4484: void * ctx; /* the user data (XML parser context) */
4485: int n_ctx;
4486:
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);
4490:
4491: ret_val = xmlSAX2HasExternalSubset(ctx);
4492: desret_int(ret_val);
4493: call_tests++;
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);
4499: test_ret++;
4500: printf(" %d", n_ctx);
4501: printf("\n");
4502: }
4503: }
4504: function_tests++;
4505:
4506: return(test_ret);
4507: }
4508:
4509:
4510: static int
4511: test_xmlSAX2HasInternalSubset(void) {
4512: int test_ret = 0;
4513:
4514: int mem_base;
4515: int ret_val;
4516: void * ctx; /* the user data (XML parser context) */
4517: int n_ctx;
4518:
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);
4522:
4523: ret_val = xmlSAX2HasInternalSubset(ctx);
4524: desret_int(ret_val);
4525: call_tests++;
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);
4531: test_ret++;
4532: printf(" %d", n_ctx);
4533: printf("\n");
4534: }
4535: }
4536: function_tests++;
4537:
4538: return(test_ret);
4539: }
4540:
4541:
4542: static int
4543: test_xmlSAX2IgnorableWhitespace(void) {
4544: int test_ret = 0;
4545:
4546: int mem_base;
4547: void * ctx; /* the user data (XML parser context) */
4548: int n_ctx;
4549: xmlChar * ch; /* a xmlChar string */
4550: int n_ch;
4551: int len; /* the number of xmlChar */
4552: int n_len;
4553:
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);
4561:
4562: xmlSAX2IgnorableWhitespace(ctx, (const xmlChar *)ch, len);
4563: call_tests++;
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);
4571: test_ret++;
4572: printf(" %d", n_ctx);
4573: printf(" %d", n_ch);
4574: printf(" %d", n_len);
4575: printf("\n");
4576: }
4577: }
4578: }
4579: }
4580: function_tests++;
4581:
4582: return(test_ret);
4583: }
4584:
4585:
4586: #define gen_nb_xmlSAXHandler_ptr 1
4587: static xmlSAXHandler * gen_xmlSAXHandler_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
4588: return(NULL);
4589: }
4590: static void des_xmlSAXHandler_ptr(int no ATTRIBUTE_UNUSED, xmlSAXHandler * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
4591: }
4592:
4593: static int
4594: test_xmlSAX2InitDefaultSAXHandler(void) {
4595: int test_ret = 0;
4596:
4597: int mem_base;
4598: xmlSAXHandler * hdlr; /* the SAX handler */
4599: int n_hdlr;
4600: int warning; /* flag if non-zero sets the handler warning procedure */
4601: int n_warning;
4602:
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);
4608:
4609: xmlSAX2InitDefaultSAXHandler(hdlr, warning);
4610: call_tests++;
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);
4617: test_ret++;
4618: printf(" %d", n_hdlr);
4619: printf(" %d", n_warning);
4620: printf("\n");
4621: }
4622: }
4623: }
4624: function_tests++;
4625:
4626: return(test_ret);
4627: }
4628:
4629:
4630: static int
4631: test_xmlSAX2InitDocbDefaultSAXHandler(void) {
4632: int test_ret = 0;
4633:
4634: #if defined(LIBXML_DOCB_ENABLED)
4635: int mem_base;
4636: xmlSAXHandler * hdlr; /* the SAX handler */
4637: int n_hdlr;
4638:
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);
4642:
4643: xmlSAX2InitDocbDefaultSAXHandler(hdlr);
4644: call_tests++;
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);
4650: test_ret++;
4651: printf(" %d", n_hdlr);
4652: printf("\n");
4653: }
4654: }
4655: function_tests++;
4656: #endif
4657:
4658: return(test_ret);
4659: }
4660:
4661:
4662: static int
4663: test_xmlSAX2InitHtmlDefaultSAXHandler(void) {
4664: int test_ret = 0;
4665:
4666: #if defined(LIBXML_HTML_ENABLED)
4667: int mem_base;
4668: xmlSAXHandler * hdlr; /* the SAX handler */
4669: int n_hdlr;
4670:
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);
4674:
4675: xmlSAX2InitHtmlDefaultSAXHandler(hdlr);
4676: call_tests++;
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);
4682: test_ret++;
4683: printf(" %d", n_hdlr);
4684: printf("\n");
4685: }
4686: }
4687: function_tests++;
4688: #endif
4689:
4690: return(test_ret);
4691: }
4692:
4693:
4694: static int
4695: test_xmlSAX2InternalSubset(void) {
4696: int test_ret = 0;
4697:
4698: int mem_base;
4699: void * ctx; /* the user data (XML parser context) */
4700: int n_ctx;
4701: xmlChar * name; /* the root element name */
4702: int n_name;
4703: xmlChar * ExternalID; /* the external ID */
4704: int n_ExternalID;
4705: xmlChar * SystemID; /* the SYSTEM ID (e.g. filename or URL) */
4706: int n_SystemID;
4707:
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);
4717:
4718: xmlSAX2InternalSubset(ctx, (const xmlChar *)name, (const xmlChar *)ExternalID, (const xmlChar *)SystemID);
4719: call_tests++;
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);
4728: test_ret++;
4729: printf(" %d", n_ctx);
4730: printf(" %d", n_name);
4731: printf(" %d", n_ExternalID);
4732: printf(" %d", n_SystemID);
4733: printf("\n");
4734: }
4735: }
4736: }
4737: }
4738: }
4739: function_tests++;
4740:
4741: return(test_ret);
4742: }
4743:
4744:
4745: static int
4746: test_xmlSAX2IsStandalone(void) {
4747: int test_ret = 0;
4748:
4749: int mem_base;
4750: int ret_val;
4751: void * ctx; /* the user data (XML parser context) */
4752: int n_ctx;
4753:
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);
4757:
4758: ret_val = xmlSAX2IsStandalone(ctx);
4759: desret_int(ret_val);
4760: call_tests++;
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);
4766: test_ret++;
4767: printf(" %d", n_ctx);
4768: printf("\n");
4769: }
4770: }
4771: function_tests++;
4772:
4773: return(test_ret);
4774: }
4775:
4776:
4777: static int
4778: test_xmlSAX2NotationDecl(void) {
4779: int test_ret = 0;
4780:
4781: int mem_base;
4782: void * ctx; /* the user data (XML parser context) */
4783: int n_ctx;
4784: xmlChar * name; /* The name of the notation */
4785: int n_name;
4786: xmlChar * publicId; /* The public ID of the entity */
4787: int n_publicId;
4788: xmlChar * systemId; /* The system ID of the entity */
4789: int n_systemId;
4790:
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);
4800:
4801: xmlSAX2NotationDecl(ctx, (const xmlChar *)name, (const xmlChar *)publicId, (const xmlChar *)systemId);
4802: call_tests++;
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);
4811: test_ret++;
4812: printf(" %d", n_ctx);
4813: printf(" %d", n_name);
4814: printf(" %d", n_publicId);
4815: printf(" %d", n_systemId);
4816: printf("\n");
4817: }
4818: }
4819: }
4820: }
4821: }
4822: function_tests++;
4823:
4824: return(test_ret);
4825: }
4826:
4827:
4828: static int
4829: test_xmlSAX2ProcessingInstruction(void) {
4830: int test_ret = 0;
4831:
4832: int mem_base;
4833: void * ctx; /* the user data (XML parser context) */
4834: int n_ctx;
4835: xmlChar * target; /* the target name */
4836: int n_target;
4837: xmlChar * data; /* the PI data's */
4838: int n_data;
4839:
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);
4847:
4848: xmlSAX2ProcessingInstruction(ctx, (const xmlChar *)target, (const xmlChar *)data);
4849: call_tests++;
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);
4857: test_ret++;
4858: printf(" %d", n_ctx);
4859: printf(" %d", n_target);
4860: printf(" %d", n_data);
4861: printf("\n");
4862: }
4863: }
4864: }
4865: }
4866: function_tests++;
4867:
4868: return(test_ret);
4869: }
4870:
4871:
4872: static int
4873: test_xmlSAX2Reference(void) {
4874: int test_ret = 0;
4875:
4876: int mem_base;
4877: void * ctx; /* the user data (XML parser context) */
4878: int n_ctx;
4879: xmlChar * name; /* The entity name */
4880: int n_name;
4881:
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);
4887:
4888: xmlSAX2Reference(ctx, (const xmlChar *)name);
4889: call_tests++;
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);
4896: test_ret++;
4897: printf(" %d", n_ctx);
4898: printf(" %d", n_name);
4899: printf("\n");
4900: }
4901: }
4902: }
4903: function_tests++;
4904:
4905: return(test_ret);
4906: }
4907:
4908:
4909: static int
4910: test_xmlSAX2ResolveEntity(void) {
4911: int test_ret = 0;
4912:
4913: int mem_base;
4914: xmlParserInputPtr ret_val;
4915: void * ctx; /* the user data (XML parser context) */
4916: int n_ctx;
4917: xmlChar * publicId; /* The public ID of the entity */
4918: int n_publicId;
4919: xmlChar * systemId; /* The system ID of the entity */
4920: int n_systemId;
4921:
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);
4929:
4930: ret_val = xmlSAX2ResolveEntity(ctx, (const xmlChar *)publicId, (const xmlChar *)systemId);
4931: desret_xmlParserInputPtr(ret_val);
4932: call_tests++;
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);
4940: test_ret++;
4941: printf(" %d", n_ctx);
4942: printf(" %d", n_publicId);
4943: printf(" %d", n_systemId);
4944: printf("\n");
4945: }
4946: }
4947: }
4948: }
4949: function_tests++;
4950:
4951: return(test_ret);
4952: }
4953:
4954:
4955: #define gen_nb_xmlSAXLocatorPtr 1
4956: static xmlSAXLocatorPtr gen_xmlSAXLocatorPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
4957: return(NULL);
4958: }
4959: static void des_xmlSAXLocatorPtr(int no ATTRIBUTE_UNUSED, xmlSAXLocatorPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
4960: }
4961:
4962: static int
4963: test_xmlSAX2SetDocumentLocator(void) {
4964: int test_ret = 0;
4965:
4966: int mem_base;
4967: void * ctx; /* the user data (XML parser context) */
4968: int n_ctx;
4969: xmlSAXLocatorPtr loc; /* A SAX Locator */
4970: int n_loc;
4971:
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);
4977:
4978: xmlSAX2SetDocumentLocator(ctx, loc);
4979: call_tests++;
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);
4986: test_ret++;
4987: printf(" %d", n_ctx);
4988: printf(" %d", n_loc);
4989: printf("\n");
4990: }
4991: }
4992: }
4993: function_tests++;
4994:
4995: return(test_ret);
4996: }
4997:
4998:
4999: static int
5000: test_xmlSAX2StartDocument(void) {
5001: int test_ret = 0;
5002:
5003: int mem_base;
5004: void * ctx; /* the user data (XML parser context) */
5005: int n_ctx;
5006:
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);
5010:
5011: xmlSAX2StartDocument(ctx);
5012: call_tests++;
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);
5018: test_ret++;
5019: printf(" %d", n_ctx);
5020: printf("\n");
5021: }
5022: }
5023: function_tests++;
5024:
5025: return(test_ret);
5026: }
5027:
5028:
5029: static int
5030: test_xmlSAX2StartElement(void) {
5031: int test_ret = 0;
5032:
5033: #if defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_DOCB_ENABLED)
5034: #ifdef LIBXML_SAX1_ENABLED
5035: int mem_base;
5036: void * ctx; /* the user data (XML parser context) */
5037: int n_ctx;
5038: xmlChar * fullname; /* The element name, including namespace prefix */
5039: int n_fullname;
5040: xmlChar ** atts; /* An array of name/value attributes pairs, NULL terminated */
5041: int n_atts;
5042:
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);
5050:
5051: xmlSAX2StartElement(ctx, (const xmlChar *)fullname, (const xmlChar **)atts);
5052: call_tests++;
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);
5060: test_ret++;
5061: printf(" %d", n_ctx);
5062: printf(" %d", n_fullname);
5063: printf(" %d", n_atts);
5064: printf("\n");
5065: }
5066: }
5067: }
5068: }
5069: function_tests++;
5070: #endif
5071: #endif
5072:
5073: return(test_ret);
5074: }
5075:
5076:
5077: static int
5078: test_xmlSAX2StartElementNs(void) {
5079: int test_ret = 0;
5080:
5081: int mem_base;
5082: void * ctx; /* the user data (XML parser context) */
5083: int n_ctx;
5084: xmlChar * localname; /* the local name of the element */
5085: int n_localname;
5086: xmlChar * prefix; /* the element namespace prefix if available */
5087: int n_prefix;
5088: xmlChar * URI; /* the element namespace name if available */
5089: int n_URI;
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 */
5093: int n_namespaces;
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. */
5097: int n_nb_defaulted;
5098: xmlChar ** attributes; /* pointer to the array of (localname/prefix/URI/value/end) attribute values. */
5099: int n_attributes;
5100:
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);
5120:
5121: xmlSAX2StartElementNs(ctx, (const xmlChar *)localname, (const xmlChar *)prefix, (const xmlChar *)URI, nb_namespaces, (const xmlChar **)namespaces, nb_attributes, nb_defaulted, (const xmlChar **)attributes);
5122: call_tests++;
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);
5136: test_ret++;
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);
5146: printf("\n");
5147: }
5148: }
5149: }
5150: }
5151: }
5152: }
5153: }
5154: }
5155: }
5156: }
5157: function_tests++;
5158:
5159: return(test_ret);
5160: }
5161:
5162:
5163: static int
5164: test_xmlSAX2UnparsedEntityDecl(void) {
5165: int test_ret = 0;
5166:
5167: int mem_base;
5168: void * ctx; /* the user data (XML parser context) */
5169: int n_ctx;
5170: xmlChar * name; /* The name of the entity */
5171: int n_name;
5172: xmlChar * publicId; /* The public ID of the entity */
5173: int n_publicId;
5174: xmlChar * systemId; /* The system ID of the entity */
5175: int n_systemId;
5176: xmlChar * notationName; /* the name of the notation */
5177: int n_notationName;
5178:
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);
5190:
5191: xmlSAX2UnparsedEntityDecl(ctx, (const xmlChar *)name, (const xmlChar *)publicId, (const xmlChar *)systemId, (const xmlChar *)notationName);
5192: call_tests++;
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);
5202: test_ret++;
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);
5208: printf("\n");
5209: }
5210: }
5211: }
5212: }
5213: }
5214: }
5215: function_tests++;
5216:
5217: return(test_ret);
5218: }
5219:
5220:
5221: static int
5222: test_xmlSAXDefaultVersion(void) {
5223: int test_ret = 0;
5224:
5225: #if defined(LIBXML_SAX1_ENABLED)
5226: #ifdef LIBXML_SAX1_ENABLED
5227: int mem_base;
5228: int ret_val;
5229: int version; /* the version, 1 or 2 */
5230: int n_version;
5231:
5232: for (n_version = 0;n_version < gen_nb_int;n_version++) {
5233: mem_base = xmlMemBlocks();
5234: version = gen_int(n_version, 0);
5235:
5236: ret_val = xmlSAXDefaultVersion(version);
5237: desret_int(ret_val);
5238: call_tests++;
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);
5244: test_ret++;
5245: printf(" %d", n_version);
5246: printf("\n");
5247: }
5248: }
5249: function_tests++;
5250: #endif
5251: #endif
5252:
5253: return(test_ret);
5254: }
5255:
5256:
5257: static int
5258: test_xmlSAXVersion(void) {
5259: int test_ret = 0;
5260:
5261: int mem_base;
5262: int ret_val;
5263: xmlSAXHandler * hdlr; /* the SAX handler */
5264: int n_hdlr;
5265: int version; /* the version, 1 or 2 */
5266: int n_version;
5267:
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);
5273:
5274: ret_val = xmlSAXVersion(hdlr, version);
5275: desret_int(ret_val);
5276: call_tests++;
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);
5283: test_ret++;
5284: printf(" %d", n_hdlr);
5285: printf(" %d", n_version);
5286: printf("\n");
5287: }
5288: }
5289: }
5290: function_tests++;
5291:
5292: return(test_ret);
5293: }
5294:
5295: static int
5296: test_SAX2(void) {
5297: int test_ret = 0;
5298:
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();
5338:
5339: if (test_ret != 0)
5340: printf("Module SAX2: %d errors\n", test_ret);
5341: return(test_ret);
5342: }
5343:
5344: static int
5345: test_xmlC14NDocDumpMemory(void) {
5346: int test_ret = 0;
5347:
5348: #if defined(LIBXML_C14N_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
5349: int mem_base;
5350: int ret_val;
5351: xmlDocPtr doc; /* the XML document for canonization */
5352: int n_doc;
5353: xmlNodeSetPtr nodes; /* the nodes set to be included in the canonized image or NULL if all document nodes should be included */
5354: int n_nodes;
5355: int mode; /* the c14n mode (see @xmlC14NMode) */
5356: int n_mode;
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 */
5362: int n_doc_txt_ptr;
5363:
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);
5377:
5378: ret_val = xmlC14NDocDumpMemory(doc, nodes, mode, inclusive_ns_prefixes, with_comments, doc_txt_ptr);
5379: desret_int(ret_val);
5380: call_tests++;
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);
5391: test_ret++;
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);
5398: printf("\n");
5399: }
5400: }
5401: }
5402: }
5403: }
5404: }
5405: }
5406: function_tests++;
5407: #endif
5408:
5409: return(test_ret);
5410: }
5411:
5412:
5413: static int
5414: test_xmlC14NDocSave(void) {
5415: int test_ret = 0;
5416:
5417: #if defined(LIBXML_C14N_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
5418: int mem_base;
5419: int ret_val;
5420: xmlDocPtr doc; /* the XML document for canonization */
5421: int n_doc;
5422: xmlNodeSetPtr nodes; /* the nodes set to be included in the canonized image or NULL if all document nodes should be included */
5423: int n_nodes;
5424: int mode; /* the c14n mode (see @xmlC14NMode) */
5425: int n_mode;
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 */
5431: int n_filename;
5432: int compression; /* the compression level (zlib requred): -1 - libxml default, 0 - uncompressed, >0 - compression level */
5433: int n_compression;
5434:
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);
5450:
5451: ret_val = xmlC14NDocSave(doc, nodes, mode, inclusive_ns_prefixes, with_comments, filename, compression);
5452: desret_int(ret_val);
5453: call_tests++;
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);
5465: test_ret++;
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);
5473: printf("\n");
5474: }
5475: }
5476: }
5477: }
5478: }
5479: }
5480: }
5481: }
5482: function_tests++;
5483: #endif
5484:
5485: return(test_ret);
5486: }
5487:
5488:
5489: static int
5490: test_xmlC14NDocSaveTo(void) {
5491: int test_ret = 0;
5492:
5493: #if defined(LIBXML_C14N_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
5494: int mem_base;
5495: int ret_val;
5496: xmlDocPtr doc; /* the XML document for canonization */
5497: int n_doc;
5498: xmlNodeSetPtr nodes; /* the nodes set to be included in the canonized image or NULL if all document nodes should be included */
5499: int n_nodes;
5500: int mode; /* the c14n mode (see @xmlC14NMode) */
5501: int n_mode;
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 */
5507: int n_buf;
5508:
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);
5522:
5523: ret_val = xmlC14NDocSaveTo(doc, nodes, mode, inclusive_ns_prefixes, with_comments, buf);
5524: desret_int(ret_val);
5525: call_tests++;
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);
5536: test_ret++;
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);
5543: printf("\n");
5544: }
5545: }
5546: }
5547: }
5548: }
5549: }
5550: }
5551: function_tests++;
5552: #endif
5553:
5554: return(test_ret);
5555: }
5556:
5557:
5558: static int
5559: test_xmlC14NExecute(void) {
5560: int test_ret = 0;
5561:
5562:
5563: /* missing type support */
5564: return(test_ret);
5565: }
5566:
5567: static int
5568: test_c14n(void) {
5569: int test_ret = 0;
5570:
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();
5576:
5577: if (test_ret != 0)
5578: printf("Module c14n: %d errors\n", test_ret);
5579: return(test_ret);
5580: }
5581: #ifdef LIBXML_CATALOG_ENABLED
5582:
5583: #define gen_nb_xmlCatalogPtr 1
5584: static xmlCatalogPtr gen_xmlCatalogPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
5585: return(NULL);
5586: }
5587: static void des_xmlCatalogPtr(int no ATTRIBUTE_UNUSED, xmlCatalogPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
5588: }
5589: #endif
5590:
5591:
5592: static int
5593: test_xmlACatalogAdd(void) {
5594: int test_ret = 0;
5595:
5596: #if defined(LIBXML_CATALOG_ENABLED)
5597: int mem_base;
5598: int ret_val;
5599: xmlCatalogPtr catal; /* a Catalog */
5600: int n_catal;
5601: xmlChar * type; /* the type of record to add to the catalog */
5602: int n_type;
5603: xmlChar * orig; /* the system, public or prefix to match */
5604: int n_orig;
5605: xmlChar * replace; /* the replacement value for the match */
5606: int n_replace;
5607:
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);
5617:
5618: ret_val = xmlACatalogAdd(catal, (const xmlChar *)type, (const xmlChar *)orig, (const xmlChar *)replace);
5619: desret_int(ret_val);
5620: call_tests++;
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);
5629: test_ret++;
5630: printf(" %d", n_catal);
5631: printf(" %d", n_type);
5632: printf(" %d", n_orig);
5633: printf(" %d", n_replace);
5634: printf("\n");
5635: }
5636: }
5637: }
5638: }
5639: }
5640: function_tests++;
5641: #endif
5642:
5643: return(test_ret);
5644: }
5645:
5646:
5647: static int
5648: test_xmlACatalogDump(void) {
5649: int test_ret = 0;
5650:
5651: #if defined(LIBXML_CATALOG_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
5652: int mem_base;
5653: xmlCatalogPtr catal; /* a Catalog */
5654: int n_catal;
5655: FILE * out; /* the file. */
5656: int n_out;
5657:
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);
5663:
5664: xmlACatalogDump(catal, out);
5665: call_tests++;
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);
5672: test_ret++;
5673: printf(" %d", n_catal);
5674: printf(" %d", n_out);
5675: printf("\n");
5676: }
5677: }
5678: }
5679: function_tests++;
5680: #endif
5681:
5682: return(test_ret);
5683: }
5684:
5685:
5686: static int
5687: test_xmlACatalogRemove(void) {
5688: int test_ret = 0;
5689:
5690: #if defined(LIBXML_CATALOG_ENABLED)
5691: int mem_base;
5692: int ret_val;
5693: xmlCatalogPtr catal; /* a Catalog */
5694: int n_catal;
5695: xmlChar * value; /* the value to remove */
5696: int n_value;
5697:
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);
5703:
5704: ret_val = xmlACatalogRemove(catal, (const xmlChar *)value);
5705: desret_int(ret_val);
5706: call_tests++;
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);
5713: test_ret++;
5714: printf(" %d", n_catal);
5715: printf(" %d", n_value);
5716: printf("\n");
5717: }
5718: }
5719: }
5720: function_tests++;
5721: #endif
5722:
5723: return(test_ret);
5724: }
5725:
5726:
5727: static int
5728: test_xmlACatalogResolve(void) {
5729: int test_ret = 0;
5730:
5731: #if defined(LIBXML_CATALOG_ENABLED)
5732: int mem_base;
5733: xmlChar * ret_val;
5734: xmlCatalogPtr catal; /* a Catalog */
5735: int n_catal;
5736: xmlChar * pubID; /* the public ID string */
5737: int n_pubID;
5738: xmlChar * sysID; /* the system ID string */
5739: int n_sysID;
5740:
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);
5748:
5749: ret_val = xmlACatalogResolve(catal, (const xmlChar *)pubID, (const xmlChar *)sysID);
5750: desret_xmlChar_ptr(ret_val);
5751: call_tests++;
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);
5759: test_ret++;
5760: printf(" %d", n_catal);
5761: printf(" %d", n_pubID);
5762: printf(" %d", n_sysID);
5763: printf("\n");
5764: }
5765: }
5766: }
5767: }
5768: function_tests++;
5769: #endif
5770:
5771: return(test_ret);
5772: }
5773:
5774:
5775: static int
5776: test_xmlACatalogResolvePublic(void) {
5777: int test_ret = 0;
5778:
5779: #if defined(LIBXML_CATALOG_ENABLED)
5780: int mem_base;
5781: xmlChar * ret_val;
5782: xmlCatalogPtr catal; /* a Catalog */
5783: int n_catal;
5784: xmlChar * pubID; /* the public ID string */
5785: int n_pubID;
5786:
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);
5792:
5793: ret_val = xmlACatalogResolvePublic(catal, (const xmlChar *)pubID);
5794: desret_xmlChar_ptr(ret_val);
5795: call_tests++;
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);
5802: test_ret++;
5803: printf(" %d", n_catal);
5804: printf(" %d", n_pubID);
5805: printf("\n");
5806: }
5807: }
5808: }
5809: function_tests++;
5810: #endif
5811:
5812: return(test_ret);
5813: }
5814:
5815:
5816: static int
5817: test_xmlACatalogResolveSystem(void) {
5818: int test_ret = 0;
5819:
5820: #if defined(LIBXML_CATALOG_ENABLED)
5821: int mem_base;
5822: xmlChar * ret_val;
5823: xmlCatalogPtr catal; /* a Catalog */
5824: int n_catal;
5825: xmlChar * sysID; /* the system ID string */
5826: int n_sysID;
5827:
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);
5833:
5834: ret_val = xmlACatalogResolveSystem(catal, (const xmlChar *)sysID);
5835: desret_xmlChar_ptr(ret_val);
5836: call_tests++;
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);
5843: test_ret++;
5844: printf(" %d", n_catal);
5845: printf(" %d", n_sysID);
5846: printf("\n");
5847: }
5848: }
5849: }
5850: function_tests++;
5851: #endif
5852:
5853: return(test_ret);
5854: }
5855:
5856:
5857: static int
5858: test_xmlACatalogResolveURI(void) {
5859: int test_ret = 0;
5860:
5861: #if defined(LIBXML_CATALOG_ENABLED)
5862: int mem_base;
5863: xmlChar * ret_val;
5864: xmlCatalogPtr catal; /* a Catalog */
5865: int n_catal;
5866: xmlChar * URI; /* the URI */
5867: int n_URI;
5868:
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);
5874:
5875: ret_val = xmlACatalogResolveURI(catal, (const xmlChar *)URI);
5876: desret_xmlChar_ptr(ret_val);
5877: call_tests++;
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);
5884: test_ret++;
5885: printf(" %d", n_catal);
5886: printf(" %d", n_URI);
5887: printf("\n");
5888: }
5889: }
5890: }
5891: function_tests++;
5892: #endif
5893:
5894: return(test_ret);
5895: }
5896:
5897:
5898: static int
5899: test_xmlCatalogAdd(void) {
5900: int test_ret = 0;
5901:
5902: #if defined(LIBXML_CATALOG_ENABLED)
5903: int mem_base;
5904: int ret_val;
5905: xmlChar * type; /* the type of record to add to the catalog */
5906: int n_type;
5907: xmlChar * orig; /* the system, public or prefix to match */
5908: int n_orig;
5909: xmlChar * replace; /* the replacement value for the match */
5910: int n_replace;
5911:
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);
5919:
5920: ret_val = xmlCatalogAdd((const xmlChar *)type, (const xmlChar *)orig, (const xmlChar *)replace);
5921: desret_int(ret_val);
5922: call_tests++;
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);
5930: test_ret++;
5931: printf(" %d", n_type);
5932: printf(" %d", n_orig);
5933: printf(" %d", n_replace);
5934: printf("\n");
5935: }
5936: }
5937: }
5938: }
5939: function_tests++;
5940: #endif
5941:
5942: return(test_ret);
5943: }
5944:
5945:
5946: static int
5947: test_xmlCatalogCleanup(void) {
5948: int test_ret = 0;
5949:
5950: #if defined(LIBXML_CATALOG_ENABLED)
5951:
5952:
5953: xmlCatalogCleanup();
5954: call_tests++;
5955: xmlResetLastError();
5956: function_tests++;
5957: #endif
5958:
5959: return(test_ret);
5960: }
5961:
5962:
5963: static int
5964: test_xmlCatalogConvert(void) {
5965: int test_ret = 0;
5966:
5967: #if defined(LIBXML_CATALOG_ENABLED)
5968: int ret_val;
5969:
5970:
5971: ret_val = xmlCatalogConvert();
5972: desret_int(ret_val);
5973: call_tests++;
5974: xmlResetLastError();
5975: function_tests++;
5976: #endif
5977:
5978: return(test_ret);
5979: }
5980:
5981:
5982: static int
5983: test_xmlCatalogDump(void) {
5984: int test_ret = 0;
5985:
5986: #if defined(LIBXML_CATALOG_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
5987: int mem_base;
5988: FILE * out; /* the file. */
5989: int n_out;
5990:
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);
5994:
5995: xmlCatalogDump(out);
5996: call_tests++;
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);
6002: test_ret++;
6003: printf(" %d", n_out);
6004: printf("\n");
6005: }
6006: }
6007: function_tests++;
6008: #endif
6009:
6010: return(test_ret);
6011: }
6012:
6013:
6014: static int
6015: test_xmlCatalogGetDefaults(void) {
6016: int test_ret = 0;
6017:
6018: #if defined(LIBXML_CATALOG_ENABLED)
6019: int mem_base;
6020: xmlCatalogAllow ret_val;
6021:
6022: mem_base = xmlMemBlocks();
6023:
6024: ret_val = xmlCatalogGetDefaults();
6025: desret_xmlCatalogAllow(ret_val);
6026: call_tests++;
6027: xmlResetLastError();
6028: if (mem_base != xmlMemBlocks()) {
6029: printf("Leak of %d blocks found in xmlCatalogGetDefaults",
6030: xmlMemBlocks() - mem_base);
6031: test_ret++;
6032: printf("\n");
6033: }
6034: function_tests++;
6035: #endif
6036:
6037: return(test_ret);
6038: }
6039:
6040:
6041: static int
6042: test_xmlCatalogIsEmpty(void) {
6043: int test_ret = 0;
6044:
6045: #if defined(LIBXML_CATALOG_ENABLED)
6046: int mem_base;
6047: int ret_val;
6048: xmlCatalogPtr catal; /* should this create an SGML catalog */
6049: int n_catal;
6050:
6051: for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
6052: mem_base = xmlMemBlocks();
6053: catal = gen_xmlCatalogPtr(n_catal, 0);
6054:
6055: ret_val = xmlCatalogIsEmpty(catal);
6056: desret_int(ret_val);
6057: call_tests++;
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);
6063: test_ret++;
6064: printf(" %d", n_catal);
6065: printf("\n");
6066: }
6067: }
6068: function_tests++;
6069: #endif
6070:
6071: return(test_ret);
6072: }
6073:
6074:
6075: static int
6076: test_xmlCatalogLocalResolve(void) {
6077: int test_ret = 0;
6078:
6079: #if defined(LIBXML_CATALOG_ENABLED)
6080: int mem_base;
6081: xmlChar * ret_val;
6082: void * catalogs; /* a document's list of catalogs */
6083: int n_catalogs;
6084: xmlChar * pubID; /* the public ID string */
6085: int n_pubID;
6086: xmlChar * sysID; /* the system ID string */
6087: int n_sysID;
6088:
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);
6096:
6097: ret_val = xmlCatalogLocalResolve(catalogs, (const xmlChar *)pubID, (const xmlChar *)sysID);
6098: desret_xmlChar_ptr(ret_val);
6099: call_tests++;
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);
6107: test_ret++;
6108: printf(" %d", n_catalogs);
6109: printf(" %d", n_pubID);
6110: printf(" %d", n_sysID);
6111: printf("\n");
6112: }
6113: }
6114: }
6115: }
6116: function_tests++;
6117: #endif
6118:
6119: return(test_ret);
6120: }
6121:
6122:
6123: static int
6124: test_xmlCatalogLocalResolveURI(void) {
6125: int test_ret = 0;
6126:
6127: #if defined(LIBXML_CATALOG_ENABLED)
6128: int mem_base;
6129: xmlChar * ret_val;
6130: void * catalogs; /* a document's list of catalogs */
6131: int n_catalogs;
6132: xmlChar * URI; /* the URI */
6133: int n_URI;
6134:
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);
6140:
6141: ret_val = xmlCatalogLocalResolveURI(catalogs, (const xmlChar *)URI);
6142: desret_xmlChar_ptr(ret_val);
6143: call_tests++;
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);
6150: test_ret++;
6151: printf(" %d", n_catalogs);
6152: printf(" %d", n_URI);
6153: printf("\n");
6154: }
6155: }
6156: }
6157: function_tests++;
6158: #endif
6159:
6160: return(test_ret);
6161: }
6162:
6163:
6164: static int
6165: test_xmlCatalogRemove(void) {
6166: int test_ret = 0;
6167:
6168: #if defined(LIBXML_CATALOG_ENABLED)
6169: int ret_val;
6170: xmlChar * value; /* the value to remove */
6171: int n_value;
6172:
6173: for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
6174: value = gen_const_xmlChar_ptr(n_value, 0);
6175:
6176: ret_val = xmlCatalogRemove((const xmlChar *)value);
6177: desret_int(ret_val);
6178: call_tests++;
6179: des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
6180: xmlResetLastError();
6181: }
6182: function_tests++;
6183: #endif
6184:
6185: return(test_ret);
6186: }
6187:
6188:
6189: static int
6190: test_xmlCatalogResolve(void) {
6191: int test_ret = 0;
6192:
6193: #if defined(LIBXML_CATALOG_ENABLED)
6194: xmlChar * ret_val;
6195: xmlChar * pubID; /* the public ID string */
6196: int n_pubID;
6197: xmlChar * sysID; /* the system ID string */
6198: int n_sysID;
6199:
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);
6204:
6205: ret_val = xmlCatalogResolve((const xmlChar *)pubID, (const xmlChar *)sysID);
6206: desret_xmlChar_ptr(ret_val);
6207: call_tests++;
6208: des_const_xmlChar_ptr(n_pubID, (const xmlChar *)pubID, 0);
6209: des_const_xmlChar_ptr(n_sysID, (const xmlChar *)sysID, 1);
6210: xmlResetLastError();
6211: }
6212: }
6213: function_tests++;
6214: #endif
6215:
6216: return(test_ret);
6217: }
6218:
6219:
6220: static int
6221: test_xmlCatalogResolvePublic(void) {
6222: int test_ret = 0;
6223:
6224: #if defined(LIBXML_CATALOG_ENABLED)
6225: int mem_base;
6226: xmlChar * ret_val;
6227: xmlChar * pubID; /* the public ID string */
6228: int n_pubID;
6229:
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);
6233:
6234: ret_val = xmlCatalogResolvePublic((const xmlChar *)pubID);
6235: desret_xmlChar_ptr(ret_val);
6236: call_tests++;
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);
6242: test_ret++;
6243: printf(" %d", n_pubID);
6244: printf("\n");
6245: }
6246: }
6247: function_tests++;
6248: #endif
6249:
6250: return(test_ret);
6251: }
6252:
6253:
6254: static int
6255: test_xmlCatalogResolveSystem(void) {
6256: int test_ret = 0;
6257:
6258: #if defined(LIBXML_CATALOG_ENABLED)
6259: int mem_base;
6260: xmlChar * ret_val;
6261: xmlChar * sysID; /* the system ID string */
6262: int n_sysID;
6263:
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);
6267:
6268: ret_val = xmlCatalogResolveSystem((const xmlChar *)sysID);
6269: desret_xmlChar_ptr(ret_val);
6270: call_tests++;
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);
6276: test_ret++;
6277: printf(" %d", n_sysID);
6278: printf("\n");
6279: }
6280: }
6281: function_tests++;
6282: #endif
6283:
6284: return(test_ret);
6285: }
6286:
6287:
6288: static int
6289: test_xmlCatalogResolveURI(void) {
6290: int test_ret = 0;
6291:
6292: #if defined(LIBXML_CATALOG_ENABLED)
6293: int mem_base;
6294: xmlChar * ret_val;
6295: xmlChar * URI; /* the URI */
6296: int n_URI;
6297:
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);
6301:
6302: ret_val = xmlCatalogResolveURI((const xmlChar *)URI);
6303: desret_xmlChar_ptr(ret_val);
6304: call_tests++;
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);
6310: test_ret++;
6311: printf(" %d", n_URI);
6312: printf("\n");
6313: }
6314: }
6315: function_tests++;
6316: #endif
6317:
6318: return(test_ret);
6319: }
6320:
6321:
6322: static int
6323: test_xmlCatalogSetDefaultPrefer(void) {
6324: int test_ret = 0;
6325:
6326: #if defined(LIBXML_CATALOG_ENABLED)
6327: int mem_base;
6328: xmlCatalogPrefer ret_val;
6329: xmlCatalogPrefer prefer; /* the default preference for delegation */
6330: int n_prefer;
6331:
6332: for (n_prefer = 0;n_prefer < gen_nb_xmlCatalogPrefer;n_prefer++) {
6333: mem_base = xmlMemBlocks();
6334: prefer = gen_xmlCatalogPrefer(n_prefer, 0);
6335:
6336: ret_val = xmlCatalogSetDefaultPrefer(prefer);
6337: desret_xmlCatalogPrefer(ret_val);
6338: call_tests++;
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);
6344: test_ret++;
6345: printf(" %d", n_prefer);
6346: printf("\n");
6347: }
6348: }
6349: function_tests++;
6350: #endif
6351:
6352: return(test_ret);
6353: }
6354:
6355:
6356: static int
6357: test_xmlCatalogSetDefaults(void) {
6358: int test_ret = 0;
6359:
6360: #if defined(LIBXML_CATALOG_ENABLED)
6361: int mem_base;
6362: xmlCatalogAllow allow; /* what catalogs should be accepted */
6363: int n_allow;
6364:
6365: for (n_allow = 0;n_allow < gen_nb_xmlCatalogAllow;n_allow++) {
6366: mem_base = xmlMemBlocks();
6367: allow = gen_xmlCatalogAllow(n_allow, 0);
6368:
6369: xmlCatalogSetDefaults(allow);
6370: call_tests++;
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);
6376: test_ret++;
6377: printf(" %d", n_allow);
6378: printf("\n");
6379: }
6380: }
6381: function_tests++;
6382: #endif
6383:
6384: return(test_ret);
6385: }
6386:
6387:
6388: static int
6389: test_xmlConvertSGMLCatalog(void) {
6390: int test_ret = 0;
6391:
6392: #if defined(LIBXML_CATALOG_ENABLED)
6393: int mem_base;
6394: int ret_val;
6395: xmlCatalogPtr catal; /* the catalog */
6396: int n_catal;
6397:
6398: for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
6399: mem_base = xmlMemBlocks();
6400: catal = gen_xmlCatalogPtr(n_catal, 0);
6401:
6402: ret_val = xmlConvertSGMLCatalog(catal);
6403: desret_int(ret_val);
6404: call_tests++;
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);
6410: test_ret++;
6411: printf(" %d", n_catal);
6412: printf("\n");
6413: }
6414: }
6415: function_tests++;
6416: #endif
6417:
6418: return(test_ret);
6419: }
6420:
6421:
6422: static int
6423: test_xmlInitializeCatalog(void) {
6424: int test_ret = 0;
6425:
6426: #if defined(LIBXML_CATALOG_ENABLED)
6427: int mem_base;
6428:
6429: mem_base = xmlMemBlocks();
6430:
6431: xmlInitializeCatalog();
6432: call_tests++;
6433: xmlResetLastError();
6434: if (mem_base != xmlMemBlocks()) {
6435: printf("Leak of %d blocks found in xmlInitializeCatalog",
6436: xmlMemBlocks() - mem_base);
6437: test_ret++;
6438: printf("\n");
6439: }
6440: function_tests++;
6441: #endif
6442:
6443: return(test_ret);
6444: }
6445:
6446:
6447: static int
6448: test_xmlLoadACatalog(void) {
6449: int test_ret = 0;
6450:
6451:
6452: /* missing type support */
6453: return(test_ret);
6454: }
6455:
6456:
6457: static int
6458: test_xmlLoadCatalog(void) {
6459: int test_ret = 0;
6460:
6461: #if defined(LIBXML_CATALOG_ENABLED)
6462: int ret_val;
6463: const char * filename; /* a file path */
6464: int n_filename;
6465:
6466: for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
6467: filename = gen_filepath(n_filename, 0);
6468:
6469: ret_val = xmlLoadCatalog(filename);
6470: desret_int(ret_val);
6471: call_tests++;
6472: des_filepath(n_filename, filename, 0);
6473: xmlResetLastError();
6474: }
6475: function_tests++;
6476: #endif
6477:
6478: return(test_ret);
6479: }
6480:
6481:
6482: static int
6483: test_xmlLoadCatalogs(void) {
6484: int test_ret = 0;
6485:
6486: #if defined(LIBXML_CATALOG_ENABLED)
6487: char * pathss; /* a list of directories separated by a colon or a space. */
6488: int n_pathss;
6489:
6490: for (n_pathss = 0;n_pathss < gen_nb_const_char_ptr;n_pathss++) {
6491: pathss = gen_const_char_ptr(n_pathss, 0);
6492:
6493: xmlLoadCatalogs((const char *)pathss);
6494: call_tests++;
6495: des_const_char_ptr(n_pathss, (const char *)pathss, 0);
6496: xmlResetLastError();
6497: }
6498: function_tests++;
6499: #endif
6500:
6501: return(test_ret);
6502: }
6503:
6504:
6505: static int
6506: test_xmlLoadSGMLSuperCatalog(void) {
6507: int test_ret = 0;
6508:
6509:
6510: /* missing type support */
6511: return(test_ret);
6512: }
6513:
6514:
6515: static int
6516: test_xmlNewCatalog(void) {
6517: int test_ret = 0;
6518:
6519:
6520: /* missing type support */
6521: return(test_ret);
6522: }
6523:
6524:
6525: static int
6526: test_xmlParseCatalogFile(void) {
6527: int test_ret = 0;
6528:
6529: #if defined(LIBXML_CATALOG_ENABLED)
6530: int mem_base;
6531: xmlDocPtr ret_val;
6532: const char * filename; /* the filename */
6533: int n_filename;
6534:
6535: for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
6536: mem_base = xmlMemBlocks();
6537: filename = gen_filepath(n_filename, 0);
6538:
6539: ret_val = xmlParseCatalogFile(filename);
6540: desret_xmlDocPtr(ret_val);
6541: call_tests++;
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);
6547: test_ret++;
6548: printf(" %d", n_filename);
6549: printf("\n");
6550: }
6551: }
6552: function_tests++;
6553: #endif
6554:
6555: return(test_ret);
6556: }
6557:
6558: static int
6559: test_catalog(void) {
6560: int test_ret = 0;
6561:
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();
6593:
6594: if (test_ret != 0)
6595: printf("Module catalog: %d errors\n", test_ret);
6596: return(test_ret);
6597: }
6598:
6599: #define gen_nb_const_xmlChRangeGroup_ptr 1
6600: static xmlChRangeGroup * gen_const_xmlChRangeGroup_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
6601: return(NULL);
6602: }
6603: static void des_const_xmlChRangeGroup_ptr(int no ATTRIBUTE_UNUSED, const xmlChRangeGroup * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
6604: }
6605:
6606: static int
6607: test_xmlCharInRange(void) {
6608: int test_ret = 0;
6609:
6610: int mem_base;
6611: int ret_val;
6612: unsigned int val; /* character to be validated */
6613: int n_val;
6614: xmlChRangeGroup * rptr; /* pointer to range to be used to validate */
6615: int n_rptr;
6616:
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);
6622:
6623: ret_val = xmlCharInRange(val, (const xmlChRangeGroup *)rptr);
6624: desret_int(ret_val);
6625: call_tests++;
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);
6632: test_ret++;
6633: printf(" %d", n_val);
6634: printf(" %d", n_rptr);
6635: printf("\n");
6636: }
6637: }
6638: }
6639: function_tests++;
6640:
6641: return(test_ret);
6642: }
6643:
6644:
6645: static int
6646: test_xmlIsBaseChar(void) {
6647: int test_ret = 0;
6648:
6649: int mem_base;
6650: int ret_val;
6651: unsigned int ch; /* character to validate */
6652: int n_ch;
6653:
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);
6657:
6658: ret_val = xmlIsBaseChar(ch);
6659: desret_int(ret_val);
6660: call_tests++;
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);
6666: test_ret++;
6667: printf(" %d", n_ch);
6668: printf("\n");
6669: }
6670: }
6671: function_tests++;
6672:
6673: return(test_ret);
6674: }
6675:
6676:
6677: static int
6678: test_xmlIsBlank(void) {
6679: int test_ret = 0;
6680:
6681: int mem_base;
6682: int ret_val;
6683: unsigned int ch; /* character to validate */
6684: int n_ch;
6685:
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);
6689:
6690: ret_val = xmlIsBlank(ch);
6691: desret_int(ret_val);
6692: call_tests++;
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);
6698: test_ret++;
6699: printf(" %d", n_ch);
6700: printf("\n");
6701: }
6702: }
6703: function_tests++;
6704:
6705: return(test_ret);
6706: }
6707:
6708:
6709: static int
6710: test_xmlIsChar(void) {
6711: int test_ret = 0;
6712:
6713: int mem_base;
6714: int ret_val;
6715: unsigned int ch; /* character to validate */
6716: int n_ch;
6717:
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);
6721:
6722: ret_val = xmlIsChar(ch);
6723: desret_int(ret_val);
6724: call_tests++;
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);
6730: test_ret++;
6731: printf(" %d", n_ch);
6732: printf("\n");
6733: }
6734: }
6735: function_tests++;
6736:
6737: return(test_ret);
6738: }
6739:
6740:
6741: static int
6742: test_xmlIsCombining(void) {
6743: int test_ret = 0;
6744:
6745: int mem_base;
6746: int ret_val;
6747: unsigned int ch; /* character to validate */
6748: int n_ch;
6749:
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);
6753:
6754: ret_val = xmlIsCombining(ch);
6755: desret_int(ret_val);
6756: call_tests++;
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);
6762: test_ret++;
6763: printf(" %d", n_ch);
6764: printf("\n");
6765: }
6766: }
6767: function_tests++;
6768:
6769: return(test_ret);
6770: }
6771:
6772:
6773: static int
6774: test_xmlIsDigit(void) {
6775: int test_ret = 0;
6776:
6777: int mem_base;
6778: int ret_val;
6779: unsigned int ch; /* character to validate */
6780: int n_ch;
6781:
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);
6785:
6786: ret_val = xmlIsDigit(ch);
6787: desret_int(ret_val);
6788: call_tests++;
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);
6794: test_ret++;
6795: printf(" %d", n_ch);
6796: printf("\n");
6797: }
6798: }
6799: function_tests++;
6800:
6801: return(test_ret);
6802: }
6803:
6804:
6805: static int
6806: test_xmlIsExtender(void) {
6807: int test_ret = 0;
6808:
6809: int mem_base;
6810: int ret_val;
6811: unsigned int ch; /* character to validate */
6812: int n_ch;
6813:
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);
6817:
6818: ret_val = xmlIsExtender(ch);
6819: desret_int(ret_val);
6820: call_tests++;
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);
6826: test_ret++;
6827: printf(" %d", n_ch);
6828: printf("\n");
6829: }
6830: }
6831: function_tests++;
6832:
6833: return(test_ret);
6834: }
6835:
6836:
6837: static int
6838: test_xmlIsIdeographic(void) {
6839: int test_ret = 0;
6840:
6841: int mem_base;
6842: int ret_val;
6843: unsigned int ch; /* character to validate */
6844: int n_ch;
6845:
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);
6849:
6850: ret_val = xmlIsIdeographic(ch);
6851: desret_int(ret_val);
6852: call_tests++;
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);
6858: test_ret++;
6859: printf(" %d", n_ch);
6860: printf("\n");
6861: }
6862: }
6863: function_tests++;
6864:
6865: return(test_ret);
6866: }
6867:
6868:
6869: static int
6870: test_xmlIsPubidChar(void) {
6871: int test_ret = 0;
6872:
6873: int mem_base;
6874: int ret_val;
6875: unsigned int ch; /* character to validate */
6876: int n_ch;
6877:
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);
6881:
6882: ret_val = xmlIsPubidChar(ch);
6883: desret_int(ret_val);
6884: call_tests++;
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);
6890: test_ret++;
6891: printf(" %d", n_ch);
6892: printf("\n");
6893: }
6894: }
6895: function_tests++;
6896:
6897: return(test_ret);
6898: }
6899:
6900: static int
6901: test_chvalid(void) {
6902: int test_ret = 0;
6903:
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();
6914:
6915: if (test_ret != 0)
6916: printf("Module chvalid: %d errors\n", test_ret);
6917: return(test_ret);
6918: }
6919:
6920: static int
6921: test_xmlBoolToText(void) {
6922: int test_ret = 0;
6923:
6924: #if defined(LIBXML_DEBUG_ENABLED)
6925: int mem_base;
6926: const char * ret_val;
6927: int boolval; /* a bool to turn into text */
6928: int n_boolval;
6929:
6930: for (n_boolval = 0;n_boolval < gen_nb_int;n_boolval++) {
6931: mem_base = xmlMemBlocks();
6932: boolval = gen_int(n_boolval, 0);
6933:
6934: ret_val = xmlBoolToText(boolval);
6935: desret_const_char_ptr(ret_val);
6936: call_tests++;
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);
6942: test_ret++;
6943: printf(" %d", n_boolval);
6944: printf("\n");
6945: }
6946: }
6947: function_tests++;
6948: #endif
6949:
6950: return(test_ret);
6951: }
6952:
6953:
6954: static int
6955: test_xmlDebugCheckDocument(void) {
6956: int test_ret = 0;
6957:
6958: #if defined(LIBXML_DEBUG_ENABLED)
6959: int mem_base;
6960: int ret_val;
6961: FILE * output; /* the FILE * for the output */
6962: int n_output;
6963: xmlDocPtr doc; /* the document */
6964: int n_doc;
6965:
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);
6971:
6972: ret_val = xmlDebugCheckDocument(output, doc);
6973: desret_int(ret_val);
6974: call_tests++;
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);
6981: test_ret++;
6982: printf(" %d", n_output);
6983: printf(" %d", n_doc);
6984: printf("\n");
6985: }
6986: }
6987: }
6988: function_tests++;
6989: #endif
6990:
6991: return(test_ret);
6992: }
6993:
6994:
6995: static int
6996: test_xmlDebugDumpAttr(void) {
6997: int test_ret = 0;
6998:
6999: #if defined(LIBXML_DEBUG_ENABLED)
7000: int mem_base;
7001: FILE * output; /* the FILE * for the output */
7002: int n_output;
7003: xmlAttrPtr attr; /* the attribute */
7004: int n_attr;
7005: int depth; /* the indentation level. */
7006: int n_depth;
7007:
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);
7015:
7016: xmlDebugDumpAttr(output, attr, depth);
7017: call_tests++;
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);
7025: test_ret++;
7026: printf(" %d", n_output);
7027: printf(" %d", n_attr);
7028: printf(" %d", n_depth);
7029: printf("\n");
7030: }
7031: }
7032: }
7033: }
7034: function_tests++;
7035: #endif
7036:
7037: return(test_ret);
7038: }
7039:
7040:
7041: static int
7042: test_xmlDebugDumpAttrList(void) {
7043: int test_ret = 0;
7044:
7045: #if defined(LIBXML_DEBUG_ENABLED)
7046: int mem_base;
7047: FILE * output; /* the FILE * for the output */
7048: int n_output;
7049: xmlAttrPtr attr; /* the attribute list */
7050: int n_attr;
7051: int depth; /* the indentation level. */
7052: int n_depth;
7053:
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);
7061:
7062: xmlDebugDumpAttrList(output, attr, depth);
7063: call_tests++;
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);
7071: test_ret++;
7072: printf(" %d", n_output);
7073: printf(" %d", n_attr);
7074: printf(" %d", n_depth);
7075: printf("\n");
7076: }
7077: }
7078: }
7079: }
7080: function_tests++;
7081: #endif
7082:
7083: return(test_ret);
7084: }
7085:
7086:
7087: static int
7088: test_xmlDebugDumpDTD(void) {
7089: int test_ret = 0;
7090:
7091: #if defined(LIBXML_DEBUG_ENABLED)
7092: int mem_base;
7093: FILE * output; /* the FILE * for the output */
7094: int n_output;
7095: xmlDtdPtr dtd; /* the DTD */
7096: int n_dtd;
7097:
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);
7103:
7104: xmlDebugDumpDTD(output, dtd);
7105: call_tests++;
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);
7112: test_ret++;
7113: printf(" %d", n_output);
7114: printf(" %d", n_dtd);
7115: printf("\n");
7116: }
7117: }
7118: }
7119: function_tests++;
7120: #endif
7121:
7122: return(test_ret);
7123: }
7124:
7125:
7126: static int
7127: test_xmlDebugDumpDocument(void) {
7128: int test_ret = 0;
7129:
7130: #if defined(LIBXML_DEBUG_ENABLED)
7131: int mem_base;
7132: FILE * output; /* the FILE * for the output */
7133: int n_output;
7134: xmlDocPtr doc; /* the document */
7135: int n_doc;
7136:
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);
7142:
7143: xmlDebugDumpDocument(output, doc);
7144: call_tests++;
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);
7151: test_ret++;
7152: printf(" %d", n_output);
7153: printf(" %d", n_doc);
7154: printf("\n");
7155: }
7156: }
7157: }
7158: function_tests++;
7159: #endif
7160:
7161: return(test_ret);
7162: }
7163:
7164:
7165: static int
7166: test_xmlDebugDumpDocumentHead(void) {
7167: int test_ret = 0;
7168:
7169: #if defined(LIBXML_DEBUG_ENABLED)
7170: int mem_base;
7171: FILE * output; /* the FILE * for the output */
7172: int n_output;
7173: xmlDocPtr doc; /* the document */
7174: int n_doc;
7175:
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);
7181:
7182: xmlDebugDumpDocumentHead(output, doc);
7183: call_tests++;
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);
7190: test_ret++;
7191: printf(" %d", n_output);
7192: printf(" %d", n_doc);
7193: printf("\n");
7194: }
7195: }
7196: }
7197: function_tests++;
7198: #endif
7199:
7200: return(test_ret);
7201: }
7202:
7203:
7204: static int
7205: test_xmlDebugDumpEntities(void) {
7206: int test_ret = 0;
7207:
7208: #if defined(LIBXML_DEBUG_ENABLED)
7209: int mem_base;
7210: FILE * output; /* the FILE * for the output */
7211: int n_output;
7212: xmlDocPtr doc; /* the document */
7213: int n_doc;
7214:
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);
7220:
7221: xmlDebugDumpEntities(output, doc);
7222: call_tests++;
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);
7229: test_ret++;
7230: printf(" %d", n_output);
7231: printf(" %d", n_doc);
7232: printf("\n");
7233: }
7234: }
7235: }
7236: function_tests++;
7237: #endif
7238:
7239: return(test_ret);
7240: }
7241:
7242:
7243: static int
7244: test_xmlDebugDumpNode(void) {
7245: int test_ret = 0;
7246:
7247: #if defined(LIBXML_DEBUG_ENABLED)
7248: int mem_base;
7249: FILE * output; /* the FILE * for the output */
7250: int n_output;
7251: xmlNodePtr node; /* the node */
7252: int n_node;
7253: int depth; /* the indentation level. */
7254: int n_depth;
7255:
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);
7263:
7264: xmlDebugDumpNode(output, node, depth);
7265: call_tests++;
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);
7273: test_ret++;
7274: printf(" %d", n_output);
7275: printf(" %d", n_node);
7276: printf(" %d", n_depth);
7277: printf("\n");
7278: }
7279: }
7280: }
7281: }
7282: function_tests++;
7283: #endif
7284:
7285: return(test_ret);
7286: }
7287:
7288:
7289: static int
7290: test_xmlDebugDumpNodeList(void) {
7291: int test_ret = 0;
7292:
7293: #if defined(LIBXML_DEBUG_ENABLED)
7294: int mem_base;
7295: FILE * output; /* the FILE * for the output */
7296: int n_output;
7297: xmlNodePtr node; /* the node list */
7298: int n_node;
7299: int depth; /* the indentation level. */
7300: int n_depth;
7301:
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);
7309:
7310: xmlDebugDumpNodeList(output, node, depth);
7311: call_tests++;
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);
7319: test_ret++;
7320: printf(" %d", n_output);
7321: printf(" %d", n_node);
7322: printf(" %d", n_depth);
7323: printf("\n");
7324: }
7325: }
7326: }
7327: }
7328: function_tests++;
7329: #endif
7330:
7331: return(test_ret);
7332: }
7333:
7334:
7335: static int
7336: test_xmlDebugDumpOneNode(void) {
7337: int test_ret = 0;
7338:
7339: #if defined(LIBXML_DEBUG_ENABLED)
7340: int mem_base;
7341: FILE * output; /* the FILE * for the output */
7342: int n_output;
7343: xmlNodePtr node; /* the node */
7344: int n_node;
7345: int depth; /* the indentation level. */
7346: int n_depth;
7347:
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);
7355:
7356: xmlDebugDumpOneNode(output, node, depth);
7357: call_tests++;
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);
7365: test_ret++;
7366: printf(" %d", n_output);
7367: printf(" %d", n_node);
7368: printf(" %d", n_depth);
7369: printf("\n");
7370: }
7371: }
7372: }
7373: }
7374: function_tests++;
7375: #endif
7376:
7377: return(test_ret);
7378: }
7379:
7380:
7381: static int
7382: test_xmlDebugDumpString(void) {
7383: int test_ret = 0;
7384:
7385: #if defined(LIBXML_DEBUG_ENABLED)
7386: int mem_base;
7387: FILE * output; /* the FILE * for the output */
7388: int n_output;
7389: xmlChar * str; /* the string */
7390: int n_str;
7391:
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);
7397:
7398: xmlDebugDumpString(output, (const xmlChar *)str);
7399: call_tests++;
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);
7406: test_ret++;
7407: printf(" %d", n_output);
7408: printf(" %d", n_str);
7409: printf("\n");
7410: }
7411: }
7412: }
7413: function_tests++;
7414: #endif
7415:
7416: return(test_ret);
7417: }
7418:
7419:
7420: static int
7421: test_xmlLsCountNode(void) {
7422: int test_ret = 0;
7423:
7424: #if defined(LIBXML_DEBUG_ENABLED)
7425: int mem_base;
7426: int ret_val;
7427: xmlNodePtr node; /* the node to count */
7428: int n_node;
7429:
7430: for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7431: mem_base = xmlMemBlocks();
7432: node = gen_xmlNodePtr(n_node, 0);
7433:
7434: ret_val = xmlLsCountNode(node);
7435: desret_int(ret_val);
7436: call_tests++;
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);
7442: test_ret++;
7443: printf(" %d", n_node);
7444: printf("\n");
7445: }
7446: }
7447: function_tests++;
7448: #endif
7449:
7450: return(test_ret);
7451: }
7452:
7453:
7454: static int
7455: test_xmlLsOneNode(void) {
7456: int test_ret = 0;
7457:
7458: #if defined(LIBXML_DEBUG_ENABLED)
7459: int mem_base;
7460: FILE * output; /* the FILE * for the output */
7461: int n_output;
7462: xmlNodePtr node; /* the node to dump */
7463: int n_node;
7464:
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);
7470:
7471: xmlLsOneNode(output, node);
7472: call_tests++;
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);
7479: test_ret++;
7480: printf(" %d", n_output);
7481: printf(" %d", n_node);
7482: printf("\n");
7483: }
7484: }
7485: }
7486: function_tests++;
7487: #endif
7488:
7489: return(test_ret);
7490: }
7491:
7492:
7493: #define gen_nb_char_ptr 1
7494: static char * gen_char_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
7495: return(NULL);
7496: }
7497: static void des_char_ptr(int no ATTRIBUTE_UNUSED, char * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
7498: }
7499:
7500: static int
7501: test_xmlShell(void) {
7502: int test_ret = 0;
7503:
7504:
7505: /* missing type support */
7506: return(test_ret);
7507: }
7508:
7509:
7510: static int
7511: test_xmlShellBase(void) {
7512: int test_ret = 0;
7513:
7514: #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7515: int mem_base;
7516: int ret_val;
7517: xmlShellCtxtPtr ctxt; /* the shell context */
7518: int n_ctxt;
7519: char * arg; /* unused */
7520: int n_arg;
7521: xmlNodePtr node; /* a node */
7522: int n_node;
7523: xmlNodePtr node2; /* unused */
7524: int n_node2;
7525:
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);
7535:
7536: ret_val = xmlShellBase(ctxt, arg, node, node2);
7537: desret_int(ret_val);
7538: call_tests++;
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);
7547: test_ret++;
7548: printf(" %d", n_ctxt);
7549: printf(" %d", n_arg);
7550: printf(" %d", n_node);
7551: printf(" %d", n_node2);
7552: printf("\n");
7553: }
7554: }
7555: }
7556: }
7557: }
7558: function_tests++;
7559: #endif
7560:
7561: return(test_ret);
7562: }
7563:
7564:
7565: static int
7566: test_xmlShellCat(void) {
7567: int test_ret = 0;
7568:
7569: #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
7570: int mem_base;
7571: int ret_val;
7572: xmlShellCtxtPtr ctxt; /* the shell context */
7573: int n_ctxt;
7574: char * arg; /* unused */
7575: int n_arg;
7576: xmlNodePtr node; /* a node */
7577: int n_node;
7578: xmlNodePtr node2; /* unused */
7579: int n_node2;
7580:
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);
7590:
7591: ret_val = xmlShellCat(ctxt, arg, node, node2);
7592: desret_int(ret_val);
7593: call_tests++;
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);
7602: test_ret++;
7603: printf(" %d", n_ctxt);
7604: printf(" %d", n_arg);
7605: printf(" %d", n_node);
7606: printf(" %d", n_node2);
7607: printf("\n");
7608: }
7609: }
7610: }
7611: }
7612: }
7613: function_tests++;
7614: #endif
7615:
7616: return(test_ret);
7617: }
7618:
7619:
7620: static int
7621: test_xmlShellDir(void) {
7622: int test_ret = 0;
7623:
7624: #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7625: int mem_base;
7626: int ret_val;
7627: xmlShellCtxtPtr ctxt; /* the shell context */
7628: int n_ctxt;
7629: char * arg; /* unused */
7630: int n_arg;
7631: xmlNodePtr node; /* a node */
7632: int n_node;
7633: xmlNodePtr node2; /* unused */
7634: int n_node2;
7635:
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);
7645:
7646: ret_val = xmlShellDir(ctxt, arg, node, node2);
7647: desret_int(ret_val);
7648: call_tests++;
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);
7657: test_ret++;
7658: printf(" %d", n_ctxt);
7659: printf(" %d", n_arg);
7660: printf(" %d", n_node);
7661: printf(" %d", n_node2);
7662: printf("\n");
7663: }
7664: }
7665: }
7666: }
7667: }
7668: function_tests++;
7669: #endif
7670:
7671: return(test_ret);
7672: }
7673:
7674:
7675: static int
7676: test_xmlShellDu(void) {
7677: int test_ret = 0;
7678:
7679: #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7680: int mem_base;
7681: int ret_val;
7682: xmlShellCtxtPtr ctxt; /* the shell context */
7683: int n_ctxt;
7684: char * arg; /* unused */
7685: int n_arg;
7686: xmlNodePtr tree; /* a node defining a subtree */
7687: int n_tree;
7688: xmlNodePtr node2; /* unused */
7689: int n_node2;
7690:
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);
7700:
7701: ret_val = xmlShellDu(ctxt, arg, tree, node2);
7702: desret_int(ret_val);
7703: call_tests++;
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);
7712: test_ret++;
7713: printf(" %d", n_ctxt);
7714: printf(" %d", n_arg);
7715: printf(" %d", n_tree);
7716: printf(" %d", n_node2);
7717: printf("\n");
7718: }
7719: }
7720: }
7721: }
7722: }
7723: function_tests++;
7724: #endif
7725:
7726: return(test_ret);
7727: }
7728:
7729:
7730: static int
7731: test_xmlShellList(void) {
7732: int test_ret = 0;
7733:
7734: #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7735: int mem_base;
7736: int ret_val;
7737: xmlShellCtxtPtr ctxt; /* the shell context */
7738: int n_ctxt;
7739: char * arg; /* unused */
7740: int n_arg;
7741: xmlNodePtr node; /* a node */
7742: int n_node;
7743: xmlNodePtr node2; /* unused */
7744: int n_node2;
7745:
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);
7755:
7756: ret_val = xmlShellList(ctxt, arg, node, node2);
7757: desret_int(ret_val);
7758: call_tests++;
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);
7767: test_ret++;
7768: printf(" %d", n_ctxt);
7769: printf(" %d", n_arg);
7770: printf(" %d", n_node);
7771: printf(" %d", n_node2);
7772: printf("\n");
7773: }
7774: }
7775: }
7776: }
7777: }
7778: function_tests++;
7779: #endif
7780:
7781: return(test_ret);
7782: }
7783:
7784:
7785: static int
7786: test_xmlShellLoad(void) {
7787: int test_ret = 0;
7788:
7789: #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7790: int mem_base;
7791: int ret_val;
7792: xmlShellCtxtPtr ctxt; /* the shell context */
7793: int n_ctxt;
7794: char * filename; /* the file name */
7795: int n_filename;
7796: xmlNodePtr node; /* unused */
7797: int n_node;
7798: xmlNodePtr node2; /* unused */
7799: int n_node2;
7800:
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);
7810:
7811: ret_val = xmlShellLoad(ctxt, filename, node, node2);
7812: desret_int(ret_val);
7813: call_tests++;
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);
7822: test_ret++;
7823: printf(" %d", n_ctxt);
7824: printf(" %d", n_filename);
7825: printf(" %d", n_node);
7826: printf(" %d", n_node2);
7827: printf("\n");
7828: }
7829: }
7830: }
7831: }
7832: }
7833: function_tests++;
7834: #endif
7835:
7836: return(test_ret);
7837: }
7838:
7839:
7840: static int
7841: test_xmlShellPrintXPathResult(void) {
7842: int test_ret = 0;
7843:
7844: #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7845: int mem_base;
7846: xmlXPathObjectPtr list; /* a valid result generated by an xpath evaluation */
7847: int n_list;
7848:
7849: for (n_list = 0;n_list < gen_nb_xmlXPathObjectPtr;n_list++) {
7850: mem_base = xmlMemBlocks();
7851: list = gen_xmlXPathObjectPtr(n_list, 0);
7852:
7853: xmlShellPrintXPathResult(list);
7854: call_tests++;
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);
7860: test_ret++;
7861: printf(" %d", n_list);
7862: printf("\n");
7863: }
7864: }
7865: function_tests++;
7866: #endif
7867:
7868: return(test_ret);
7869: }
7870:
7871:
7872: static int
7873: test_xmlShellPwd(void) {
7874: int test_ret = 0;
7875:
7876: #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7877: int mem_base;
7878: int ret_val;
7879: xmlShellCtxtPtr ctxt; /* the shell context */
7880: int n_ctxt;
7881: char * buffer; /* the output buffer */
7882: int n_buffer;
7883: xmlNodePtr node; /* a node */
7884: int n_node;
7885: xmlNodePtr node2; /* unused */
7886: int n_node2;
7887:
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);
7897:
7898: ret_val = xmlShellPwd(ctxt, buffer, node, node2);
7899: desret_int(ret_val);
7900: call_tests++;
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);
7909: test_ret++;
7910: printf(" %d", n_ctxt);
7911: printf(" %d", n_buffer);
7912: printf(" %d", n_node);
7913: printf(" %d", n_node2);
7914: printf("\n");
7915: }
7916: }
7917: }
7918: }
7919: }
7920: function_tests++;
7921: #endif
7922:
7923: return(test_ret);
7924: }
7925:
7926:
7927: static int
7928: test_xmlShellSave(void) {
7929: int test_ret = 0;
7930:
7931: #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
7932: int mem_base;
7933: int ret_val;
7934: xmlShellCtxtPtr ctxt; /* the shell context */
7935: int n_ctxt;
7936: char * filename; /* the file name (optional) */
7937: int n_filename;
7938: xmlNodePtr node; /* unused */
7939: int n_node;
7940: xmlNodePtr node2; /* unused */
7941: int n_node2;
7942:
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);
7952:
7953: ret_val = xmlShellSave(ctxt, filename, node, node2);
7954: desret_int(ret_val);
7955: call_tests++;
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);
7964: test_ret++;
7965: printf(" %d", n_ctxt);
7966: printf(" %d", n_filename);
7967: printf(" %d", n_node);
7968: printf(" %d", n_node2);
7969: printf("\n");
7970: }
7971: }
7972: }
7973: }
7974: }
7975: function_tests++;
7976: #endif
7977:
7978: return(test_ret);
7979: }
7980:
7981:
7982: static int
7983: test_xmlShellValidate(void) {
7984: int test_ret = 0;
7985:
7986: #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_VALID_ENABLED)
7987: int mem_base;
7988: int ret_val;
7989: xmlShellCtxtPtr ctxt; /* the shell context */
7990: int n_ctxt;
7991: char * dtd; /* the DTD URI (optional) */
7992: int n_dtd;
7993: xmlNodePtr node; /* unused */
7994: int n_node;
7995: xmlNodePtr node2; /* unused */
7996: int n_node2;
7997:
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);
8007:
8008: ret_val = xmlShellValidate(ctxt, dtd, node, node2);
8009: desret_int(ret_val);
8010: call_tests++;
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);
8019: test_ret++;
8020: printf(" %d", n_ctxt);
8021: printf(" %d", n_dtd);
8022: printf(" %d", n_node);
8023: printf(" %d", n_node2);
8024: printf("\n");
8025: }
8026: }
8027: }
8028: }
8029: }
8030: function_tests++;
8031: #endif
8032:
8033: return(test_ret);
8034: }
8035:
8036:
8037: static int
8038: test_xmlShellWrite(void) {
8039: int test_ret = 0;
8040:
8041: #if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
8042: int mem_base;
8043: int ret_val;
8044: xmlShellCtxtPtr ctxt; /* the shell context */
8045: int n_ctxt;
8046: char * filename; /* the file name */
8047: int n_filename;
8048: xmlNodePtr node; /* a node in the tree */
8049: int n_node;
8050: xmlNodePtr node2; /* unused */
8051: int n_node2;
8052:
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);
8062:
8063: ret_val = xmlShellWrite(ctxt, filename, node, node2);
8064: desret_int(ret_val);
8065: call_tests++;
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);
8074: test_ret++;
8075: printf(" %d", n_ctxt);
8076: printf(" %d", n_filename);
8077: printf(" %d", n_node);
8078: printf(" %d", n_node2);
8079: printf("\n");
8080: }
8081: }
8082: }
8083: }
8084: }
8085: function_tests++;
8086: #endif
8087:
8088: return(test_ret);
8089: }
8090:
8091: static int
8092: test_debugXML(void) {
8093: int test_ret = 0;
8094:
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();
8122:
8123: if (test_ret != 0)
8124: printf("Module debugXML: %d errors\n", test_ret);
8125: return(test_ret);
8126: }
8127:
8128: static int
8129: test_xmlDictCleanup(void) {
8130: int test_ret = 0;
8131:
8132: int mem_base;
8133:
8134: mem_base = xmlMemBlocks();
8135:
8136: xmlDictCleanup();
8137: call_tests++;
8138: xmlResetLastError();
8139: if (mem_base != xmlMemBlocks()) {
8140: printf("Leak of %d blocks found in xmlDictCleanup",
8141: xmlMemBlocks() - mem_base);
8142: test_ret++;
8143: printf("\n");
8144: }
8145: function_tests++;
8146:
8147: return(test_ret);
8148: }
8149:
8150:
8151: static int
8152: test_xmlDictCreate(void) {
8153: int test_ret = 0;
8154:
8155: int mem_base;
8156: xmlDictPtr ret_val;
8157:
8158: mem_base = xmlMemBlocks();
8159:
8160: ret_val = xmlDictCreate();
8161: desret_xmlDictPtr(ret_val);
8162: call_tests++;
8163: xmlResetLastError();
8164: if (mem_base != xmlMemBlocks()) {
8165: printf("Leak of %d blocks found in xmlDictCreate",
8166: xmlMemBlocks() - mem_base);
8167: test_ret++;
8168: printf("\n");
8169: }
8170: function_tests++;
8171:
8172: return(test_ret);
8173: }
8174:
8175:
8176: static int
8177: test_xmlDictCreateSub(void) {
8178: int test_ret = 0;
8179:
8180: int mem_base;
8181: xmlDictPtr ret_val;
8182: xmlDictPtr sub; /* an existing dictionnary */
8183: int n_sub;
8184:
8185: for (n_sub = 0;n_sub < gen_nb_xmlDictPtr;n_sub++) {
8186: mem_base = xmlMemBlocks();
8187: sub = gen_xmlDictPtr(n_sub, 0);
8188:
8189: ret_val = xmlDictCreateSub(sub);
8190: desret_xmlDictPtr(ret_val);
8191: call_tests++;
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);
8197: test_ret++;
8198: printf(" %d", n_sub);
8199: printf("\n");
8200: }
8201: }
8202: function_tests++;
8203:
8204: return(test_ret);
8205: }
8206:
8207:
8208: static int
8209: test_xmlDictExists(void) {
8210: int test_ret = 0;
8211:
8212: int mem_base;
8213: const xmlChar * ret_val;
8214: xmlDictPtr dict; /* the dictionnary */
8215: int n_dict;
8216: xmlChar * name; /* the name of the userdata */
8217: int n_name;
8218: int len; /* the length of the name, if -1 it is recomputed */
8219: int n_len;
8220:
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);
8228:
8229: ret_val = xmlDictExists(dict, (const xmlChar *)name, len);
8230: desret_const_xmlChar_ptr(ret_val);
8231: call_tests++;
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);
8239: test_ret++;
8240: printf(" %d", n_dict);
8241: printf(" %d", n_name);
8242: printf(" %d", n_len);
8243: printf("\n");
8244: }
8245: }
8246: }
8247: }
8248: function_tests++;
8249:
8250: return(test_ret);
8251: }
8252:
8253:
8254: static int
8255: test_xmlDictLookup(void) {
8256: int test_ret = 0;
8257:
8258: int mem_base;
8259: const xmlChar * ret_val;
8260: xmlDictPtr dict; /* the dictionnary */
8261: int n_dict;
8262: xmlChar * name; /* the name of the userdata */
8263: int n_name;
8264: int len; /* the length of the name, if -1 it is recomputed */
8265: int n_len;
8266:
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);
8274:
8275: ret_val = xmlDictLookup(dict, (const xmlChar *)name, len);
8276: desret_const_xmlChar_ptr(ret_val);
8277: call_tests++;
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);
8285: test_ret++;
8286: printf(" %d", n_dict);
8287: printf(" %d", n_name);
8288: printf(" %d", n_len);
8289: printf("\n");
8290: }
8291: }
8292: }
8293: }
8294: function_tests++;
8295:
8296: return(test_ret);
8297: }
8298:
8299:
8300: static int
8301: test_xmlDictOwns(void) {
8302: int test_ret = 0;
8303:
8304: int mem_base;
8305: int ret_val;
8306: xmlDictPtr dict; /* the dictionnary */
8307: int n_dict;
8308: xmlChar * str; /* the string */
8309: int n_str;
8310:
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);
8316:
8317: ret_val = xmlDictOwns(dict, (const xmlChar *)str);
8318: desret_int(ret_val);
8319: call_tests++;
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);
8326: test_ret++;
8327: printf(" %d", n_dict);
8328: printf(" %d", n_str);
8329: printf("\n");
8330: }
8331: }
8332: }
8333: function_tests++;
8334:
8335: return(test_ret);
8336: }
8337:
8338:
8339: static int
8340: test_xmlDictQLookup(void) {
8341: int test_ret = 0;
8342:
8343: int mem_base;
8344: const xmlChar * ret_val;
8345: xmlDictPtr dict; /* the dictionnary */
8346: int n_dict;
8347: xmlChar * prefix; /* the prefix */
8348: int n_prefix;
8349: xmlChar * name; /* the name */
8350: int n_name;
8351:
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);
8359:
8360: ret_val = xmlDictQLookup(dict, (const xmlChar *)prefix, (const xmlChar *)name);
8361: desret_const_xmlChar_ptr(ret_val);
8362: call_tests++;
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);
8370: test_ret++;
8371: printf(" %d", n_dict);
8372: printf(" %d", n_prefix);
8373: printf(" %d", n_name);
8374: printf("\n");
8375: }
8376: }
8377: }
8378: }
8379: function_tests++;
8380:
8381: return(test_ret);
8382: }
8383:
8384:
8385: static int
8386: test_xmlDictReference(void) {
8387: int test_ret = 0;
8388:
8389: int mem_base;
8390: int ret_val;
8391: xmlDictPtr dict; /* the dictionnary */
8392: int n_dict;
8393:
8394: for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8395: mem_base = xmlMemBlocks();
8396: dict = gen_xmlDictPtr(n_dict, 0);
8397:
8398: ret_val = xmlDictReference(dict);
8399: xmlDictFree(dict);
8400: desret_int(ret_val);
8401: call_tests++;
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);
8407: test_ret++;
8408: printf(" %d", n_dict);
8409: printf("\n");
8410: }
8411: }
8412: function_tests++;
8413:
8414: return(test_ret);
8415: }
8416:
8417:
8418: static int
8419: test_xmlDictSize(void) {
8420: int test_ret = 0;
8421:
8422: int mem_base;
8423: int ret_val;
8424: xmlDictPtr dict; /* the dictionnary */
8425: int n_dict;
8426:
8427: for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8428: mem_base = xmlMemBlocks();
8429: dict = gen_xmlDictPtr(n_dict, 0);
8430:
8431: ret_val = xmlDictSize(dict);
8432: desret_int(ret_val);
8433: call_tests++;
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);
8439: test_ret++;
8440: printf(" %d", n_dict);
8441: printf("\n");
8442: }
8443: }
8444: function_tests++;
8445:
8446: return(test_ret);
8447: }
8448:
8449: static int
8450: test_dict(void) {
8451: int test_ret = 0;
8452:
8453: if (quiet == 0) printf("Testing dict : 9 of 10 functions ...\n");
8454: test_ret += test_xmlDictCleanup();
8455: test_ret += test_xmlDictCreate();
8456: test_ret += test_xmlDictCreateSub();
8457: test_ret += test_xmlDictExists();
8458: test_ret += test_xmlDictLookup();
8459: test_ret += test_xmlDictOwns();
8460: test_ret += test_xmlDictQLookup();
8461: test_ret += test_xmlDictReference();
8462: test_ret += test_xmlDictSize();
8463:
8464: if (test_ret != 0)
8465: printf("Module dict: %d errors\n", test_ret);
8466: return(test_ret);
8467: }
8468:
8469: static int
8470: test_UTF8Toisolat1(void) {
8471: int test_ret = 0;
8472:
8473: #if defined(LIBXML_OUTPUT_ENABLED)
8474: #ifdef LIBXML_OUTPUT_ENABLED
8475: int mem_base;
8476: int ret_val;
8477: unsigned char * out; /* a pointer to an array of bytes to store the result */
8478: int n_out;
8479: int * outlen; /* the length of @out */
8480: int n_outlen;
8481: unsigned char * in; /* a pointer to an array of UTF-8 chars */
8482: int n_in;
8483: int * inlen; /* the length of @in */
8484: int n_inlen;
8485:
8486: for (n_out = 0;n_out < gen_nb_unsigned_char_ptr;n_out++) {
8487: for (n_outlen = 0;n_outlen < gen_nb_int_ptr;n_outlen++) {
8488: for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) {
8489: for (n_inlen = 0;n_inlen < gen_nb_int_ptr;n_inlen++) {
8490: mem_base = xmlMemBlocks();
8491: out = gen_unsigned_char_ptr(n_out, 0);
8492: outlen = gen_int_ptr(n_outlen, 1);
8493: in = gen_const_unsigned_char_ptr(n_in, 2);
8494: inlen = gen_int_ptr(n_inlen, 3);
8495:
8496: ret_val = UTF8Toisolat1(out, outlen, (const unsigned char *)in, inlen);
8497: desret_int(ret_val);
8498: call_tests++;
8499: des_unsigned_char_ptr(n_out, out, 0);
8500: des_int_ptr(n_outlen, outlen, 1);
8501: des_const_unsigned_char_ptr(n_in, (const unsigned char *)in, 2);
8502: des_int_ptr(n_inlen, inlen, 3);
8503: xmlResetLastError();
8504: if (mem_base != xmlMemBlocks()) {
8505: printf("Leak of %d blocks found in UTF8Toisolat1",
8506: xmlMemBlocks() - mem_base);
8507: test_ret++;
8508: printf(" %d", n_out);
8509: printf(" %d", n_outlen);
8510: printf(" %d", n_in);
8511: printf(" %d", n_inlen);
8512: printf("\n");
8513: }
8514: }
8515: }
8516: }
8517: }
8518: function_tests++;
8519: #endif
8520: #endif
8521:
8522: return(test_ret);
8523: }
8524:
8525:
8526: static int
8527: test_isolat1ToUTF8(void) {
8528: int test_ret = 0;
8529:
8530: int mem_base;
8531: int ret_val;
8532: unsigned char * out; /* a pointer to an array of bytes to store the result */
8533: int n_out;
8534: int * outlen; /* the length of @out */
8535: int n_outlen;
8536: unsigned char * in; /* a pointer to an array of ISO Latin 1 chars */
8537: int n_in;
8538: int * inlen; /* the length of @in */
8539: int n_inlen;
8540:
8541: for (n_out = 0;n_out < gen_nb_unsigned_char_ptr;n_out++) {
8542: for (n_outlen = 0;n_outlen < gen_nb_int_ptr;n_outlen++) {
8543: for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) {
8544: for (n_inlen = 0;n_inlen < gen_nb_int_ptr;n_inlen++) {
8545: mem_base = xmlMemBlocks();
8546: out = gen_unsigned_char_ptr(n_out, 0);
8547: outlen = gen_int_ptr(n_outlen, 1);
8548: in = gen_const_unsigned_char_ptr(n_in, 2);
8549: inlen = gen_int_ptr(n_inlen, 3);
8550:
8551: ret_val = isolat1ToUTF8(out, outlen, (const unsigned char *)in, inlen);
8552: desret_int(ret_val);
8553: call_tests++;
8554: des_unsigned_char_ptr(n_out, out, 0);
8555: des_int_ptr(n_outlen, outlen, 1);
8556: des_const_unsigned_char_ptr(n_in, (const unsigned char *)in, 2);
8557: des_int_ptr(n_inlen, inlen, 3);
8558: xmlResetLastError();
8559: if (mem_base != xmlMemBlocks()) {
8560: printf("Leak of %d blocks found in isolat1ToUTF8",
8561: xmlMemBlocks() - mem_base);
8562: test_ret++;
8563: printf(" %d", n_out);
8564: printf(" %d", n_outlen);
8565: printf(" %d", n_in);
8566: printf(" %d", n_inlen);
8567: printf("\n");
8568: }
8569: }
8570: }
8571: }
8572: }
8573: function_tests++;
8574:
8575: return(test_ret);
8576: }
8577:
8578:
8579: static int
8580: test_xmlAddEncodingAlias(void) {
8581: int test_ret = 0;
8582:
8583: int ret_val;
8584: char * name; /* the encoding name as parsed, in UTF-8 format (ASCII actually) */
8585: int n_name;
8586: char * alias; /* the alias name as parsed, in UTF-8 format (ASCII actually) */
8587: int n_alias;
8588:
8589: for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
8590: for (n_alias = 0;n_alias < gen_nb_const_char_ptr;n_alias++) {
8591: name = gen_const_char_ptr(n_name, 0);
8592: alias = gen_const_char_ptr(n_alias, 1);
8593:
8594: ret_val = xmlAddEncodingAlias((const char *)name, (const char *)alias);
8595: desret_int(ret_val);
8596: call_tests++;
8597: des_const_char_ptr(n_name, (const char *)name, 0);
8598: des_const_char_ptr(n_alias, (const char *)alias, 1);
8599: xmlResetLastError();
8600: }
8601: }
8602: function_tests++;
8603:
8604: return(test_ret);
8605: }
8606:
8607:
8608: #define gen_nb_xmlCharEncodingHandler_ptr 1
8609: static xmlCharEncodingHandler * gen_xmlCharEncodingHandler_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
8610: return(NULL);
8611: }
8612: static void des_xmlCharEncodingHandler_ptr(int no ATTRIBUTE_UNUSED, xmlCharEncodingHandler * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
8613: }
8614:
8615: static int
8616: test_xmlCharEncCloseFunc(void) {
8617: int test_ret = 0;
8618:
8619: int mem_base;
8620: int ret_val;
8621: xmlCharEncodingHandler * handler; /* char enconding transformation data structure */
8622: int n_handler;
8623:
8624: for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandler_ptr;n_handler++) {
8625: mem_base = xmlMemBlocks();
8626: handler = gen_xmlCharEncodingHandler_ptr(n_handler, 0);
8627:
8628: ret_val = xmlCharEncCloseFunc(handler);
8629: desret_int(ret_val);
8630: call_tests++;
8631: des_xmlCharEncodingHandler_ptr(n_handler, handler, 0);
8632: xmlResetLastError();
8633: if (mem_base != xmlMemBlocks()) {
8634: printf("Leak of %d blocks found in xmlCharEncCloseFunc",
8635: xmlMemBlocks() - mem_base);
8636: test_ret++;
8637: printf(" %d", n_handler);
8638: printf("\n");
8639: }
8640: }
8641: function_tests++;
8642:
8643: return(test_ret);
8644: }
8645:
8646:
8647: static int
8648: test_xmlCharEncFirstLine(void) {
8649: int test_ret = 0;
8650:
8651: int mem_base;
8652: int ret_val;
8653: xmlCharEncodingHandler * handler; /* char enconding transformation data structure */
8654: int n_handler;
8655: xmlBufferPtr out; /* an xmlBuffer for the output. */
8656: int n_out;
8657: xmlBufferPtr in; /* an xmlBuffer for the input */
8658: int n_in;
8659:
8660: for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandler_ptr;n_handler++) {
8661: for (n_out = 0;n_out < gen_nb_xmlBufferPtr;n_out++) {
8662: for (n_in = 0;n_in < gen_nb_xmlBufferPtr;n_in++) {
8663: mem_base = xmlMemBlocks();
8664: handler = gen_xmlCharEncodingHandler_ptr(n_handler, 0);
8665: out = gen_xmlBufferPtr(n_out, 1);
8666: in = gen_xmlBufferPtr(n_in, 2);
8667:
8668: ret_val = xmlCharEncFirstLine(handler, out, in);
8669: desret_int(ret_val);
8670: call_tests++;
8671: des_xmlCharEncodingHandler_ptr(n_handler, handler, 0);
8672: des_xmlBufferPtr(n_out, out, 1);
8673: des_xmlBufferPtr(n_in, in, 2);
8674: xmlResetLastError();
8675: if (mem_base != xmlMemBlocks()) {
8676: printf("Leak of %d blocks found in xmlCharEncFirstLine",
8677: xmlMemBlocks() - mem_base);
8678: test_ret++;
8679: printf(" %d", n_handler);
8680: printf(" %d", n_out);
8681: printf(" %d", n_in);
8682: printf("\n");
8683: }
8684: }
8685: }
8686: }
8687: function_tests++;
8688:
8689: return(test_ret);
8690: }
8691:
8692:
8693: static int
8694: test_xmlCharEncInFunc(void) {
8695: int test_ret = 0;
8696:
8697: int mem_base;
8698: int ret_val;
8699: xmlCharEncodingHandler * handler; /* char encoding transformation data structure */
8700: int n_handler;
8701: xmlBufferPtr out; /* an xmlBuffer for the output. */
8702: int n_out;
8703: xmlBufferPtr in; /* an xmlBuffer for the input */
8704: int n_in;
8705:
8706: for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandler_ptr;n_handler++) {
8707: for (n_out = 0;n_out < gen_nb_xmlBufferPtr;n_out++) {
8708: for (n_in = 0;n_in < gen_nb_xmlBufferPtr;n_in++) {
8709: mem_base = xmlMemBlocks();
8710: handler = gen_xmlCharEncodingHandler_ptr(n_handler, 0);
8711: out = gen_xmlBufferPtr(n_out, 1);
8712: in = gen_xmlBufferPtr(n_in, 2);
8713:
8714: ret_val = xmlCharEncInFunc(handler, out, in);
8715: desret_int(ret_val);
8716: call_tests++;
8717: des_xmlCharEncodingHandler_ptr(n_handler, handler, 0);
8718: des_xmlBufferPtr(n_out, out, 1);
8719: des_xmlBufferPtr(n_in, in, 2);
8720: xmlResetLastError();
8721: if (mem_base != xmlMemBlocks()) {
8722: printf("Leak of %d blocks found in xmlCharEncInFunc",
8723: xmlMemBlocks() - mem_base);
8724: test_ret++;
8725: printf(" %d", n_handler);
8726: printf(" %d", n_out);
8727: printf(" %d", n_in);
8728: printf("\n");
8729: }
8730: }
8731: }
8732: }
8733: function_tests++;
8734:
8735: return(test_ret);
8736: }
8737:
8738:
8739: static int
8740: test_xmlCharEncOutFunc(void) {
8741: int test_ret = 0;
8742:
8743: int mem_base;
8744: int ret_val;
8745: xmlCharEncodingHandler * handler; /* char enconding transformation data structure */
8746: int n_handler;
8747: xmlBufferPtr out; /* an xmlBuffer for the output. */
8748: int n_out;
8749: xmlBufferPtr in; /* an xmlBuffer for the input */
8750: int n_in;
8751:
8752: for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandler_ptr;n_handler++) {
8753: for (n_out = 0;n_out < gen_nb_xmlBufferPtr;n_out++) {
8754: for (n_in = 0;n_in < gen_nb_xmlBufferPtr;n_in++) {
8755: mem_base = xmlMemBlocks();
8756: handler = gen_xmlCharEncodingHandler_ptr(n_handler, 0);
8757: out = gen_xmlBufferPtr(n_out, 1);
8758: in = gen_xmlBufferPtr(n_in, 2);
8759:
8760: ret_val = xmlCharEncOutFunc(handler, out, in);
8761: desret_int(ret_val);
8762: call_tests++;
8763: des_xmlCharEncodingHandler_ptr(n_handler, handler, 0);
8764: des_xmlBufferPtr(n_out, out, 1);
8765: des_xmlBufferPtr(n_in, in, 2);
8766: xmlResetLastError();
8767: if (mem_base != xmlMemBlocks()) {
8768: printf("Leak of %d blocks found in xmlCharEncOutFunc",
8769: xmlMemBlocks() - mem_base);
8770: test_ret++;
8771: printf(" %d", n_handler);
8772: printf(" %d", n_out);
8773: printf(" %d", n_in);
8774: printf("\n");
8775: }
8776: }
8777: }
8778: }
8779: function_tests++;
8780:
8781: return(test_ret);
8782: }
8783:
8784:
8785: static int
8786: test_xmlCleanupCharEncodingHandlers(void) {
8787: int test_ret = 0;
8788:
8789:
8790:
8791: xmlCleanupCharEncodingHandlers();
8792: call_tests++;
8793: xmlResetLastError();
8794: function_tests++;
8795:
8796: return(test_ret);
8797: }
8798:
8799:
8800: static int
8801: test_xmlCleanupEncodingAliases(void) {
8802: int test_ret = 0;
8803:
8804: int mem_base;
8805:
8806: mem_base = xmlMemBlocks();
8807:
8808: xmlCleanupEncodingAliases();
8809: call_tests++;
8810: xmlResetLastError();
8811: if (mem_base != xmlMemBlocks()) {
8812: printf("Leak of %d blocks found in xmlCleanupEncodingAliases",
8813: xmlMemBlocks() - mem_base);
8814: test_ret++;
8815: printf("\n");
8816: }
8817: function_tests++;
8818:
8819: return(test_ret);
8820: }
8821:
8822:
8823: static int
8824: test_xmlDelEncodingAlias(void) {
8825: int test_ret = 0;
8826:
8827: int mem_base;
8828: int ret_val;
8829: char * alias; /* the alias name as parsed, in UTF-8 format (ASCII actually) */
8830: int n_alias;
8831:
8832: for (n_alias = 0;n_alias < gen_nb_const_char_ptr;n_alias++) {
8833: mem_base = xmlMemBlocks();
8834: alias = gen_const_char_ptr(n_alias, 0);
8835:
8836: ret_val = xmlDelEncodingAlias((const char *)alias);
8837: desret_int(ret_val);
8838: call_tests++;
8839: des_const_char_ptr(n_alias, (const char *)alias, 0);
8840: xmlResetLastError();
8841: if (mem_base != xmlMemBlocks()) {
8842: printf("Leak of %d blocks found in xmlDelEncodingAlias",
8843: xmlMemBlocks() - mem_base);
8844: test_ret++;
8845: printf(" %d", n_alias);
8846: printf("\n");
8847: }
8848: }
8849: function_tests++;
8850:
8851: return(test_ret);
8852: }
8853:
8854:
8855: static int
8856: test_xmlDetectCharEncoding(void) {
8857: int test_ret = 0;
8858:
8859: int mem_base;
8860: xmlCharEncoding ret_val;
8861: unsigned char * in; /* a pointer to the first bytes of the XML entity, must be at least 2 bytes long (at least 4 if encoding is UTF4 variant). */
8862: int n_in;
8863: int len; /* pointer to the length of the buffer */
8864: int n_len;
8865:
8866: for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) {
8867: for (n_len = 0;n_len < gen_nb_int;n_len++) {
8868: mem_base = xmlMemBlocks();
8869: in = gen_const_unsigned_char_ptr(n_in, 0);
8870: len = gen_int(n_len, 1);
8871:
8872: ret_val = xmlDetectCharEncoding((const unsigned char *)in, len);
8873: desret_xmlCharEncoding(ret_val);
8874: call_tests++;
8875: des_const_unsigned_char_ptr(n_in, (const unsigned char *)in, 0);
8876: des_int(n_len, len, 1);
8877: xmlResetLastError();
8878: if (mem_base != xmlMemBlocks()) {
8879: printf("Leak of %d blocks found in xmlDetectCharEncoding",
8880: xmlMemBlocks() - mem_base);
8881: test_ret++;
8882: printf(" %d", n_in);
8883: printf(" %d", n_len);
8884: printf("\n");
8885: }
8886: }
8887: }
8888: function_tests++;
8889:
8890: return(test_ret);
8891: }
8892:
8893:
8894: static int
8895: test_xmlFindCharEncodingHandler(void) {
8896: int test_ret = 0;
8897:
8898:
8899: /* missing type support */
8900: return(test_ret);
8901: }
8902:
8903:
8904: static int
8905: test_xmlGetCharEncodingHandler(void) {
8906: int test_ret = 0;
8907:
8908:
8909: /* missing type support */
8910: return(test_ret);
8911: }
8912:
8913:
8914: static int
8915: test_xmlGetCharEncodingName(void) {
8916: int test_ret = 0;
8917:
8918: int mem_base;
8919: const char * ret_val;
8920: xmlCharEncoding enc; /* the encoding */
8921: int n_enc;
8922:
8923: for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
8924: mem_base = xmlMemBlocks();
8925: enc = gen_xmlCharEncoding(n_enc, 0);
8926:
8927: ret_val = xmlGetCharEncodingName(enc);
8928: desret_const_char_ptr(ret_val);
8929: call_tests++;
8930: des_xmlCharEncoding(n_enc, enc, 0);
8931: xmlResetLastError();
8932: if (mem_base != xmlMemBlocks()) {
8933: printf("Leak of %d blocks found in xmlGetCharEncodingName",
8934: xmlMemBlocks() - mem_base);
8935: test_ret++;
8936: printf(" %d", n_enc);
8937: printf("\n");
8938: }
8939: }
8940: function_tests++;
8941:
8942: return(test_ret);
8943: }
8944:
8945:
8946: static int
8947: test_xmlGetEncodingAlias(void) {
8948: int test_ret = 0;
8949:
8950: int mem_base;
8951: const char * ret_val;
8952: char * alias; /* the alias name as parsed, in UTF-8 format (ASCII actually) */
8953: int n_alias;
8954:
8955: for (n_alias = 0;n_alias < gen_nb_const_char_ptr;n_alias++) {
8956: mem_base = xmlMemBlocks();
8957: alias = gen_const_char_ptr(n_alias, 0);
8958:
8959: ret_val = xmlGetEncodingAlias((const char *)alias);
8960: desret_const_char_ptr(ret_val);
8961: call_tests++;
8962: des_const_char_ptr(n_alias, (const char *)alias, 0);
8963: xmlResetLastError();
8964: if (mem_base != xmlMemBlocks()) {
8965: printf("Leak of %d blocks found in xmlGetEncodingAlias",
8966: xmlMemBlocks() - mem_base);
8967: test_ret++;
8968: printf(" %d", n_alias);
8969: printf("\n");
8970: }
8971: }
8972: function_tests++;
8973:
8974: return(test_ret);
8975: }
8976:
8977:
8978: static int
8979: test_xmlInitCharEncodingHandlers(void) {
8980: int test_ret = 0;
8981:
8982:
8983:
8984: xmlInitCharEncodingHandlers();
8985: call_tests++;
8986: xmlResetLastError();
8987: function_tests++;
8988:
8989: return(test_ret);
8990: }
8991:
8992:
8993: static int
8994: test_xmlNewCharEncodingHandler(void) {
8995: int test_ret = 0;
8996:
8997:
8998: /* missing type support */
8999: return(test_ret);
9000: }
9001:
9002:
9003: static int
9004: test_xmlParseCharEncoding(void) {
9005: int test_ret = 0;
9006:
9007: int mem_base;
9008: xmlCharEncoding ret_val;
9009: char * name; /* the encoding name as parsed, in UTF-8 format (ASCII actually) */
9010: int n_name;
9011:
9012: for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
9013: mem_base = xmlMemBlocks();
9014: name = gen_const_char_ptr(n_name, 0);
9015:
9016: ret_val = xmlParseCharEncoding((const char *)name);
9017: desret_xmlCharEncoding(ret_val);
9018: call_tests++;
9019: des_const_char_ptr(n_name, (const char *)name, 0);
9020: xmlResetLastError();
9021: if (mem_base != xmlMemBlocks()) {
9022: printf("Leak of %d blocks found in xmlParseCharEncoding",
9023: xmlMemBlocks() - mem_base);
9024: test_ret++;
9025: printf(" %d", n_name);
9026: printf("\n");
9027: }
9028: }
9029: function_tests++;
9030:
9031: return(test_ret);
9032: }
9033:
9034:
9035: #define gen_nb_xmlCharEncodingHandlerPtr 1
9036: static xmlCharEncodingHandlerPtr gen_xmlCharEncodingHandlerPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9037: return(NULL);
9038: }
9039: static void des_xmlCharEncodingHandlerPtr(int no ATTRIBUTE_UNUSED, xmlCharEncodingHandlerPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9040: }
9041:
9042: static int
9043: test_xmlRegisterCharEncodingHandler(void) {
9044: int test_ret = 0;
9045:
9046: int mem_base;
9047: xmlCharEncodingHandlerPtr handler; /* the xmlCharEncodingHandlerPtr handler block */
9048: int n_handler;
9049:
9050: for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandlerPtr;n_handler++) {
9051: mem_base = xmlMemBlocks();
9052: handler = gen_xmlCharEncodingHandlerPtr(n_handler, 0);
9053:
9054: xmlRegisterCharEncodingHandler(handler);
9055: call_tests++;
9056: des_xmlCharEncodingHandlerPtr(n_handler, handler, 0);
9057: xmlResetLastError();
9058: if (mem_base != xmlMemBlocks()) {
9059: printf("Leak of %d blocks found in xmlRegisterCharEncodingHandler",
9060: xmlMemBlocks() - mem_base);
9061: test_ret++;
9062: printf(" %d", n_handler);
9063: printf("\n");
9064: }
9065: }
9066: function_tests++;
9067:
9068: return(test_ret);
9069: }
9070:
9071: static int
9072: test_encoding(void) {
9073: int test_ret = 0;
9074:
9075: if (quiet == 0) printf("Testing encoding : 16 of 19 functions ...\n");
9076: test_ret += test_UTF8Toisolat1();
9077: test_ret += test_isolat1ToUTF8();
9078: test_ret += test_xmlAddEncodingAlias();
9079: test_ret += test_xmlCharEncCloseFunc();
9080: test_ret += test_xmlCharEncFirstLine();
9081: test_ret += test_xmlCharEncInFunc();
9082: test_ret += test_xmlCharEncOutFunc();
9083: test_ret += test_xmlCleanupCharEncodingHandlers();
9084: test_ret += test_xmlCleanupEncodingAliases();
9085: test_ret += test_xmlDelEncodingAlias();
9086: test_ret += test_xmlDetectCharEncoding();
9087: test_ret += test_xmlFindCharEncodingHandler();
9088: test_ret += test_xmlGetCharEncodingHandler();
9089: test_ret += test_xmlGetCharEncodingName();
9090: test_ret += test_xmlGetEncodingAlias();
9091: test_ret += test_xmlInitCharEncodingHandlers();
9092: test_ret += test_xmlNewCharEncodingHandler();
9093: test_ret += test_xmlParseCharEncoding();
9094: test_ret += test_xmlRegisterCharEncodingHandler();
9095:
9096: if (test_ret != 0)
9097: printf("Module encoding: %d errors\n", test_ret);
9098: return(test_ret);
9099: }
9100:
9101: static int
9102: test_xmlAddDocEntity(void) {
9103: int test_ret = 0;
9104:
9105: int mem_base;
9106: xmlEntityPtr ret_val;
9107: xmlDocPtr doc; /* the document */
9108: int n_doc;
9109: xmlChar * name; /* the entity name */
9110: int n_name;
9111: int type; /* the entity type XML_xxx_yyy_ENTITY */
9112: int n_type;
9113: xmlChar * ExternalID; /* the entity external ID if available */
9114: int n_ExternalID;
9115: xmlChar * SystemID; /* the entity system ID if available */
9116: int n_SystemID;
9117: xmlChar * content; /* the entity content */
9118: int n_content;
9119:
9120: for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9121: for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9122: for (n_type = 0;n_type < gen_nb_int;n_type++) {
9123: for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
9124: for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
9125: for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
9126: mem_base = xmlMemBlocks();
9127: doc = gen_xmlDocPtr(n_doc, 0);
9128: name = gen_const_xmlChar_ptr(n_name, 1);
9129: type = gen_int(n_type, 2);
9130: ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 3);
9131: SystemID = gen_const_xmlChar_ptr(n_SystemID, 4);
9132: content = gen_const_xmlChar_ptr(n_content, 5);
9133:
9134: ret_val = xmlAddDocEntity(doc, (const xmlChar *)name, type, (const xmlChar *)ExternalID, (const xmlChar *)SystemID, (const xmlChar *)content);
9135: desret_xmlEntityPtr(ret_val);
9136: call_tests++;
9137: des_xmlDocPtr(n_doc, doc, 0);
9138: des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9139: des_int(n_type, type, 2);
9140: des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 3);
9141: des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 4);
9142: des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 5);
9143: xmlResetLastError();
9144: if (mem_base != xmlMemBlocks()) {
9145: printf("Leak of %d blocks found in xmlAddDocEntity",
9146: xmlMemBlocks() - mem_base);
9147: test_ret++;
9148: printf(" %d", n_doc);
9149: printf(" %d", n_name);
9150: printf(" %d", n_type);
9151: printf(" %d", n_ExternalID);
9152: printf(" %d", n_SystemID);
9153: printf(" %d", n_content);
9154: printf("\n");
9155: }
9156: }
9157: }
9158: }
9159: }
9160: }
9161: }
9162: function_tests++;
9163:
9164: return(test_ret);
9165: }
9166:
9167:
9168: static int
9169: test_xmlAddDtdEntity(void) {
9170: int test_ret = 0;
9171:
9172: int mem_base;
9173: xmlEntityPtr ret_val;
9174: xmlDocPtr doc; /* the document */
9175: int n_doc;
9176: xmlChar * name; /* the entity name */
9177: int n_name;
9178: int type; /* the entity type XML_xxx_yyy_ENTITY */
9179: int n_type;
9180: xmlChar * ExternalID; /* the entity external ID if available */
9181: int n_ExternalID;
9182: xmlChar * SystemID; /* the entity system ID if available */
9183: int n_SystemID;
9184: xmlChar * content; /* the entity content */
9185: int n_content;
9186:
9187: for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9188: for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9189: for (n_type = 0;n_type < gen_nb_int;n_type++) {
9190: for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
9191: for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
9192: for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
9193: mem_base = xmlMemBlocks();
9194: doc = gen_xmlDocPtr(n_doc, 0);
9195: name = gen_const_xmlChar_ptr(n_name, 1);
9196: type = gen_int(n_type, 2);
9197: ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 3);
9198: SystemID = gen_const_xmlChar_ptr(n_SystemID, 4);
9199: content = gen_const_xmlChar_ptr(n_content, 5);
9200:
9201: ret_val = xmlAddDtdEntity(doc, (const xmlChar *)name, type, (const xmlChar *)ExternalID, (const xmlChar *)SystemID, (const xmlChar *)content);
9202: desret_xmlEntityPtr(ret_val);
9203: call_tests++;
9204: des_xmlDocPtr(n_doc, doc, 0);
9205: des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9206: des_int(n_type, type, 2);
9207: des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 3);
9208: des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 4);
9209: des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 5);
9210: xmlResetLastError();
9211: if (mem_base != xmlMemBlocks()) {
9212: printf("Leak of %d blocks found in xmlAddDtdEntity",
9213: xmlMemBlocks() - mem_base);
9214: test_ret++;
9215: printf(" %d", n_doc);
9216: printf(" %d", n_name);
9217: printf(" %d", n_type);
9218: printf(" %d", n_ExternalID);
9219: printf(" %d", n_SystemID);
9220: printf(" %d", n_content);
9221: printf("\n");
9222: }
9223: }
9224: }
9225: }
9226: }
9227: }
9228: }
9229: function_tests++;
9230:
9231: return(test_ret);
9232: }
9233:
9234:
9235: static int
9236: test_xmlCleanupPredefinedEntities(void) {
9237: int test_ret = 0;
9238:
9239: #if defined(LIBXML_LEGACY_ENABLED)
9240: #ifdef LIBXML_LEGACY_ENABLED
9241: int mem_base;
9242:
9243: mem_base = xmlMemBlocks();
9244:
9245: xmlCleanupPredefinedEntities();
9246: call_tests++;
9247: xmlResetLastError();
9248: if (mem_base != xmlMemBlocks()) {
9249: printf("Leak of %d blocks found in xmlCleanupPredefinedEntities",
9250: xmlMemBlocks() - mem_base);
9251: test_ret++;
9252: printf("\n");
9253: }
9254: function_tests++;
9255: #endif
9256: #endif
9257:
9258: return(test_ret);
9259: }
9260:
9261:
9262: #define gen_nb_xmlEntitiesTablePtr 1
9263: static xmlEntitiesTablePtr gen_xmlEntitiesTablePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9264: return(NULL);
9265: }
9266: static void des_xmlEntitiesTablePtr(int no ATTRIBUTE_UNUSED, xmlEntitiesTablePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9267: }
9268:
9269: static int
9270: test_xmlCopyEntitiesTable(void) {
9271: int test_ret = 0;
9272:
9273:
9274: /* missing type support */
9275: return(test_ret);
9276: }
9277:
9278:
9279: static int
9280: test_xmlCreateEntitiesTable(void) {
9281: int test_ret = 0;
9282:
9283:
9284: /* missing type support */
9285: return(test_ret);
9286: }
9287:
9288:
9289: static int
9290: test_xmlDumpEntitiesTable(void) {
9291: int test_ret = 0;
9292:
9293: #if defined(LIBXML_OUTPUT_ENABLED)
9294: int mem_base;
9295: xmlBufferPtr buf; /* An XML buffer. */
9296: int n_buf;
9297: xmlEntitiesTablePtr table; /* An entity table */
9298: int n_table;
9299:
9300: for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
9301: for (n_table = 0;n_table < gen_nb_xmlEntitiesTablePtr;n_table++) {
9302: mem_base = xmlMemBlocks();
9303: buf = gen_xmlBufferPtr(n_buf, 0);
9304: table = gen_xmlEntitiesTablePtr(n_table, 1);
9305:
9306: xmlDumpEntitiesTable(buf, table);
9307: call_tests++;
9308: des_xmlBufferPtr(n_buf, buf, 0);
9309: des_xmlEntitiesTablePtr(n_table, table, 1);
9310: xmlResetLastError();
9311: if (mem_base != xmlMemBlocks()) {
9312: printf("Leak of %d blocks found in xmlDumpEntitiesTable",
9313: xmlMemBlocks() - mem_base);
9314: test_ret++;
9315: printf(" %d", n_buf);
9316: printf(" %d", n_table);
9317: printf("\n");
9318: }
9319: }
9320: }
9321: function_tests++;
9322: #endif
9323:
9324: return(test_ret);
9325: }
9326:
9327:
9328: #define gen_nb_xmlEntityPtr 1
9329: static xmlEntityPtr gen_xmlEntityPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9330: return(NULL);
9331: }
9332: static void des_xmlEntityPtr(int no ATTRIBUTE_UNUSED, xmlEntityPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9333: }
9334:
9335: static int
9336: test_xmlDumpEntityDecl(void) {
9337: int test_ret = 0;
9338:
9339: #if defined(LIBXML_OUTPUT_ENABLED)
9340: int mem_base;
9341: xmlBufferPtr buf; /* An XML buffer. */
9342: int n_buf;
9343: xmlEntityPtr ent; /* An entity table */
9344: int n_ent;
9345:
9346: for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
9347: for (n_ent = 0;n_ent < gen_nb_xmlEntityPtr;n_ent++) {
9348: mem_base = xmlMemBlocks();
9349: buf = gen_xmlBufferPtr(n_buf, 0);
9350: ent = gen_xmlEntityPtr(n_ent, 1);
9351:
9352: xmlDumpEntityDecl(buf, ent);
9353: call_tests++;
9354: des_xmlBufferPtr(n_buf, buf, 0);
9355: des_xmlEntityPtr(n_ent, ent, 1);
9356: xmlResetLastError();
9357: if (mem_base != xmlMemBlocks()) {
9358: printf("Leak of %d blocks found in xmlDumpEntityDecl",
9359: xmlMemBlocks() - mem_base);
9360: test_ret++;
9361: printf(" %d", n_buf);
9362: printf(" %d", n_ent);
9363: printf("\n");
9364: }
9365: }
9366: }
9367: function_tests++;
9368: #endif
9369:
9370: return(test_ret);
9371: }
9372:
9373:
9374: static int
9375: test_xmlEncodeEntitiesReentrant(void) {
9376: int test_ret = 0;
9377:
9378: int mem_base;
9379: xmlChar * ret_val;
9380: xmlDocPtr doc; /* the document containing the string */
9381: int n_doc;
9382: xmlChar * input; /* A string to convert to XML. */
9383: int n_input;
9384:
9385: for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9386: for (n_input = 0;n_input < gen_nb_const_xmlChar_ptr;n_input++) {
9387: mem_base = xmlMemBlocks();
9388: doc = gen_xmlDocPtr(n_doc, 0);
9389: input = gen_const_xmlChar_ptr(n_input, 1);
9390:
9391: ret_val = xmlEncodeEntitiesReentrant(doc, (const xmlChar *)input);
9392: desret_xmlChar_ptr(ret_val);
9393: call_tests++;
9394: des_xmlDocPtr(n_doc, doc, 0);
9395: des_const_xmlChar_ptr(n_input, (const xmlChar *)input, 1);
9396: xmlResetLastError();
9397: if (mem_base != xmlMemBlocks()) {
9398: printf("Leak of %d blocks found in xmlEncodeEntitiesReentrant",
9399: xmlMemBlocks() - mem_base);
9400: test_ret++;
9401: printf(" %d", n_doc);
9402: printf(" %d", n_input);
9403: printf("\n");
9404: }
9405: }
9406: }
9407: function_tests++;
9408:
9409: return(test_ret);
9410: }
9411:
9412:
9413: static int
9414: test_xmlEncodeSpecialChars(void) {
9415: int test_ret = 0;
9416:
9417: int mem_base;
9418: xmlChar * ret_val;
9419: xmlDocPtr doc; /* the document containing the string */
9420: int n_doc;
9421: xmlChar * input; /* A string to convert to XML. */
9422: int n_input;
9423:
9424: for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9425: for (n_input = 0;n_input < gen_nb_const_xmlChar_ptr;n_input++) {
9426: mem_base = xmlMemBlocks();
9427: doc = gen_xmlDocPtr(n_doc, 0);
9428: input = gen_const_xmlChar_ptr(n_input, 1);
9429:
9430: ret_val = xmlEncodeSpecialChars(doc, (const xmlChar *)input);
9431: desret_xmlChar_ptr(ret_val);
9432: call_tests++;
9433: des_xmlDocPtr(n_doc, doc, 0);
9434: des_const_xmlChar_ptr(n_input, (const xmlChar *)input, 1);
9435: xmlResetLastError();
9436: if (mem_base != xmlMemBlocks()) {
9437: printf("Leak of %d blocks found in xmlEncodeSpecialChars",
9438: xmlMemBlocks() - mem_base);
9439: test_ret++;
9440: printf(" %d", n_doc);
9441: printf(" %d", n_input);
9442: printf("\n");
9443: }
9444: }
9445: }
9446: function_tests++;
9447:
9448: return(test_ret);
9449: }
9450:
9451:
9452: static int
9453: test_xmlGetDocEntity(void) {
9454: int test_ret = 0;
9455:
9456: int mem_base;
9457: xmlEntityPtr ret_val;
9458: xmlDocPtr doc; /* the document referencing the entity */
9459: int n_doc;
9460: xmlChar * name; /* the entity name */
9461: int n_name;
9462:
9463: for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9464: for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9465: mem_base = xmlMemBlocks();
9466: doc = gen_xmlDocPtr(n_doc, 0);
9467: name = gen_const_xmlChar_ptr(n_name, 1);
9468:
9469: ret_val = xmlGetDocEntity(doc, (const xmlChar *)name);
9470: desret_xmlEntityPtr(ret_val);
9471: call_tests++;
9472: des_xmlDocPtr(n_doc, doc, 0);
9473: des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9474: xmlResetLastError();
9475: if (mem_base != xmlMemBlocks()) {
9476: printf("Leak of %d blocks found in xmlGetDocEntity",
9477: xmlMemBlocks() - mem_base);
9478: test_ret++;
9479: printf(" %d", n_doc);
9480: printf(" %d", n_name);
9481: printf("\n");
9482: }
9483: }
9484: }
9485: function_tests++;
9486:
9487: return(test_ret);
9488: }
9489:
9490:
9491: static int
9492: test_xmlGetDtdEntity(void) {
9493: int test_ret = 0;
9494:
9495: int mem_base;
9496: xmlEntityPtr ret_val;
9497: xmlDocPtr doc; /* the document referencing the entity */
9498: int n_doc;
9499: xmlChar * name; /* the entity name */
9500: int n_name;
9501:
9502: for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9503: for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9504: mem_base = xmlMemBlocks();
9505: doc = gen_xmlDocPtr(n_doc, 0);
9506: name = gen_const_xmlChar_ptr(n_name, 1);
9507:
9508: ret_val = xmlGetDtdEntity(doc, (const xmlChar *)name);
9509: desret_xmlEntityPtr(ret_val);
9510: call_tests++;
9511: des_xmlDocPtr(n_doc, doc, 0);
9512: des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9513: xmlResetLastError();
9514: if (mem_base != xmlMemBlocks()) {
9515: printf("Leak of %d blocks found in xmlGetDtdEntity",
9516: xmlMemBlocks() - mem_base);
9517: test_ret++;
9518: printf(" %d", n_doc);
9519: printf(" %d", n_name);
9520: printf("\n");
9521: }
9522: }
9523: }
9524: function_tests++;
9525:
9526: return(test_ret);
9527: }
9528:
9529:
9530: static int
9531: test_xmlGetParameterEntity(void) {
9532: int test_ret = 0;
9533:
9534: int mem_base;
9535: xmlEntityPtr ret_val;
9536: xmlDocPtr doc; /* the document referencing the entity */
9537: int n_doc;
9538: xmlChar * name; /* the entity name */
9539: int n_name;
9540:
9541: for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9542: for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9543: mem_base = xmlMemBlocks();
9544: doc = gen_xmlDocPtr(n_doc, 0);
9545: name = gen_const_xmlChar_ptr(n_name, 1);
9546:
9547: ret_val = xmlGetParameterEntity(doc, (const xmlChar *)name);
9548: desret_xmlEntityPtr(ret_val);
9549: call_tests++;
9550: des_xmlDocPtr(n_doc, doc, 0);
9551: des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9552: xmlResetLastError();
9553: if (mem_base != xmlMemBlocks()) {
9554: printf("Leak of %d blocks found in xmlGetParameterEntity",
9555: xmlMemBlocks() - mem_base);
9556: test_ret++;
9557: printf(" %d", n_doc);
9558: printf(" %d", n_name);
9559: printf("\n");
9560: }
9561: }
9562: }
9563: function_tests++;
9564:
9565: return(test_ret);
9566: }
9567:
9568:
9569: static int
9570: test_xmlGetPredefinedEntity(void) {
9571: int test_ret = 0;
9572:
9573: int mem_base;
9574: xmlEntityPtr ret_val;
9575: xmlChar * name; /* the entity name */
9576: int n_name;
9577:
9578: for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9579: mem_base = xmlMemBlocks();
9580: name = gen_const_xmlChar_ptr(n_name, 0);
9581:
9582: ret_val = xmlGetPredefinedEntity((const xmlChar *)name);
9583: desret_xmlEntityPtr(ret_val);
9584: call_tests++;
9585: des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
9586: xmlResetLastError();
9587: if (mem_base != xmlMemBlocks()) {
9588: printf("Leak of %d blocks found in xmlGetPredefinedEntity",
9589: xmlMemBlocks() - mem_base);
9590: test_ret++;
9591: printf(" %d", n_name);
9592: printf("\n");
9593: }
9594: }
9595: function_tests++;
9596:
9597: return(test_ret);
9598: }
9599:
9600:
9601: static int
9602: test_xmlInitializePredefinedEntities(void) {
9603: int test_ret = 0;
9604:
9605: #if defined(LIBXML_LEGACY_ENABLED)
9606: #ifdef LIBXML_LEGACY_ENABLED
9607: int mem_base;
9608:
9609: mem_base = xmlMemBlocks();
9610:
9611: xmlInitializePredefinedEntities();
9612: call_tests++;
9613: xmlResetLastError();
9614: if (mem_base != xmlMemBlocks()) {
9615: printf("Leak of %d blocks found in xmlInitializePredefinedEntities",
9616: xmlMemBlocks() - mem_base);
9617: test_ret++;
9618: printf("\n");
9619: }
9620: function_tests++;
9621: #endif
9622: #endif
9623:
9624: return(test_ret);
9625: }
9626:
9627:
9628: static int
9629: test_xmlNewEntity(void) {
9630: int test_ret = 0;
9631:
9632: int mem_base;
9633: xmlEntityPtr ret_val;
9634: xmlDocPtr doc; /* the document */
9635: int n_doc;
9636: xmlChar * name; /* the entity name */
9637: int n_name;
9638: int type; /* the entity type XML_xxx_yyy_ENTITY */
9639: int n_type;
9640: xmlChar * ExternalID; /* the entity external ID if available */
9641: int n_ExternalID;
9642: xmlChar * SystemID; /* the entity system ID if available */
9643: int n_SystemID;
9644: xmlChar * content; /* the entity content */
9645: int n_content;
9646:
9647: for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9648: for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9649: for (n_type = 0;n_type < gen_nb_int;n_type++) {
9650: for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
9651: for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
9652: for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
9653: mem_base = xmlMemBlocks();
9654: doc = gen_xmlDocPtr(n_doc, 0);
9655: name = gen_const_xmlChar_ptr(n_name, 1);
9656: type = gen_int(n_type, 2);
9657: ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 3);
9658: SystemID = gen_const_xmlChar_ptr(n_SystemID, 4);
9659: content = gen_const_xmlChar_ptr(n_content, 5);
9660:
9661: ret_val = xmlNewEntity(doc, (const xmlChar *)name, type, (const xmlChar *)ExternalID, (const xmlChar *)SystemID, (const xmlChar *)content);
9662: desret_xmlEntityPtr(ret_val);
9663: call_tests++;
9664: des_xmlDocPtr(n_doc, doc, 0);
9665: des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9666: des_int(n_type, type, 2);
9667: des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 3);
9668: des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 4);
9669: des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 5);
9670: xmlResetLastError();
9671: if (mem_base != xmlMemBlocks()) {
9672: printf("Leak of %d blocks found in xmlNewEntity",
9673: xmlMemBlocks() - mem_base);
9674: test_ret++;
9675: printf(" %d", n_doc);
9676: printf(" %d", n_name);
9677: printf(" %d", n_type);
9678: printf(" %d", n_ExternalID);
9679: printf(" %d", n_SystemID);
9680: printf(" %d", n_content);
9681: printf("\n");
9682: }
9683: }
9684: }
9685: }
9686: }
9687: }
9688: }
9689: function_tests++;
9690:
9691: return(test_ret);
9692: }
9693:
9694: static int
9695: test_entities(void) {
9696: int test_ret = 0;
9697:
9698: if (quiet == 0) printf("Testing entities : 13 of 17 functions ...\n");
9699: test_ret += test_xmlAddDocEntity();
9700: test_ret += test_xmlAddDtdEntity();
9701: test_ret += test_xmlCleanupPredefinedEntities();
9702: test_ret += test_xmlCopyEntitiesTable();
9703: test_ret += test_xmlCreateEntitiesTable();
9704: test_ret += test_xmlDumpEntitiesTable();
9705: test_ret += test_xmlDumpEntityDecl();
9706: test_ret += test_xmlEncodeEntitiesReentrant();
9707: test_ret += test_xmlEncodeSpecialChars();
9708: test_ret += test_xmlGetDocEntity();
9709: test_ret += test_xmlGetDtdEntity();
9710: test_ret += test_xmlGetParameterEntity();
9711: test_ret += test_xmlGetPredefinedEntity();
9712: test_ret += test_xmlInitializePredefinedEntities();
9713: test_ret += test_xmlNewEntity();
9714:
9715: if (test_ret != 0)
9716: printf("Module entities: %d errors\n", test_ret);
9717: return(test_ret);
9718: }
9719:
9720: static int
9721: test_xmlHashAddEntry(void) {
9722: int test_ret = 0;
9723:
9724: int mem_base;
9725: int ret_val;
9726: xmlHashTablePtr table; /* the hash table */
9727: int n_table;
9728: xmlChar * name; /* the name of the userdata */
9729: int n_name;
9730: void * userdata; /* a pointer to the userdata */
9731: int n_userdata;
9732:
9733: for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9734: for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9735: for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
9736: mem_base = xmlMemBlocks();
9737: table = gen_xmlHashTablePtr(n_table, 0);
9738: name = gen_const_xmlChar_ptr(n_name, 1);
9739: userdata = gen_userdata(n_userdata, 2);
9740:
9741: ret_val = xmlHashAddEntry(table, (const xmlChar *)name, userdata);
9742: desret_int(ret_val);
9743: call_tests++;
9744: des_xmlHashTablePtr(n_table, table, 0);
9745: des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9746: des_userdata(n_userdata, userdata, 2);
9747: xmlResetLastError();
9748: if (mem_base != xmlMemBlocks()) {
9749: printf("Leak of %d blocks found in xmlHashAddEntry",
9750: xmlMemBlocks() - mem_base);
9751: test_ret++;
9752: printf(" %d", n_table);
9753: printf(" %d", n_name);
9754: printf(" %d", n_userdata);
9755: printf("\n");
9756: }
9757: }
9758: }
9759: }
9760: function_tests++;
9761:
9762: return(test_ret);
9763: }
9764:
9765:
9766: static int
9767: test_xmlHashAddEntry2(void) {
9768: int test_ret = 0;
9769:
9770: int mem_base;
9771: int ret_val;
9772: xmlHashTablePtr table; /* the hash table */
9773: int n_table;
9774: xmlChar * name; /* the name of the userdata */
9775: int n_name;
9776: xmlChar * name2; /* a second name of the userdata */
9777: int n_name2;
9778: void * userdata; /* a pointer to the userdata */
9779: int n_userdata;
9780:
9781: for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9782: for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9783: for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
9784: for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
9785: mem_base = xmlMemBlocks();
9786: table = gen_xmlHashTablePtr(n_table, 0);
9787: name = gen_const_xmlChar_ptr(n_name, 1);
9788: name2 = gen_const_xmlChar_ptr(n_name2, 2);
9789: userdata = gen_userdata(n_userdata, 3);
9790:
9791: ret_val = xmlHashAddEntry2(table, (const xmlChar *)name, (const xmlChar *)name2, userdata);
9792: desret_int(ret_val);
9793: call_tests++;
9794: des_xmlHashTablePtr(n_table, table, 0);
9795: des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9796: des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
9797: des_userdata(n_userdata, userdata, 3);
9798: xmlResetLastError();
9799: if (mem_base != xmlMemBlocks()) {
9800: printf("Leak of %d blocks found in xmlHashAddEntry2",
9801: xmlMemBlocks() - mem_base);
9802: test_ret++;
9803: printf(" %d", n_table);
9804: printf(" %d", n_name);
9805: printf(" %d", n_name2);
9806: printf(" %d", n_userdata);
9807: printf("\n");
9808: }
9809: }
9810: }
9811: }
9812: }
9813: function_tests++;
9814:
9815: return(test_ret);
9816: }
9817:
9818:
9819: static int
9820: test_xmlHashAddEntry3(void) {
9821: int test_ret = 0;
9822:
9823: int mem_base;
9824: int ret_val;
9825: xmlHashTablePtr table; /* the hash table */
9826: int n_table;
9827: xmlChar * name; /* the name of the userdata */
9828: int n_name;
9829: xmlChar * name2; /* a second name of the userdata */
9830: int n_name2;
9831: xmlChar * name3; /* a third name of the userdata */
9832: int n_name3;
9833: void * userdata; /* a pointer to the userdata */
9834: int n_userdata;
9835:
9836: for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9837: for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9838: for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
9839: for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) {
9840: for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
9841: mem_base = xmlMemBlocks();
9842: table = gen_xmlHashTablePtr(n_table, 0);
9843: name = gen_const_xmlChar_ptr(n_name, 1);
9844: name2 = gen_const_xmlChar_ptr(n_name2, 2);
9845: name3 = gen_const_xmlChar_ptr(n_name3, 3);
9846: userdata = gen_userdata(n_userdata, 4);
9847:
9848: ret_val = xmlHashAddEntry3(table, (const xmlChar *)name, (const xmlChar *)name2, (const xmlChar *)name3, userdata);
9849: desret_int(ret_val);
9850: call_tests++;
9851: des_xmlHashTablePtr(n_table, table, 0);
9852: des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9853: des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
9854: des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 3);
9855: des_userdata(n_userdata, userdata, 4);
9856: xmlResetLastError();
9857: if (mem_base != xmlMemBlocks()) {
9858: printf("Leak of %d blocks found in xmlHashAddEntry3",
9859: xmlMemBlocks() - mem_base);
9860: test_ret++;
9861: printf(" %d", n_table);
9862: printf(" %d", n_name);
9863: printf(" %d", n_name2);
9864: printf(" %d", n_name3);
9865: printf(" %d", n_userdata);
9866: printf("\n");
9867: }
9868: }
9869: }
9870: }
9871: }
9872: }
9873: function_tests++;
9874:
9875: return(test_ret);
9876: }
9877:
9878:
9879: static int
9880: test_xmlHashCopy(void) {
9881: int test_ret = 0;
9882:
9883:
9884: /* missing type support */
9885: return(test_ret);
9886: }
9887:
9888:
9889: static int
9890: test_xmlHashCreate(void) {
9891: int test_ret = 0;
9892:
9893:
9894: /* missing type support */
9895: return(test_ret);
9896: }
9897:
9898:
9899: static int
9900: test_xmlHashCreateDict(void) {
9901: int test_ret = 0;
9902:
9903:
9904: /* missing type support */
9905: return(test_ret);
9906: }
9907:
9908:
9909: static int
9910: test_xmlHashLookup(void) {
9911: int test_ret = 0;
9912:
9913: int mem_base;
9914: void * ret_val;
9915: xmlHashTablePtr table; /* the hash table */
9916: int n_table;
9917: xmlChar * name; /* the name of the userdata */
9918: int n_name;
9919:
9920: for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9921: for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9922: mem_base = xmlMemBlocks();
9923: table = gen_xmlHashTablePtr(n_table, 0);
9924: name = gen_const_xmlChar_ptr(n_name, 1);
9925:
9926: ret_val = xmlHashLookup(table, (const xmlChar *)name);
9927: desret_void_ptr(ret_val);
9928: call_tests++;
9929: des_xmlHashTablePtr(n_table, table, 0);
9930: des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9931: xmlResetLastError();
9932: if (mem_base != xmlMemBlocks()) {
9933: printf("Leak of %d blocks found in xmlHashLookup",
9934: xmlMemBlocks() - mem_base);
9935: test_ret++;
9936: printf(" %d", n_table);
9937: printf(" %d", n_name);
9938: printf("\n");
9939: }
9940: }
9941: }
9942: function_tests++;
9943:
9944: return(test_ret);
9945: }
9946:
9947:
9948: static int
9949: test_xmlHashLookup2(void) {
9950: int test_ret = 0;
9951:
9952: int mem_base;
9953: void * ret_val;
9954: xmlHashTablePtr table; /* the hash table */
9955: int n_table;
9956: xmlChar * name; /* the name of the userdata */
9957: int n_name;
9958: xmlChar * name2; /* a second name of the userdata */
9959: int n_name2;
9960:
9961: for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9962: for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9963: for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
9964: mem_base = xmlMemBlocks();
9965: table = gen_xmlHashTablePtr(n_table, 0);
9966: name = gen_const_xmlChar_ptr(n_name, 1);
9967: name2 = gen_const_xmlChar_ptr(n_name2, 2);
9968:
9969: ret_val = xmlHashLookup2(table, (const xmlChar *)name, (const xmlChar *)name2);
9970: desret_void_ptr(ret_val);
9971: call_tests++;
9972: des_xmlHashTablePtr(n_table, table, 0);
9973: des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9974: des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
9975: xmlResetLastError();
9976: if (mem_base != xmlMemBlocks()) {
9977: printf("Leak of %d blocks found in xmlHashLookup2",
9978: xmlMemBlocks() - mem_base);
9979: test_ret++;
9980: printf(" %d", n_table);
9981: printf(" %d", n_name);
9982: printf(" %d", n_name2);
9983: printf("\n");
9984: }
9985: }
9986: }
9987: }
9988: function_tests++;
9989:
9990: return(test_ret);
9991: }
9992:
9993:
9994: static int
9995: test_xmlHashLookup3(void) {
9996: int test_ret = 0;
9997:
9998: int mem_base;
9999: void * ret_val;
10000: xmlHashTablePtr table; /* the hash table */
10001: int n_table;
10002: xmlChar * name; /* the name of the userdata */
10003: int n_name;
10004: xmlChar * name2; /* a second name of the userdata */
10005: int n_name2;
10006: xmlChar * name3; /* a third name of the userdata */
10007: int n_name3;
10008:
10009: for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10010: for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10011: for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10012: for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) {
10013: mem_base = xmlMemBlocks();
10014: table = gen_xmlHashTablePtr(n_table, 0);
10015: name = gen_const_xmlChar_ptr(n_name, 1);
10016: name2 = gen_const_xmlChar_ptr(n_name2, 2);
10017: name3 = gen_const_xmlChar_ptr(n_name3, 3);
10018:
10019: ret_val = xmlHashLookup3(table, (const xmlChar *)name, (const xmlChar *)name2, (const xmlChar *)name3);
10020: desret_void_ptr(ret_val);
10021: call_tests++;
10022: des_xmlHashTablePtr(n_table, table, 0);
10023: des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10024: des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
10025: des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 3);
10026: xmlResetLastError();
10027: if (mem_base != xmlMemBlocks()) {
10028: printf("Leak of %d blocks found in xmlHashLookup3",
10029: xmlMemBlocks() - mem_base);
10030: test_ret++;
10031: printf(" %d", n_table);
10032: printf(" %d", n_name);
10033: printf(" %d", n_name2);
10034: printf(" %d", n_name3);
10035: printf("\n");
10036: }
10037: }
10038: }
10039: }
10040: }
10041: function_tests++;
10042:
10043: return(test_ret);
10044: }
10045:
10046:
10047: static int
10048: test_xmlHashQLookup(void) {
10049: int test_ret = 0;
10050:
10051: int mem_base;
10052: void * ret_val;
10053: xmlHashTablePtr table; /* the hash table */
10054: int n_table;
10055: xmlChar * prefix; /* the prefix of the userdata */
10056: int n_prefix;
10057: xmlChar * name; /* the name of the userdata */
10058: int n_name;
10059:
10060: for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10061: for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
10062: for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10063: mem_base = xmlMemBlocks();
10064: table = gen_xmlHashTablePtr(n_table, 0);
10065: prefix = gen_const_xmlChar_ptr(n_prefix, 1);
10066: name = gen_const_xmlChar_ptr(n_name, 2);
10067:
10068: ret_val = xmlHashQLookup(table, (const xmlChar *)prefix, (const xmlChar *)name);
10069: desret_void_ptr(ret_val);
10070: call_tests++;
10071: des_xmlHashTablePtr(n_table, table, 0);
10072: des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
10073: des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
10074: xmlResetLastError();
10075: if (mem_base != xmlMemBlocks()) {
10076: printf("Leak of %d blocks found in xmlHashQLookup",
10077: xmlMemBlocks() - mem_base);
10078: test_ret++;
10079: printf(" %d", n_table);
10080: printf(" %d", n_prefix);
10081: printf(" %d", n_name);
10082: printf("\n");
10083: }
10084: }
10085: }
10086: }
10087: function_tests++;
10088:
10089: return(test_ret);
10090: }
10091:
10092:
10093: static int
10094: test_xmlHashQLookup2(void) {
10095: int test_ret = 0;
10096:
10097: int mem_base;
10098: void * ret_val;
10099: xmlHashTablePtr table; /* the hash table */
10100: int n_table;
10101: xmlChar * prefix; /* the prefix of the userdata */
10102: int n_prefix;
10103: xmlChar * name; /* the name of the userdata */
10104: int n_name;
10105: xmlChar * prefix2; /* the second prefix of the userdata */
10106: int n_prefix2;
10107: xmlChar * name2; /* a second name of the userdata */
10108: int n_name2;
10109:
10110: for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10111: for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
10112: for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10113: for (n_prefix2 = 0;n_prefix2 < gen_nb_const_xmlChar_ptr;n_prefix2++) {
10114: for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10115: mem_base = xmlMemBlocks();
10116: table = gen_xmlHashTablePtr(n_table, 0);
10117: prefix = gen_const_xmlChar_ptr(n_prefix, 1);
10118: name = gen_const_xmlChar_ptr(n_name, 2);
10119: prefix2 = gen_const_xmlChar_ptr(n_prefix2, 3);
10120: name2 = gen_const_xmlChar_ptr(n_name2, 4);
10121:
10122: ret_val = xmlHashQLookup2(table, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)prefix2, (const xmlChar *)name2);
10123: desret_void_ptr(ret_val);
10124: call_tests++;
10125: des_xmlHashTablePtr(n_table, table, 0);
10126: des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
10127: des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
10128: des_const_xmlChar_ptr(n_prefix2, (const xmlChar *)prefix2, 3);
10129: des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 4);
10130: xmlResetLastError();
10131: if (mem_base != xmlMemBlocks()) {
10132: printf("Leak of %d blocks found in xmlHashQLookup2",
10133: xmlMemBlocks() - mem_base);
10134: test_ret++;
10135: printf(" %d", n_table);
10136: printf(" %d", n_prefix);
10137: printf(" %d", n_name);
10138: printf(" %d", n_prefix2);
10139: printf(" %d", n_name2);
10140: printf("\n");
10141: }
10142: }
10143: }
10144: }
10145: }
10146: }
10147: function_tests++;
10148:
10149: return(test_ret);
10150: }
10151:
10152:
10153: static int
10154: test_xmlHashQLookup3(void) {
10155: int test_ret = 0;
10156:
10157: int mem_base;
10158: void * ret_val;
10159: xmlHashTablePtr table; /* the hash table */
10160: int n_table;
10161: xmlChar * prefix; /* the prefix of the userdata */
10162: int n_prefix;
10163: xmlChar * name; /* the name of the userdata */
10164: int n_name;
10165: xmlChar * prefix2; /* the second prefix of the userdata */
10166: int n_prefix2;
10167: xmlChar * name2; /* a second name of the userdata */
10168: int n_name2;
10169: xmlChar * prefix3; /* the third prefix of the userdata */
10170: int n_prefix3;
10171: xmlChar * name3; /* a third name of the userdata */
10172: int n_name3;
10173:
10174: for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10175: for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
10176: for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10177: for (n_prefix2 = 0;n_prefix2 < gen_nb_const_xmlChar_ptr;n_prefix2++) {
10178: for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10179: for (n_prefix3 = 0;n_prefix3 < gen_nb_const_xmlChar_ptr;n_prefix3++) {
10180: for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) {
10181: mem_base = xmlMemBlocks();
10182: table = gen_xmlHashTablePtr(n_table, 0);
10183: prefix = gen_const_xmlChar_ptr(n_prefix, 1);
10184: name = gen_const_xmlChar_ptr(n_name, 2);
10185: prefix2 = gen_const_xmlChar_ptr(n_prefix2, 3);
10186: name2 = gen_const_xmlChar_ptr(n_name2, 4);
10187: prefix3 = gen_const_xmlChar_ptr(n_prefix3, 5);
10188: name3 = gen_const_xmlChar_ptr(n_name3, 6);
10189:
10190: ret_val = xmlHashQLookup3(table, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)prefix2, (const xmlChar *)name2, (const xmlChar *)prefix3, (const xmlChar *)name3);
10191: desret_void_ptr(ret_val);
10192: call_tests++;
10193: des_xmlHashTablePtr(n_table, table, 0);
10194: des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
10195: des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
10196: des_const_xmlChar_ptr(n_prefix2, (const xmlChar *)prefix2, 3);
10197: des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 4);
10198: des_const_xmlChar_ptr(n_prefix3, (const xmlChar *)prefix3, 5);
10199: des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 6);
10200: xmlResetLastError();
10201: if (mem_base != xmlMemBlocks()) {
10202: printf("Leak of %d blocks found in xmlHashQLookup3",
10203: xmlMemBlocks() - mem_base);
10204: test_ret++;
10205: printf(" %d", n_table);
10206: printf(" %d", n_prefix);
10207: printf(" %d", n_name);
10208: printf(" %d", n_prefix2);
10209: printf(" %d", n_name2);
10210: printf(" %d", n_prefix3);
10211: printf(" %d", n_name3);
10212: printf("\n");
10213: }
10214: }
10215: }
10216: }
10217: }
10218: }
10219: }
10220: }
10221: function_tests++;
10222:
10223: return(test_ret);
10224: }
10225:
10226:
10227: static int
10228: test_xmlHashRemoveEntry(void) {
10229: int test_ret = 0;
10230:
10231: int mem_base;
10232: int ret_val;
10233: xmlHashTablePtr table; /* the hash table */
10234: int n_table;
10235: xmlChar * name; /* the name of the userdata */
10236: int n_name;
10237: xmlHashDeallocator f; /* the deallocator function for removed item (if any) */
10238: int n_f;
10239:
10240: for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10241: for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10242: for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10243: mem_base = xmlMemBlocks();
10244: table = gen_xmlHashTablePtr(n_table, 0);
10245: name = gen_const_xmlChar_ptr(n_name, 1);
10246: f = gen_xmlHashDeallocator(n_f, 2);
10247:
10248: ret_val = xmlHashRemoveEntry(table, (const xmlChar *)name, f);
10249: desret_int(ret_val);
10250: call_tests++;
10251: des_xmlHashTablePtr(n_table, table, 0);
10252: des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10253: des_xmlHashDeallocator(n_f, f, 2);
10254: xmlResetLastError();
10255: if (mem_base != xmlMemBlocks()) {
10256: printf("Leak of %d blocks found in xmlHashRemoveEntry",
10257: xmlMemBlocks() - mem_base);
10258: test_ret++;
10259: printf(" %d", n_table);
10260: printf(" %d", n_name);
10261: printf(" %d", n_f);
10262: printf("\n");
10263: }
10264: }
10265: }
10266: }
10267: function_tests++;
10268:
10269: return(test_ret);
10270: }
10271:
10272:
10273: static int
10274: test_xmlHashRemoveEntry2(void) {
10275: int test_ret = 0;
10276:
10277: int mem_base;
10278: int ret_val;
10279: xmlHashTablePtr table; /* the hash table */
10280: int n_table;
10281: xmlChar * name; /* the name of the userdata */
10282: int n_name;
10283: xmlChar * name2; /* a second name of the userdata */
10284: int n_name2;
10285: xmlHashDeallocator f; /* the deallocator function for removed item (if any) */
10286: int n_f;
10287:
10288: for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10289: for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10290: for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10291: for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10292: mem_base = xmlMemBlocks();
10293: table = gen_xmlHashTablePtr(n_table, 0);
10294: name = gen_const_xmlChar_ptr(n_name, 1);
10295: name2 = gen_const_xmlChar_ptr(n_name2, 2);
10296: f = gen_xmlHashDeallocator(n_f, 3);
10297:
10298: ret_val = xmlHashRemoveEntry2(table, (const xmlChar *)name, (const xmlChar *)name2, f);
10299: desret_int(ret_val);
10300: call_tests++;
10301: des_xmlHashTablePtr(n_table, table, 0);
10302: des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10303: des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
10304: des_xmlHashDeallocator(n_f, f, 3);
10305: xmlResetLastError();
10306: if (mem_base != xmlMemBlocks()) {
10307: printf("Leak of %d blocks found in xmlHashRemoveEntry2",
10308: xmlMemBlocks() - mem_base);
10309: test_ret++;
10310: printf(" %d", n_table);
10311: printf(" %d", n_name);
10312: printf(" %d", n_name2);
10313: printf(" %d", n_f);
10314: printf("\n");
10315: }
10316: }
10317: }
10318: }
10319: }
10320: function_tests++;
10321:
10322: return(test_ret);
10323: }
10324:
10325:
10326: static int
10327: test_xmlHashRemoveEntry3(void) {
10328: int test_ret = 0;
10329:
10330: int mem_base;
10331: int ret_val;
10332: xmlHashTablePtr table; /* the hash table */
10333: int n_table;
10334: xmlChar * name; /* the name of the userdata */
10335: int n_name;
10336: xmlChar * name2; /* a second name of the userdata */
10337: int n_name2;
10338: xmlChar * name3; /* a third name of the userdata */
10339: int n_name3;
10340: xmlHashDeallocator f; /* the deallocator function for removed item (if any) */
10341: int n_f;
10342:
10343: for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10344: for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10345: for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10346: for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) {
10347: for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10348: mem_base = xmlMemBlocks();
10349: table = gen_xmlHashTablePtr(n_table, 0);
10350: name = gen_const_xmlChar_ptr(n_name, 1);
10351: name2 = gen_const_xmlChar_ptr(n_name2, 2);
10352: name3 = gen_const_xmlChar_ptr(n_name3, 3);
10353: f = gen_xmlHashDeallocator(n_f, 4);
10354:
10355: ret_val = xmlHashRemoveEntry3(table, (const xmlChar *)name, (const xmlChar *)name2, (const xmlChar *)name3, f);
10356: desret_int(ret_val);
10357: call_tests++;
10358: des_xmlHashTablePtr(n_table, table, 0);
10359: des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10360: des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
10361: des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 3);
10362: des_xmlHashDeallocator(n_f, f, 4);
10363: xmlResetLastError();
10364: if (mem_base != xmlMemBlocks()) {
10365: printf("Leak of %d blocks found in xmlHashRemoveEntry3",
10366: xmlMemBlocks() - mem_base);
10367: test_ret++;
10368: printf(" %d", n_table);
10369: printf(" %d", n_name);
10370: printf(" %d", n_name2);
10371: printf(" %d", n_name3);
10372: printf(" %d", n_f);
10373: printf("\n");
10374: }
10375: }
10376: }
10377: }
10378: }
10379: }
10380: function_tests++;
10381:
10382: return(test_ret);
10383: }
10384:
10385:
10386: static int
10387: test_xmlHashScan(void) {
10388: int test_ret = 0;
10389:
10390:
10391: /* missing type support */
10392: return(test_ret);
10393: }
10394:
10395:
10396: static int
10397: test_xmlHashScan3(void) {
10398: int test_ret = 0;
10399:
10400:
10401: /* missing type support */
10402: return(test_ret);
10403: }
10404:
10405:
10406: static int
10407: test_xmlHashScanFull(void) {
10408: int test_ret = 0;
10409:
10410:
10411: /* missing type support */
10412: return(test_ret);
10413: }
10414:
10415:
10416: static int
10417: test_xmlHashScanFull3(void) {
10418: int test_ret = 0;
10419:
10420:
10421: /* missing type support */
10422: return(test_ret);
10423: }
10424:
10425:
10426: static int
10427: test_xmlHashSize(void) {
10428: int test_ret = 0;
10429:
10430: int mem_base;
10431: int ret_val;
10432: xmlHashTablePtr table; /* the hash table */
10433: int n_table;
10434:
10435: for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10436: mem_base = xmlMemBlocks();
10437: table = gen_xmlHashTablePtr(n_table, 0);
10438:
10439: ret_val = xmlHashSize(table);
10440: desret_int(ret_val);
10441: call_tests++;
10442: des_xmlHashTablePtr(n_table, table, 0);
10443: xmlResetLastError();
10444: if (mem_base != xmlMemBlocks()) {
10445: printf("Leak of %d blocks found in xmlHashSize",
10446: xmlMemBlocks() - mem_base);
10447: test_ret++;
10448: printf(" %d", n_table);
10449: printf("\n");
10450: }
10451: }
10452: function_tests++;
10453:
10454: return(test_ret);
10455: }
10456:
10457:
10458: static int
10459: test_xmlHashUpdateEntry(void) {
10460: int test_ret = 0;
10461:
10462: int mem_base;
10463: int ret_val;
10464: xmlHashTablePtr table; /* the hash table */
10465: int n_table;
10466: xmlChar * name; /* the name of the userdata */
10467: int n_name;
10468: void * userdata; /* a pointer to the userdata */
10469: int n_userdata;
10470: xmlHashDeallocator f; /* the deallocator function for replaced item (if any) */
10471: int n_f;
10472:
10473: for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10474: for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10475: for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
10476: for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10477: mem_base = xmlMemBlocks();
10478: table = gen_xmlHashTablePtr(n_table, 0);
10479: name = gen_const_xmlChar_ptr(n_name, 1);
10480: userdata = gen_userdata(n_userdata, 2);
10481: f = gen_xmlHashDeallocator(n_f, 3);
10482:
10483: ret_val = xmlHashUpdateEntry(table, (const xmlChar *)name, userdata, f);
10484: desret_int(ret_val);
10485: call_tests++;
10486: des_xmlHashTablePtr(n_table, table, 0);
10487: des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10488: des_userdata(n_userdata, userdata, 2);
10489: des_xmlHashDeallocator(n_f, f, 3);
10490: xmlResetLastError();
10491: if (mem_base != xmlMemBlocks()) {
10492: printf("Leak of %d blocks found in xmlHashUpdateEntry",
10493: xmlMemBlocks() - mem_base);
10494: test_ret++;
10495: printf(" %d", n_table);
10496: printf(" %d", n_name);
10497: printf(" %d", n_userdata);
10498: printf(" %d", n_f);
10499: printf("\n");
10500: }
10501: }
10502: }
10503: }
10504: }
10505: function_tests++;
10506:
10507: return(test_ret);
10508: }
10509:
10510:
10511: static int
10512: test_xmlHashUpdateEntry2(void) {
10513: int test_ret = 0;
10514:
10515: int mem_base;
10516: int ret_val;
10517: xmlHashTablePtr table; /* the hash table */
10518: int n_table;
10519: xmlChar * name; /* the name of the userdata */
10520: int n_name;
10521: xmlChar * name2; /* a second name of the userdata */
10522: int n_name2;
10523: void * userdata; /* a pointer to the userdata */
10524: int n_userdata;
10525: xmlHashDeallocator f; /* the deallocator function for replaced item (if any) */
10526: int n_f;
10527:
10528: for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10529: for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10530: for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10531: for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
10532: for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10533: mem_base = xmlMemBlocks();
10534: table = gen_xmlHashTablePtr(n_table, 0);
10535: name = gen_const_xmlChar_ptr(n_name, 1);
10536: name2 = gen_const_xmlChar_ptr(n_name2, 2);
10537: userdata = gen_userdata(n_userdata, 3);
10538: f = gen_xmlHashDeallocator(n_f, 4);
10539:
10540: ret_val = xmlHashUpdateEntry2(table, (const xmlChar *)name, (const xmlChar *)name2, userdata, f);
10541: desret_int(ret_val);
10542: call_tests++;
10543: des_xmlHashTablePtr(n_table, table, 0);
10544: des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10545: des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
10546: des_userdata(n_userdata, userdata, 3);
10547: des_xmlHashDeallocator(n_f, f, 4);
10548: xmlResetLastError();
10549: if (mem_base != xmlMemBlocks()) {
10550: printf("Leak of %d blocks found in xmlHashUpdateEntry2",
10551: xmlMemBlocks() - mem_base);
10552: test_ret++;
10553: printf(" %d", n_table);
10554: printf(" %d", n_name);
10555: printf(" %d", n_name2);
10556: printf(" %d", n_userdata);
10557: printf(" %d", n_f);
10558: printf("\n");
10559: }
10560: }
10561: }
10562: }
10563: }
10564: }
10565: function_tests++;
10566:
10567: return(test_ret);
10568: }
10569:
10570:
10571: static int
10572: test_xmlHashUpdateEntry3(void) {
10573: int test_ret = 0;
10574:
10575: int mem_base;
10576: int ret_val;
10577: xmlHashTablePtr table; /* the hash table */
10578: int n_table;
10579: xmlChar * name; /* the name of the userdata */
10580: int n_name;
10581: xmlChar * name2; /* a second name of the userdata */
10582: int n_name2;
10583: xmlChar * name3; /* a third name of the userdata */
10584: int n_name3;
10585: void * userdata; /* a pointer to the userdata */
10586: int n_userdata;
10587: xmlHashDeallocator f; /* the deallocator function for replaced item (if any) */
10588: int n_f;
10589:
10590: for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10591: for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10592: for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10593: for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) {
10594: for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
10595: for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10596: mem_base = xmlMemBlocks();
10597: table = gen_xmlHashTablePtr(n_table, 0);
10598: name = gen_const_xmlChar_ptr(n_name, 1);
10599: name2 = gen_const_xmlChar_ptr(n_name2, 2);
10600: name3 = gen_const_xmlChar_ptr(n_name3, 3);
10601: userdata = gen_userdata(n_userdata, 4);
10602: f = gen_xmlHashDeallocator(n_f, 5);
10603:
10604: ret_val = xmlHashUpdateEntry3(table, (const xmlChar *)name, (const xmlChar *)name2, (const xmlChar *)name3, userdata, f);
10605: desret_int(ret_val);
10606: call_tests++;
10607: des_xmlHashTablePtr(n_table, table, 0);
10608: des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10609: des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
10610: des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 3);
10611: des_userdata(n_userdata, userdata, 4);
10612: des_xmlHashDeallocator(n_f, f, 5);
10613: xmlResetLastError();
10614: if (mem_base != xmlMemBlocks()) {
10615: printf("Leak of %d blocks found in xmlHashUpdateEntry3",
10616: xmlMemBlocks() - mem_base);
10617: test_ret++;
10618: printf(" %d", n_table);
10619: printf(" %d", n_name);
10620: printf(" %d", n_name2);
10621: printf(" %d", n_name3);
10622: printf(" %d", n_userdata);
10623: printf(" %d", n_f);
10624: printf("\n");
10625: }
10626: }
10627: }
10628: }
10629: }
10630: }
10631: }
10632: function_tests++;
10633:
10634: return(test_ret);
10635: }
10636:
10637: static int
10638: test_hash(void) {
10639: int test_ret = 0;
10640:
10641: if (quiet == 0) printf("Testing hash : 16 of 24 functions ...\n");
10642: test_ret += test_xmlHashAddEntry();
10643: test_ret += test_xmlHashAddEntry2();
10644: test_ret += test_xmlHashAddEntry3();
10645: test_ret += test_xmlHashCopy();
10646: test_ret += test_xmlHashCreate();
10647: test_ret += test_xmlHashCreateDict();
10648: test_ret += test_xmlHashLookup();
10649: test_ret += test_xmlHashLookup2();
10650: test_ret += test_xmlHashLookup3();
10651: test_ret += test_xmlHashQLookup();
10652: test_ret += test_xmlHashQLookup2();
10653: test_ret += test_xmlHashQLookup3();
10654: test_ret += test_xmlHashRemoveEntry();
10655: test_ret += test_xmlHashRemoveEntry2();
10656: test_ret += test_xmlHashRemoveEntry3();
10657: test_ret += test_xmlHashScan();
10658: test_ret += test_xmlHashScan3();
10659: test_ret += test_xmlHashScanFull();
10660: test_ret += test_xmlHashScanFull3();
10661: test_ret += test_xmlHashSize();
10662: test_ret += test_xmlHashUpdateEntry();
10663: test_ret += test_xmlHashUpdateEntry2();
10664: test_ret += test_xmlHashUpdateEntry3();
10665:
10666: if (test_ret != 0)
10667: printf("Module hash: %d errors\n", test_ret);
10668: return(test_ret);
10669: }
10670:
10671: #define gen_nb_xmlLinkPtr 1
10672: static xmlLinkPtr gen_xmlLinkPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
10673: return(NULL);
10674: }
10675: static void des_xmlLinkPtr(int no ATTRIBUTE_UNUSED, xmlLinkPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
10676: }
10677:
10678: static int
10679: test_xmlLinkGetData(void) {
10680: int test_ret = 0;
10681:
10682: int mem_base;
10683: void * ret_val;
10684: xmlLinkPtr lk; /* a link */
10685: int n_lk;
10686:
10687: for (n_lk = 0;n_lk < gen_nb_xmlLinkPtr;n_lk++) {
10688: mem_base = xmlMemBlocks();
10689: lk = gen_xmlLinkPtr(n_lk, 0);
10690:
10691: ret_val = xmlLinkGetData(lk);
10692: desret_void_ptr(ret_val);
10693: call_tests++;
10694: des_xmlLinkPtr(n_lk, lk, 0);
10695: xmlResetLastError();
10696: if (mem_base != xmlMemBlocks()) {
10697: printf("Leak of %d blocks found in xmlLinkGetData",
10698: xmlMemBlocks() - mem_base);
10699: test_ret++;
10700: printf(" %d", n_lk);
10701: printf("\n");
10702: }
10703: }
10704: function_tests++;
10705:
10706: return(test_ret);
10707: }
10708:
10709:
10710: static int
10711: test_xmlListAppend(void) {
10712: int test_ret = 0;
10713:
10714: int mem_base;
10715: int ret_val;
10716: xmlListPtr l; /* a list */
10717: int n_l;
10718: void * data; /* the data */
10719: int n_data;
10720:
10721: for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10722: for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
10723: mem_base = xmlMemBlocks();
10724: l = gen_xmlListPtr(n_l, 0);
10725: data = gen_userdata(n_data, 1);
10726:
10727: ret_val = xmlListAppend(l, data);
10728: desret_int(ret_val);
10729: call_tests++;
10730: des_xmlListPtr(n_l, l, 0);
10731: des_userdata(n_data, data, 1);
10732: xmlResetLastError();
10733: if (mem_base != xmlMemBlocks()) {
10734: printf("Leak of %d blocks found in xmlListAppend",
10735: xmlMemBlocks() - mem_base);
10736: test_ret++;
10737: printf(" %d", n_l);
10738: printf(" %d", n_data);
10739: printf("\n");
10740: }
10741: }
10742: }
10743: function_tests++;
10744:
10745: return(test_ret);
10746: }
10747:
10748:
10749: static int
10750: test_xmlListClear(void) {
10751: int test_ret = 0;
10752:
10753: int mem_base;
10754: xmlListPtr l; /* a list */
10755: int n_l;
10756:
10757: for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10758: mem_base = xmlMemBlocks();
10759: l = gen_xmlListPtr(n_l, 0);
10760:
10761: xmlListClear(l);
10762: call_tests++;
10763: des_xmlListPtr(n_l, l, 0);
10764: xmlResetLastError();
10765: if (mem_base != xmlMemBlocks()) {
10766: printf("Leak of %d blocks found in xmlListClear",
10767: xmlMemBlocks() - mem_base);
10768: test_ret++;
10769: printf(" %d", n_l);
10770: printf("\n");
10771: }
10772: }
10773: function_tests++;
10774:
10775: return(test_ret);
10776: }
10777:
10778:
10779: #define gen_nb_const_xmlListPtr 1
10780: static xmlListPtr gen_const_xmlListPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
10781: return(NULL);
10782: }
10783: static void des_const_xmlListPtr(int no ATTRIBUTE_UNUSED, const xmlListPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
10784: }
10785:
10786: static int
10787: test_xmlListCopy(void) {
10788: int test_ret = 0;
10789:
10790: int mem_base;
10791: int ret_val;
10792: xmlListPtr cur; /* the new list */
10793: int n_cur;
10794: xmlListPtr old; /* the old list */
10795: int n_old;
10796:
10797: for (n_cur = 0;n_cur < gen_nb_xmlListPtr;n_cur++) {
10798: for (n_old = 0;n_old < gen_nb_const_xmlListPtr;n_old++) {
10799: mem_base = xmlMemBlocks();
10800: cur = gen_xmlListPtr(n_cur, 0);
10801: old = gen_const_xmlListPtr(n_old, 1);
10802:
10803: ret_val = xmlListCopy(cur, (const xmlListPtr)old);
10804: desret_int(ret_val);
10805: call_tests++;
10806: des_xmlListPtr(n_cur, cur, 0);
10807: des_const_xmlListPtr(n_old, (const xmlListPtr)old, 1);
10808: xmlResetLastError();
10809: if (mem_base != xmlMemBlocks()) {
10810: printf("Leak of %d blocks found in xmlListCopy",
10811: xmlMemBlocks() - mem_base);
10812: test_ret++;
10813: printf(" %d", n_cur);
10814: printf(" %d", n_old);
10815: printf("\n");
10816: }
10817: }
10818: }
10819: function_tests++;
10820:
10821: return(test_ret);
10822: }
10823:
10824:
10825: static int
10826: test_xmlListCreate(void) {
10827: int test_ret = 0;
10828:
10829:
10830: /* missing type support */
10831: return(test_ret);
10832: }
10833:
10834:
10835: static int
10836: test_xmlListDup(void) {
10837: int test_ret = 0;
10838:
10839:
10840: /* missing type support */
10841: return(test_ret);
10842: }
10843:
10844:
10845: static int
10846: test_xmlListEmpty(void) {
10847: int test_ret = 0;
10848:
10849: int mem_base;
10850: int ret_val;
10851: xmlListPtr l; /* a list */
10852: int n_l;
10853:
10854: for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10855: mem_base = xmlMemBlocks();
10856: l = gen_xmlListPtr(n_l, 0);
10857:
10858: ret_val = xmlListEmpty(l);
10859: desret_int(ret_val);
10860: call_tests++;
10861: des_xmlListPtr(n_l, l, 0);
10862: xmlResetLastError();
10863: if (mem_base != xmlMemBlocks()) {
10864: printf("Leak of %d blocks found in xmlListEmpty",
10865: xmlMemBlocks() - mem_base);
10866: test_ret++;
10867: printf(" %d", n_l);
10868: printf("\n");
10869: }
10870: }
10871: function_tests++;
10872:
10873: return(test_ret);
10874: }
10875:
10876:
10877: static int
10878: test_xmlListEnd(void) {
10879: int test_ret = 0;
10880:
10881:
10882: /* missing type support */
10883: return(test_ret);
10884: }
10885:
10886:
10887: static int
10888: test_xmlListFront(void) {
10889: int test_ret = 0;
10890:
10891:
10892: /* missing type support */
10893: return(test_ret);
10894: }
10895:
10896:
10897: static int
10898: test_xmlListInsert(void) {
10899: int test_ret = 0;
10900:
10901: int mem_base;
10902: int ret_val;
10903: xmlListPtr l; /* a list */
10904: int n_l;
10905: void * data; /* the data */
10906: int n_data;
10907:
10908: for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10909: for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
10910: mem_base = xmlMemBlocks();
10911: l = gen_xmlListPtr(n_l, 0);
10912: data = gen_userdata(n_data, 1);
10913:
10914: ret_val = xmlListInsert(l, data);
10915: desret_int(ret_val);
10916: call_tests++;
10917: des_xmlListPtr(n_l, l, 0);
10918: des_userdata(n_data, data, 1);
10919: xmlResetLastError();
10920: if (mem_base != xmlMemBlocks()) {
10921: printf("Leak of %d blocks found in xmlListInsert",
10922: xmlMemBlocks() - mem_base);
10923: test_ret++;
10924: printf(" %d", n_l);
10925: printf(" %d", n_data);
10926: printf("\n");
10927: }
10928: }
10929: }
10930: function_tests++;
10931:
10932: return(test_ret);
10933: }
10934:
10935:
10936: static int
10937: test_xmlListMerge(void) {
10938: int test_ret = 0;
10939:
10940: int mem_base;
10941: xmlListPtr l1; /* the original list */
10942: int n_l1;
10943: xmlListPtr l2; /* the new list */
10944: int n_l2;
10945:
10946: for (n_l1 = 0;n_l1 < gen_nb_xmlListPtr;n_l1++) {
10947: for (n_l2 = 0;n_l2 < gen_nb_xmlListPtr;n_l2++) {
10948: mem_base = xmlMemBlocks();
10949: l1 = gen_xmlListPtr(n_l1, 0);
10950: l2 = gen_xmlListPtr(n_l2, 1);
10951:
10952: xmlListMerge(l1, l2);
10953: call_tests++;
10954: des_xmlListPtr(n_l1, l1, 0);
10955: des_xmlListPtr(n_l2, l2, 1);
10956: xmlResetLastError();
10957: if (mem_base != xmlMemBlocks()) {
10958: printf("Leak of %d blocks found in xmlListMerge",
10959: xmlMemBlocks() - mem_base);
10960: test_ret++;
10961: printf(" %d", n_l1);
10962: printf(" %d", n_l2);
10963: printf("\n");
10964: }
10965: }
10966: }
10967: function_tests++;
10968:
10969: return(test_ret);
10970: }
10971:
10972:
10973: static int
10974: test_xmlListPopBack(void) {
10975: int test_ret = 0;
10976:
10977: int mem_base;
10978: xmlListPtr l; /* a list */
10979: int n_l;
10980:
10981: for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10982: mem_base = xmlMemBlocks();
10983: l = gen_xmlListPtr(n_l, 0);
10984:
10985: xmlListPopBack(l);
10986: call_tests++;
10987: des_xmlListPtr(n_l, l, 0);
10988: xmlResetLastError();
10989: if (mem_base != xmlMemBlocks()) {
10990: printf("Leak of %d blocks found in xmlListPopBack",
10991: xmlMemBlocks() - mem_base);
10992: test_ret++;
10993: printf(" %d", n_l);
10994: printf("\n");
10995: }
10996: }
10997: function_tests++;
10998:
10999: return(test_ret);
11000: }
11001:
11002:
11003: static int
11004: test_xmlListPopFront(void) {
11005: int test_ret = 0;
11006:
11007: int mem_base;
11008: xmlListPtr l; /* a list */
11009: int n_l;
11010:
11011: for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11012: mem_base = xmlMemBlocks();
11013: l = gen_xmlListPtr(n_l, 0);
11014:
11015: xmlListPopFront(l);
11016: call_tests++;
11017: des_xmlListPtr(n_l, l, 0);
11018: xmlResetLastError();
11019: if (mem_base != xmlMemBlocks()) {
11020: printf("Leak of %d blocks found in xmlListPopFront",
11021: xmlMemBlocks() - mem_base);
11022: test_ret++;
11023: printf(" %d", n_l);
11024: printf("\n");
11025: }
11026: }
11027: function_tests++;
11028:
11029: return(test_ret);
11030: }
11031:
11032:
11033: static int
11034: test_xmlListPushBack(void) {
11035: int test_ret = 0;
11036:
11037: int mem_base;
11038: int ret_val;
11039: xmlListPtr l; /* a list */
11040: int n_l;
11041: void * data; /* new data */
11042: int n_data;
11043:
11044: for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11045: for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11046: mem_base = xmlMemBlocks();
11047: l = gen_xmlListPtr(n_l, 0);
11048: data = gen_userdata(n_data, 1);
11049:
11050: ret_val = xmlListPushBack(l, data);
11051: desret_int(ret_val);
11052: call_tests++;
11053: des_xmlListPtr(n_l, l, 0);
11054: des_userdata(n_data, data, 1);
11055: xmlResetLastError();
11056: if (mem_base != xmlMemBlocks()) {
11057: printf("Leak of %d blocks found in xmlListPushBack",
11058: xmlMemBlocks() - mem_base);
11059: test_ret++;
11060: printf(" %d", n_l);
11061: printf(" %d", n_data);
11062: printf("\n");
11063: }
11064: }
11065: }
11066: function_tests++;
11067:
11068: return(test_ret);
11069: }
11070:
11071:
11072: static int
11073: test_xmlListPushFront(void) {
11074: int test_ret = 0;
11075:
11076: int mem_base;
11077: int ret_val;
11078: xmlListPtr l; /* a list */
11079: int n_l;
11080: void * data; /* new data */
11081: int n_data;
11082:
11083: for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11084: for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11085: mem_base = xmlMemBlocks();
11086: l = gen_xmlListPtr(n_l, 0);
11087: data = gen_userdata(n_data, 1);
11088:
11089: ret_val = xmlListPushFront(l, data);
11090: desret_int(ret_val);
11091: call_tests++;
11092: des_xmlListPtr(n_l, l, 0);
11093: des_userdata(n_data, data, 1);
11094: xmlResetLastError();
11095: if (mem_base != xmlMemBlocks()) {
11096: printf("Leak of %d blocks found in xmlListPushFront",
11097: xmlMemBlocks() - mem_base);
11098: test_ret++;
11099: printf(" %d", n_l);
11100: printf(" %d", n_data);
11101: printf("\n");
11102: }
11103: }
11104: }
11105: function_tests++;
11106:
11107: return(test_ret);
11108: }
11109:
11110:
11111: static int
11112: test_xmlListRemoveAll(void) {
11113: int test_ret = 0;
11114:
11115: int mem_base;
11116: int ret_val;
11117: xmlListPtr l; /* a list */
11118: int n_l;
11119: void * data; /* list data */
11120: int n_data;
11121:
11122: for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11123: for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11124: mem_base = xmlMemBlocks();
11125: l = gen_xmlListPtr(n_l, 0);
11126: data = gen_userdata(n_data, 1);
11127:
11128: ret_val = xmlListRemoveAll(l, data);
11129: desret_int(ret_val);
11130: call_tests++;
11131: des_xmlListPtr(n_l, l, 0);
11132: des_userdata(n_data, data, 1);
11133: xmlResetLastError();
11134: if (mem_base != xmlMemBlocks()) {
11135: printf("Leak of %d blocks found in xmlListRemoveAll",
11136: xmlMemBlocks() - mem_base);
11137: test_ret++;
11138: printf(" %d", n_l);
11139: printf(" %d", n_data);
11140: printf("\n");
11141: }
11142: }
11143: }
11144: function_tests++;
11145:
11146: return(test_ret);
11147: }
11148:
11149:
11150: static int
11151: test_xmlListRemoveFirst(void) {
11152: int test_ret = 0;
11153:
11154: int mem_base;
11155: int ret_val;
11156: xmlListPtr l; /* a list */
11157: int n_l;
11158: void * data; /* list data */
11159: int n_data;
11160:
11161: for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11162: for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11163: mem_base = xmlMemBlocks();
11164: l = gen_xmlListPtr(n_l, 0);
11165: data = gen_userdata(n_data, 1);
11166:
11167: ret_val = xmlListRemoveFirst(l, data);
11168: desret_int(ret_val);
11169: call_tests++;
11170: des_xmlListPtr(n_l, l, 0);
11171: des_userdata(n_data, data, 1);
11172: xmlResetLastError();
11173: if (mem_base != xmlMemBlocks()) {
11174: printf("Leak of %d blocks found in xmlListRemoveFirst",
11175: xmlMemBlocks() - mem_base);
11176: test_ret++;
11177: printf(" %d", n_l);
11178: printf(" %d", n_data);
11179: printf("\n");
11180: }
11181: }
11182: }
11183: function_tests++;
11184:
11185: return(test_ret);
11186: }
11187:
11188:
11189: static int
11190: test_xmlListRemoveLast(void) {
11191: int test_ret = 0;
11192:
11193: int mem_base;
11194: int ret_val;
11195: xmlListPtr l; /* a list */
11196: int n_l;
11197: void * data; /* list data */
11198: int n_data;
11199:
11200: for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11201: for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11202: mem_base = xmlMemBlocks();
11203: l = gen_xmlListPtr(n_l, 0);
11204: data = gen_userdata(n_data, 1);
11205:
11206: ret_val = xmlListRemoveLast(l, data);
11207: desret_int(ret_val);
11208: call_tests++;
11209: des_xmlListPtr(n_l, l, 0);
11210: des_userdata(n_data, data, 1);
11211: xmlResetLastError();
11212: if (mem_base != xmlMemBlocks()) {
11213: printf("Leak of %d blocks found in xmlListRemoveLast",
11214: xmlMemBlocks() - mem_base);
11215: test_ret++;
11216: printf(" %d", n_l);
11217: printf(" %d", n_data);
11218: printf("\n");
11219: }
11220: }
11221: }
11222: function_tests++;
11223:
11224: return(test_ret);
11225: }
11226:
11227:
11228: static int
11229: test_xmlListReverse(void) {
11230: int test_ret = 0;
11231:
11232: int mem_base;
11233: xmlListPtr l; /* a list */
11234: int n_l;
11235:
11236: for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11237: mem_base = xmlMemBlocks();
11238: l = gen_xmlListPtr(n_l, 0);
11239:
11240: xmlListReverse(l);
11241: call_tests++;
11242: des_xmlListPtr(n_l, l, 0);
11243: xmlResetLastError();
11244: if (mem_base != xmlMemBlocks()) {
11245: printf("Leak of %d blocks found in xmlListReverse",
11246: xmlMemBlocks() - mem_base);
11247: test_ret++;
11248: printf(" %d", n_l);
11249: printf("\n");
11250: }
11251: }
11252: function_tests++;
11253:
11254: return(test_ret);
11255: }
11256:
11257:
11258: static int
11259: test_xmlListReverseSearch(void) {
11260: int test_ret = 0;
11261:
11262: int mem_base;
11263: void * ret_val;
11264: xmlListPtr l; /* a list */
11265: int n_l;
11266: void * data; /* a search value */
11267: int n_data;
11268:
11269: for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11270: for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11271: mem_base = xmlMemBlocks();
11272: l = gen_xmlListPtr(n_l, 0);
11273: data = gen_userdata(n_data, 1);
11274:
11275: ret_val = xmlListReverseSearch(l, data);
11276: desret_void_ptr(ret_val);
11277: call_tests++;
11278: des_xmlListPtr(n_l, l, 0);
11279: des_userdata(n_data, data, 1);
11280: xmlResetLastError();
11281: if (mem_base != xmlMemBlocks()) {
11282: printf("Leak of %d blocks found in xmlListReverseSearch",
11283: xmlMemBlocks() - mem_base);
11284: test_ret++;
11285: printf(" %d", n_l);
11286: printf(" %d", n_data);
11287: printf("\n");
11288: }
11289: }
11290: }
11291: function_tests++;
11292:
11293: return(test_ret);
11294: }
11295:
11296:
11297: static int
11298: test_xmlListReverseWalk(void) {
11299: int test_ret = 0;
11300:
11301:
11302: /* missing type support */
11303: return(test_ret);
11304: }
11305:
11306:
11307: static int
11308: test_xmlListSearch(void) {
11309: int test_ret = 0;
11310:
11311: int mem_base;
11312: void * ret_val;
11313: xmlListPtr l; /* a list */
11314: int n_l;
11315: void * data; /* a search value */
11316: int n_data;
11317:
11318: for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11319: for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11320: mem_base = xmlMemBlocks();
11321: l = gen_xmlListPtr(n_l, 0);
11322: data = gen_userdata(n_data, 1);
11323:
11324: ret_val = xmlListSearch(l, data);
11325: desret_void_ptr(ret_val);
11326: call_tests++;
11327: des_xmlListPtr(n_l, l, 0);
11328: des_userdata(n_data, data, 1);
11329: xmlResetLastError();
11330: if (mem_base != xmlMemBlocks()) {
11331: printf("Leak of %d blocks found in xmlListSearch",
11332: xmlMemBlocks() - mem_base);
11333: test_ret++;
11334: printf(" %d", n_l);
11335: printf(" %d", n_data);
11336: printf("\n");
11337: }
11338: }
11339: }
11340: function_tests++;
11341:
11342: return(test_ret);
11343: }
11344:
11345:
11346: static int
11347: test_xmlListSize(void) {
11348: int test_ret = 0;
11349:
11350: int mem_base;
11351: int ret_val;
11352: xmlListPtr l; /* a list */
11353: int n_l;
11354:
11355: for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11356: mem_base = xmlMemBlocks();
11357: l = gen_xmlListPtr(n_l, 0);
11358:
11359: ret_val = xmlListSize(l);
11360: desret_int(ret_val);
11361: call_tests++;
11362: des_xmlListPtr(n_l, l, 0);
11363: xmlResetLastError();
11364: if (mem_base != xmlMemBlocks()) {
11365: printf("Leak of %d blocks found in xmlListSize",
11366: xmlMemBlocks() - mem_base);
11367: test_ret++;
11368: printf(" %d", n_l);
11369: printf("\n");
11370: }
11371: }
11372: function_tests++;
11373:
11374: return(test_ret);
11375: }
11376:
11377:
11378: static int
11379: test_xmlListSort(void) {
11380: int test_ret = 0;
11381:
11382: int mem_base;
11383: xmlListPtr l; /* a list */
11384: int n_l;
11385:
11386: for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11387: mem_base = xmlMemBlocks();
11388: l = gen_xmlListPtr(n_l, 0);
11389:
11390: xmlListSort(l);
11391: call_tests++;
11392: des_xmlListPtr(n_l, l, 0);
11393: xmlResetLastError();
11394: if (mem_base != xmlMemBlocks()) {
11395: printf("Leak of %d blocks found in xmlListSort",
11396: xmlMemBlocks() - mem_base);
11397: test_ret++;
11398: printf(" %d", n_l);
11399: printf("\n");
11400: }
11401: }
11402: function_tests++;
11403:
11404: return(test_ret);
11405: }
11406:
11407:
11408: static int
11409: test_xmlListWalk(void) {
11410: int test_ret = 0;
11411:
11412:
11413: /* missing type support */
11414: return(test_ret);
11415: }
11416:
11417: static int
11418: test_list(void) {
11419: int test_ret = 0;
11420:
11421: if (quiet == 0) printf("Testing list : 19 of 26 functions ...\n");
11422: test_ret += test_xmlLinkGetData();
11423: test_ret += test_xmlListAppend();
11424: test_ret += test_xmlListClear();
11425: test_ret += test_xmlListCopy();
11426: test_ret += test_xmlListCreate();
11427: test_ret += test_xmlListDup();
11428: test_ret += test_xmlListEmpty();
11429: test_ret += test_xmlListEnd();
11430: test_ret += test_xmlListFront();
11431: test_ret += test_xmlListInsert();
11432: test_ret += test_xmlListMerge();
11433: test_ret += test_xmlListPopBack();
11434: test_ret += test_xmlListPopFront();
11435: test_ret += test_xmlListPushBack();
11436: test_ret += test_xmlListPushFront();
11437: test_ret += test_xmlListRemoveAll();
11438: test_ret += test_xmlListRemoveFirst();
11439: test_ret += test_xmlListRemoveLast();
11440: test_ret += test_xmlListReverse();
11441: test_ret += test_xmlListReverseSearch();
11442: test_ret += test_xmlListReverseWalk();
11443: test_ret += test_xmlListSearch();
11444: test_ret += test_xmlListSize();
11445: test_ret += test_xmlListSort();
11446: test_ret += test_xmlListWalk();
11447:
11448: if (test_ret != 0)
11449: printf("Module list: %d errors\n", test_ret);
11450: return(test_ret);
11451: }
11452:
11453: static int
11454: test_xmlNanoFTPCheckResponse(void) {
11455: int test_ret = 0;
11456:
11457: #if defined(LIBXML_FTP_ENABLED)
11458: int mem_base;
11459: int ret_val;
11460: void * ctx; /* an FTP context */
11461: int n_ctx;
11462:
11463: for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11464: mem_base = xmlMemBlocks();
11465: ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11466:
11467: ret_val = xmlNanoFTPCheckResponse(ctx);
11468: desret_int(ret_val);
11469: call_tests++;
11470: des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11471: xmlResetLastError();
11472: if (mem_base != xmlMemBlocks()) {
11473: printf("Leak of %d blocks found in xmlNanoFTPCheckResponse",
11474: xmlMemBlocks() - mem_base);
11475: test_ret++;
11476: printf(" %d", n_ctx);
11477: printf("\n");
11478: }
11479: }
11480: function_tests++;
11481: #endif
11482:
11483: return(test_ret);
11484: }
11485:
11486:
11487: static int
11488: test_xmlNanoFTPCleanup(void) {
11489: int test_ret = 0;
11490:
11491: #if defined(LIBXML_FTP_ENABLED)
11492: int mem_base;
11493:
11494: mem_base = xmlMemBlocks();
11495:
11496: xmlNanoFTPCleanup();
11497: call_tests++;
11498: xmlResetLastError();
11499: if (mem_base != xmlMemBlocks()) {
11500: printf("Leak of %d blocks found in xmlNanoFTPCleanup",
11501: xmlMemBlocks() - mem_base);
11502: test_ret++;
11503: printf("\n");
11504: }
11505: function_tests++;
11506: #endif
11507:
11508: return(test_ret);
11509: }
11510:
11511:
11512: static int
11513: test_xmlNanoFTPCloseConnection(void) {
11514: int test_ret = 0;
11515:
11516: #if defined(LIBXML_FTP_ENABLED)
11517: int mem_base;
11518: int ret_val;
11519: void * ctx; /* an FTP context */
11520: int n_ctx;
11521:
11522: for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11523: mem_base = xmlMemBlocks();
11524: ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11525:
11526: ret_val = xmlNanoFTPCloseConnection(ctx);
11527: desret_int(ret_val);
11528: call_tests++;
11529: des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11530: xmlResetLastError();
11531: if (mem_base != xmlMemBlocks()) {
11532: printf("Leak of %d blocks found in xmlNanoFTPCloseConnection",
11533: xmlMemBlocks() - mem_base);
11534: test_ret++;
11535: printf(" %d", n_ctx);
11536: printf("\n");
11537: }
11538: }
11539: function_tests++;
11540: #endif
11541:
11542: return(test_ret);
11543: }
11544:
11545:
11546: static int
11547: test_xmlNanoFTPCwd(void) {
11548: int test_ret = 0;
11549:
11550: #if defined(LIBXML_FTP_ENABLED)
11551: int mem_base;
11552: int ret_val;
11553: void * ctx; /* an FTP context */
11554: int n_ctx;
11555: char * directory; /* a directory on the server */
11556: int n_directory;
11557:
11558: for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11559: for (n_directory = 0;n_directory < gen_nb_const_char_ptr;n_directory++) {
11560: mem_base = xmlMemBlocks();
11561: ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11562: directory = gen_const_char_ptr(n_directory, 1);
11563:
11564: ret_val = xmlNanoFTPCwd(ctx, (const char *)directory);
11565: desret_int(ret_val);
11566: call_tests++;
11567: des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11568: des_const_char_ptr(n_directory, (const char *)directory, 1);
11569: xmlResetLastError();
11570: if (mem_base != xmlMemBlocks()) {
11571: printf("Leak of %d blocks found in xmlNanoFTPCwd",
11572: xmlMemBlocks() - mem_base);
11573: test_ret++;
11574: printf(" %d", n_ctx);
11575: printf(" %d", n_directory);
11576: printf("\n");
11577: }
11578: }
11579: }
11580: function_tests++;
11581: #endif
11582:
11583: return(test_ret);
11584: }
11585:
11586:
11587: static int
11588: test_xmlNanoFTPDele(void) {
11589: int test_ret = 0;
11590:
11591: #if defined(LIBXML_FTP_ENABLED)
11592: int mem_base;
11593: int ret_val;
11594: void * ctx; /* an FTP context */
11595: int n_ctx;
11596: const char * file; /* a file or directory on the server */
11597: int n_file;
11598:
11599: for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11600: for (n_file = 0;n_file < gen_nb_filepath;n_file++) {
11601: mem_base = xmlMemBlocks();
11602: ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11603: file = gen_filepath(n_file, 1);
11604:
11605: ret_val = xmlNanoFTPDele(ctx, file);
11606: desret_int(ret_val);
11607: call_tests++;
11608: des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11609: des_filepath(n_file, file, 1);
11610: xmlResetLastError();
11611: if (mem_base != xmlMemBlocks()) {
11612: printf("Leak of %d blocks found in xmlNanoFTPDele",
11613: xmlMemBlocks() - mem_base);
11614: test_ret++;
11615: printf(" %d", n_ctx);
11616: printf(" %d", n_file);
11617: printf("\n");
11618: }
11619: }
11620: }
11621: function_tests++;
11622: #endif
11623:
11624: return(test_ret);
11625: }
11626:
11627:
11628: static int
11629: test_xmlNanoFTPGet(void) {
11630: int test_ret = 0;
11631:
11632:
11633: /* missing type support */
11634: return(test_ret);
11635: }
11636:
11637:
11638: static int
11639: test_xmlNanoFTPGetConnection(void) {
11640: int test_ret = 0;
11641:
11642:
11643: /* missing type support */
11644: return(test_ret);
11645: }
11646:
11647:
11648: static int
11649: test_xmlNanoFTPGetResponse(void) {
11650: int test_ret = 0;
11651:
11652: #if defined(LIBXML_FTP_ENABLED)
11653: int mem_base;
11654: int ret_val;
11655: void * ctx; /* an FTP context */
11656: int n_ctx;
11657:
11658: for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11659: mem_base = xmlMemBlocks();
11660: ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11661:
11662: ret_val = xmlNanoFTPGetResponse(ctx);
11663: desret_int(ret_val);
11664: call_tests++;
11665: des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11666: xmlResetLastError();
11667: if (mem_base != xmlMemBlocks()) {
11668: printf("Leak of %d blocks found in xmlNanoFTPGetResponse",
11669: xmlMemBlocks() - mem_base);
11670: test_ret++;
11671: printf(" %d", n_ctx);
11672: printf("\n");
11673: }
11674: }
11675: function_tests++;
11676: #endif
11677:
11678: return(test_ret);
11679: }
11680:
11681:
11682: static int
11683: test_xmlNanoFTPGetSocket(void) {
11684: int test_ret = 0;
11685:
11686:
11687: /* missing type support */
11688: return(test_ret);
11689: }
11690:
11691:
11692: static int
11693: test_xmlNanoFTPInit(void) {
11694: int test_ret = 0;
11695:
11696: #if defined(LIBXML_FTP_ENABLED)
11697: int mem_base;
11698:
11699: mem_base = xmlMemBlocks();
11700:
11701: xmlNanoFTPInit();
11702: call_tests++;
11703: xmlResetLastError();
11704: if (mem_base != xmlMemBlocks()) {
11705: printf("Leak of %d blocks found in xmlNanoFTPInit",
11706: xmlMemBlocks() - mem_base);
11707: test_ret++;
11708: printf("\n");
11709: }
11710: function_tests++;
11711: #endif
11712:
11713: return(test_ret);
11714: }
11715:
11716:
11717: static int
11718: test_xmlNanoFTPList(void) {
11719: int test_ret = 0;
11720:
11721:
11722: /* missing type support */
11723: return(test_ret);
11724: }
11725:
11726:
11727: static int
11728: test_xmlNanoFTPNewCtxt(void) {
11729: int test_ret = 0;
11730:
11731: #if defined(LIBXML_FTP_ENABLED)
11732: int mem_base;
11733: void * ret_val;
11734: const char * URL; /* The URL used to initialize the context */
11735: int n_URL;
11736:
11737: for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
11738: mem_base = xmlMemBlocks();
11739: URL = gen_filepath(n_URL, 0);
11740:
11741: ret_val = xmlNanoFTPNewCtxt(URL);
11742: desret_xmlNanoFTPCtxtPtr(ret_val);
11743: call_tests++;
11744: des_filepath(n_URL, URL, 0);
11745: xmlResetLastError();
11746: if (mem_base != xmlMemBlocks()) {
11747: printf("Leak of %d blocks found in xmlNanoFTPNewCtxt",
11748: xmlMemBlocks() - mem_base);
11749: test_ret++;
11750: printf(" %d", n_URL);
11751: printf("\n");
11752: }
11753: }
11754: function_tests++;
11755: #endif
11756:
11757: return(test_ret);
11758: }
11759:
11760:
11761: static int
11762: test_xmlNanoFTPOpen(void) {
11763: int test_ret = 0;
11764:
11765: #if defined(LIBXML_FTP_ENABLED)
11766: int mem_base;
11767: void * ret_val;
11768: const char * URL; /* the URL to the resource */
11769: int n_URL;
11770:
11771: for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
11772: mem_base = xmlMemBlocks();
11773: URL = gen_filepath(n_URL, 0);
11774:
11775: ret_val = xmlNanoFTPOpen(URL);
11776: desret_xmlNanoFTPCtxtPtr(ret_val);
11777: call_tests++;
11778: des_filepath(n_URL, URL, 0);
11779: xmlResetLastError();
11780: if (mem_base != xmlMemBlocks()) {
11781: printf("Leak of %d blocks found in xmlNanoFTPOpen",
11782: xmlMemBlocks() - mem_base);
11783: test_ret++;
11784: printf(" %d", n_URL);
11785: printf("\n");
11786: }
11787: }
11788: function_tests++;
11789: #endif
11790:
11791: return(test_ret);
11792: }
11793:
11794:
11795: static int
11796: test_xmlNanoFTPProxy(void) {
11797: int test_ret = 0;
11798:
11799: #if defined(LIBXML_FTP_ENABLED)
11800: char * host; /* the proxy host name */
11801: int n_host;
11802: int port; /* the proxy port */
11803: int n_port;
11804: char * user; /* the proxy user name */
11805: int n_user;
11806: char * passwd; /* the proxy password */
11807: int n_passwd;
11808: int type; /* the type of proxy 1 for using SITE, 2 for USER a@b */
11809: int n_type;
11810:
11811: for (n_host = 0;n_host < gen_nb_const_char_ptr;n_host++) {
11812: for (n_port = 0;n_port < gen_nb_int;n_port++) {
11813: for (n_user = 0;n_user < gen_nb_const_char_ptr;n_user++) {
11814: for (n_passwd = 0;n_passwd < gen_nb_const_char_ptr;n_passwd++) {
11815: for (n_type = 0;n_type < gen_nb_int;n_type++) {
11816: host = gen_const_char_ptr(n_host, 0);
11817: port = gen_int(n_port, 1);
11818: user = gen_const_char_ptr(n_user, 2);
11819: passwd = gen_const_char_ptr(n_passwd, 3);
11820: type = gen_int(n_type, 4);
11821:
11822: xmlNanoFTPProxy((const char *)host, port, (const char *)user, (const char *)passwd, type);
11823: call_tests++;
11824: des_const_char_ptr(n_host, (const char *)host, 0);
11825: des_int(n_port, port, 1);
11826: des_const_char_ptr(n_user, (const char *)user, 2);
11827: des_const_char_ptr(n_passwd, (const char *)passwd, 3);
11828: des_int(n_type, type, 4);
11829: xmlResetLastError();
11830: }
11831: }
11832: }
11833: }
11834: }
11835: function_tests++;
11836: #endif
11837:
11838: return(test_ret);
11839: }
11840:
11841:
11842: static int
11843: test_xmlNanoFTPQuit(void) {
11844: int test_ret = 0;
11845:
11846: #if defined(LIBXML_FTP_ENABLED)
11847: int mem_base;
11848: int ret_val;
11849: void * ctx; /* an FTP context */
11850: int n_ctx;
11851:
11852: for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11853: mem_base = xmlMemBlocks();
11854: ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11855:
11856: ret_val = xmlNanoFTPQuit(ctx);
11857: desret_int(ret_val);
11858: call_tests++;
11859: des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11860: xmlResetLastError();
11861: if (mem_base != xmlMemBlocks()) {
11862: printf("Leak of %d blocks found in xmlNanoFTPQuit",
11863: xmlMemBlocks() - mem_base);
11864: test_ret++;
11865: printf(" %d", n_ctx);
11866: printf("\n");
11867: }
11868: }
11869: function_tests++;
11870: #endif
11871:
11872: return(test_ret);
11873: }
11874:
11875:
11876: static int
11877: test_xmlNanoFTPRead(void) {
11878: int test_ret = 0;
11879:
11880: #if defined(LIBXML_FTP_ENABLED)
11881: int mem_base;
11882: int ret_val;
11883: void * ctx; /* the FTP context */
11884: int n_ctx;
11885: void * dest; /* a buffer */
11886: int n_dest;
11887: int len; /* the buffer length */
11888: int n_len;
11889:
11890: for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11891: for (n_dest = 0;n_dest < gen_nb_void_ptr;n_dest++) {
11892: for (n_len = 0;n_len < gen_nb_int;n_len++) {
11893: mem_base = xmlMemBlocks();
11894: ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11895: dest = gen_void_ptr(n_dest, 1);
11896: len = gen_int(n_len, 2);
11897:
11898: ret_val = xmlNanoFTPRead(ctx, dest, len);
11899: desret_int(ret_val);
11900: call_tests++;
11901: des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11902: des_void_ptr(n_dest, dest, 1);
11903: des_int(n_len, len, 2);
11904: xmlResetLastError();
11905: if (mem_base != xmlMemBlocks()) {
11906: printf("Leak of %d blocks found in xmlNanoFTPRead",
11907: xmlMemBlocks() - mem_base);
11908: test_ret++;
11909: printf(" %d", n_ctx);
11910: printf(" %d", n_dest);
11911: printf(" %d", n_len);
11912: printf("\n");
11913: }
11914: }
11915: }
11916: }
11917: function_tests++;
11918: #endif
11919:
11920: return(test_ret);
11921: }
11922:
11923:
11924: static int
11925: test_xmlNanoFTPScanProxy(void) {
11926: int test_ret = 0;
11927:
11928: #if defined(LIBXML_FTP_ENABLED)
11929: const char * URL; /* The proxy URL used to initialize the proxy context */
11930: int n_URL;
11931:
11932: for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
11933: URL = gen_filepath(n_URL, 0);
11934:
11935: xmlNanoFTPScanProxy(URL);
11936: call_tests++;
11937: des_filepath(n_URL, URL, 0);
11938: xmlResetLastError();
11939: }
11940: function_tests++;
11941: #endif
11942:
11943: return(test_ret);
11944: }
11945:
11946:
11947: static int
11948: test_xmlNanoFTPUpdateURL(void) {
11949: int test_ret = 0;
11950:
11951: #if defined(LIBXML_FTP_ENABLED)
11952: int mem_base;
11953: int ret_val;
11954: void * ctx; /* an FTP context */
11955: int n_ctx;
11956: const char * URL; /* The URL used to update the context */
11957: int n_URL;
11958:
11959: for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11960: for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
11961: mem_base = xmlMemBlocks();
11962: ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11963: URL = gen_filepath(n_URL, 1);
11964:
11965: ret_val = xmlNanoFTPUpdateURL(ctx, URL);
11966: desret_int(ret_val);
11967: call_tests++;
11968: des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11969: des_filepath(n_URL, URL, 1);
11970: xmlResetLastError();
11971: if (mem_base != xmlMemBlocks()) {
11972: printf("Leak of %d blocks found in xmlNanoFTPUpdateURL",
11973: xmlMemBlocks() - mem_base);
11974: test_ret++;
11975: printf(" %d", n_ctx);
11976: printf(" %d", n_URL);
11977: printf("\n");
11978: }
11979: }
11980: }
11981: function_tests++;
11982: #endif
11983:
11984: return(test_ret);
11985: }
11986:
11987: static int
11988: test_nanoftp(void) {
11989: int test_ret = 0;
11990:
11991: if (quiet == 0) printf("Testing nanoftp : 14 of 22 functions ...\n");
11992: test_ret += test_xmlNanoFTPCheckResponse();
11993: test_ret += test_xmlNanoFTPCleanup();
11994: test_ret += test_xmlNanoFTPCloseConnection();
11995: test_ret += test_xmlNanoFTPCwd();
11996: test_ret += test_xmlNanoFTPDele();
11997: test_ret += test_xmlNanoFTPGet();
11998: test_ret += test_xmlNanoFTPGetConnection();
11999: test_ret += test_xmlNanoFTPGetResponse();
12000: test_ret += test_xmlNanoFTPGetSocket();
12001: test_ret += test_xmlNanoFTPInit();
12002: test_ret += test_xmlNanoFTPList();
12003: test_ret += test_xmlNanoFTPNewCtxt();
12004: test_ret += test_xmlNanoFTPOpen();
12005: test_ret += test_xmlNanoFTPProxy();
12006: test_ret += test_xmlNanoFTPQuit();
12007: test_ret += test_xmlNanoFTPRead();
12008: test_ret += test_xmlNanoFTPScanProxy();
12009: test_ret += test_xmlNanoFTPUpdateURL();
12010:
12011: if (test_ret != 0)
12012: printf("Module nanoftp: %d errors\n", test_ret);
12013: return(test_ret);
12014: }
12015:
12016: static int
12017: test_xmlNanoHTTPAuthHeader(void) {
12018: int test_ret = 0;
12019:
12020: #if defined(LIBXML_HTTP_ENABLED)
12021: int mem_base;
12022: const char * ret_val;
12023: void * ctx; /* the HTTP context */
12024: int n_ctx;
12025:
12026: for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12027: mem_base = xmlMemBlocks();
12028: ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12029:
12030: ret_val = xmlNanoHTTPAuthHeader(ctx);
12031: desret_const_char_ptr(ret_val);
12032: call_tests++;
12033: des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12034: xmlResetLastError();
12035: if (mem_base != xmlMemBlocks()) {
12036: printf("Leak of %d blocks found in xmlNanoHTTPAuthHeader",
12037: xmlMemBlocks() - mem_base);
12038: test_ret++;
12039: printf(" %d", n_ctx);
12040: printf("\n");
12041: }
12042: }
12043: function_tests++;
12044: #endif
12045:
12046: return(test_ret);
12047: }
12048:
12049:
12050: static int
12051: test_xmlNanoHTTPCleanup(void) {
12052: int test_ret = 0;
12053:
12054: #if defined(LIBXML_HTTP_ENABLED)
12055: int mem_base;
12056:
12057: mem_base = xmlMemBlocks();
12058:
12059: xmlNanoHTTPCleanup();
12060: call_tests++;
12061: xmlResetLastError();
12062: if (mem_base != xmlMemBlocks()) {
12063: printf("Leak of %d blocks found in xmlNanoHTTPCleanup",
12064: xmlMemBlocks() - mem_base);
12065: test_ret++;
12066: printf("\n");
12067: }
12068: function_tests++;
12069: #endif
12070:
12071: return(test_ret);
12072: }
12073:
12074:
12075: static int
12076: test_xmlNanoHTTPContentLength(void) {
12077: int test_ret = 0;
12078:
12079: #if defined(LIBXML_HTTP_ENABLED)
12080: int mem_base;
12081: int ret_val;
12082: void * ctx; /* the HTTP context */
12083: int n_ctx;
12084:
12085: for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12086: mem_base = xmlMemBlocks();
12087: ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12088:
12089: ret_val = xmlNanoHTTPContentLength(ctx);
12090: desret_int(ret_val);
12091: call_tests++;
12092: des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12093: xmlResetLastError();
12094: if (mem_base != xmlMemBlocks()) {
12095: printf("Leak of %d blocks found in xmlNanoHTTPContentLength",
12096: xmlMemBlocks() - mem_base);
12097: test_ret++;
12098: printf(" %d", n_ctx);
12099: printf("\n");
12100: }
12101: }
12102: function_tests++;
12103: #endif
12104:
12105: return(test_ret);
12106: }
12107:
12108:
12109: static int
12110: test_xmlNanoHTTPEncoding(void) {
12111: int test_ret = 0;
12112:
12113: #if defined(LIBXML_HTTP_ENABLED)
12114: int mem_base;
12115: const char * ret_val;
12116: void * ctx; /* the HTTP context */
12117: int n_ctx;
12118:
12119: for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12120: mem_base = xmlMemBlocks();
12121: ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12122:
12123: ret_val = xmlNanoHTTPEncoding(ctx);
12124: desret_const_char_ptr(ret_val);
12125: call_tests++;
12126: des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12127: xmlResetLastError();
12128: if (mem_base != xmlMemBlocks()) {
12129: printf("Leak of %d blocks found in xmlNanoHTTPEncoding",
12130: xmlMemBlocks() - mem_base);
12131: test_ret++;
12132: printf(" %d", n_ctx);
12133: printf("\n");
12134: }
12135: }
12136: function_tests++;
12137: #endif
12138:
12139: return(test_ret);
12140: }
12141:
12142:
12143: #define gen_nb_char_ptr_ptr 1
12144: static char ** gen_char_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
12145: return(NULL);
12146: }
12147: static void des_char_ptr_ptr(int no ATTRIBUTE_UNUSED, char ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
12148: }
12149:
12150: static int
12151: test_xmlNanoHTTPFetch(void) {
12152: int test_ret = 0;
12153:
12154: #if defined(LIBXML_HTTP_ENABLED)
12155: int mem_base;
12156: int ret_val;
12157: const char * URL; /* The URL to load */
12158: int n_URL;
12159: const char * filename; /* the filename where the content should be saved */
12160: int n_filename;
12161: char ** contentType; /* if available the Content-Type information will be returned at that location */
12162: int n_contentType;
12163:
12164: for (n_URL = 0;n_URL < gen_nb_fileoutput;n_URL++) {
12165: for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
12166: for (n_contentType = 0;n_contentType < gen_nb_char_ptr_ptr;n_contentType++) {
12167: mem_base = xmlMemBlocks();
12168: URL = gen_fileoutput(n_URL, 0);
12169: filename = gen_fileoutput(n_filename, 1);
12170: contentType = gen_char_ptr_ptr(n_contentType, 2);
12171:
12172: ret_val = xmlNanoHTTPFetch(URL, filename, contentType);
12173: desret_int(ret_val);
12174: call_tests++;
12175: des_fileoutput(n_URL, URL, 0);
12176: des_fileoutput(n_filename, filename, 1);
12177: des_char_ptr_ptr(n_contentType, contentType, 2);
12178: xmlResetLastError();
12179: if (mem_base != xmlMemBlocks()) {
12180: printf("Leak of %d blocks found in xmlNanoHTTPFetch",
12181: xmlMemBlocks() - mem_base);
12182: test_ret++;
12183: printf(" %d", n_URL);
12184: printf(" %d", n_filename);
12185: printf(" %d", n_contentType);
12186: printf("\n");
12187: }
12188: }
12189: }
12190: }
12191: function_tests++;
12192: #endif
12193:
12194: return(test_ret);
12195: }
12196:
12197:
12198: static int
12199: test_xmlNanoHTTPInit(void) {
12200: int test_ret = 0;
12201:
12202: #if defined(LIBXML_HTTP_ENABLED)
12203: int mem_base;
12204:
12205: mem_base = xmlMemBlocks();
12206:
12207: xmlNanoHTTPInit();
12208: call_tests++;
12209: xmlResetLastError();
12210: if (mem_base != xmlMemBlocks()) {
12211: printf("Leak of %d blocks found in xmlNanoHTTPInit",
12212: xmlMemBlocks() - mem_base);
12213: test_ret++;
12214: printf("\n");
12215: }
12216: function_tests++;
12217: #endif
12218:
12219: return(test_ret);
12220: }
12221:
12222:
12223: static int
12224: test_xmlNanoHTTPMimeType(void) {
12225: int test_ret = 0;
12226:
12227: #if defined(LIBXML_HTTP_ENABLED)
12228: int mem_base;
12229: const char * ret_val;
12230: void * ctx; /* the HTTP context */
12231: int n_ctx;
12232:
12233: for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12234: mem_base = xmlMemBlocks();
12235: ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12236:
12237: ret_val = xmlNanoHTTPMimeType(ctx);
12238: desret_const_char_ptr(ret_val);
12239: call_tests++;
12240: des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12241: xmlResetLastError();
12242: if (mem_base != xmlMemBlocks()) {
12243: printf("Leak of %d blocks found in xmlNanoHTTPMimeType",
12244: xmlMemBlocks() - mem_base);
12245: test_ret++;
12246: printf(" %d", n_ctx);
12247: printf("\n");
12248: }
12249: }
12250: function_tests++;
12251: #endif
12252:
12253: return(test_ret);
12254: }
12255:
12256:
12257: static int
12258: test_xmlNanoHTTPOpen(void) {
12259: int test_ret = 0;
12260:
12261: #if defined(LIBXML_HTTP_ENABLED)
12262: int mem_base;
12263: void * ret_val;
12264: const char * URL; /* The URL to load */
12265: int n_URL;
12266: char ** contentType; /* if available the Content-Type information will be returned at that location */
12267: int n_contentType;
12268:
12269: for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12270: for (n_contentType = 0;n_contentType < gen_nb_char_ptr_ptr;n_contentType++) {
12271: mem_base = xmlMemBlocks();
12272: URL = gen_filepath(n_URL, 0);
12273: contentType = gen_char_ptr_ptr(n_contentType, 1);
12274:
12275: ret_val = xmlNanoHTTPOpen(URL, contentType);
12276: desret_xmlNanoHTTPCtxtPtr(ret_val);
12277: call_tests++;
12278: des_filepath(n_URL, URL, 0);
12279: des_char_ptr_ptr(n_contentType, contentType, 1);
12280: xmlResetLastError();
12281: if (mem_base != xmlMemBlocks()) {
12282: printf("Leak of %d blocks found in xmlNanoHTTPOpen",
12283: xmlMemBlocks() - mem_base);
12284: test_ret++;
12285: printf(" %d", n_URL);
12286: printf(" %d", n_contentType);
12287: printf("\n");
12288: }
12289: }
12290: }
12291: function_tests++;
12292: #endif
12293:
12294: return(test_ret);
12295: }
12296:
12297:
12298: static int
12299: test_xmlNanoHTTPOpenRedir(void) {
12300: int test_ret = 0;
12301:
12302: #if defined(LIBXML_HTTP_ENABLED)
12303: int mem_base;
12304: void * ret_val;
12305: const char * URL; /* The URL to load */
12306: int n_URL;
12307: char ** contentType; /* if available the Content-Type information will be returned at that location */
12308: int n_contentType;
12309: char ** redir; /* if available the redirected URL will be returned */
12310: int n_redir;
12311:
12312: for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12313: for (n_contentType = 0;n_contentType < gen_nb_char_ptr_ptr;n_contentType++) {
12314: for (n_redir = 0;n_redir < gen_nb_char_ptr_ptr;n_redir++) {
12315: mem_base = xmlMemBlocks();
12316: URL = gen_filepath(n_URL, 0);
12317: contentType = gen_char_ptr_ptr(n_contentType, 1);
12318: redir = gen_char_ptr_ptr(n_redir, 2);
12319:
12320: ret_val = xmlNanoHTTPOpenRedir(URL, contentType, redir);
12321: desret_xmlNanoHTTPCtxtPtr(ret_val);
12322: call_tests++;
12323: des_filepath(n_URL, URL, 0);
12324: des_char_ptr_ptr(n_contentType, contentType, 1);
12325: des_char_ptr_ptr(n_redir, redir, 2);
12326: xmlResetLastError();
12327: if (mem_base != xmlMemBlocks()) {
12328: printf("Leak of %d blocks found in xmlNanoHTTPOpenRedir",
12329: xmlMemBlocks() - mem_base);
12330: test_ret++;
12331: printf(" %d", n_URL);
12332: printf(" %d", n_contentType);
12333: printf(" %d", n_redir);
12334: printf("\n");
12335: }
12336: }
12337: }
12338: }
12339: function_tests++;
12340: #endif
12341:
12342: return(test_ret);
12343: }
12344:
12345:
12346: static int
12347: test_xmlNanoHTTPRead(void) {
12348: int test_ret = 0;
12349:
12350: #if defined(LIBXML_HTTP_ENABLED)
12351: int mem_base;
12352: int ret_val;
12353: void * ctx; /* the HTTP context */
12354: int n_ctx;
12355: void * dest; /* a buffer */
12356: int n_dest;
12357: int len; /* the buffer length */
12358: int n_len;
12359:
12360: for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12361: for (n_dest = 0;n_dest < gen_nb_void_ptr;n_dest++) {
12362: for (n_len = 0;n_len < gen_nb_int;n_len++) {
12363: mem_base = xmlMemBlocks();
12364: ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12365: dest = gen_void_ptr(n_dest, 1);
12366: len = gen_int(n_len, 2);
12367:
12368: ret_val = xmlNanoHTTPRead(ctx, dest, len);
12369: desret_int(ret_val);
12370: call_tests++;
12371: des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12372: des_void_ptr(n_dest, dest, 1);
12373: des_int(n_len, len, 2);
12374: xmlResetLastError();
12375: if (mem_base != xmlMemBlocks()) {
12376: printf("Leak of %d blocks found in xmlNanoHTTPRead",
12377: xmlMemBlocks() - mem_base);
12378: test_ret++;
12379: printf(" %d", n_ctx);
12380: printf(" %d", n_dest);
12381: printf(" %d", n_len);
12382: printf("\n");
12383: }
12384: }
12385: }
12386: }
12387: function_tests++;
12388: #endif
12389:
12390: return(test_ret);
12391: }
12392:
12393:
12394: static int
12395: test_xmlNanoHTTPRedir(void) {
12396: int test_ret = 0;
12397:
12398:
12399: /* missing type support */
12400: return(test_ret);
12401: }
12402:
12403:
12404: static int
12405: test_xmlNanoHTTPReturnCode(void) {
12406: int test_ret = 0;
12407:
12408: #if defined(LIBXML_HTTP_ENABLED)
12409: int mem_base;
12410: int ret_val;
12411: void * ctx; /* the HTTP context */
12412: int n_ctx;
12413:
12414: for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12415: mem_base = xmlMemBlocks();
12416: ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12417:
12418: ret_val = xmlNanoHTTPReturnCode(ctx);
12419: desret_int(ret_val);
12420: call_tests++;
12421: des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12422: xmlResetLastError();
12423: if (mem_base != xmlMemBlocks()) {
12424: printf("Leak of %d blocks found in xmlNanoHTTPReturnCode",
12425: xmlMemBlocks() - mem_base);
12426: test_ret++;
12427: printf(" %d", n_ctx);
12428: printf("\n");
12429: }
12430: }
12431: function_tests++;
12432: #endif
12433:
12434: return(test_ret);
12435: }
12436:
12437:
12438: static int
12439: test_xmlNanoHTTPSave(void) {
12440: int test_ret = 0;
12441:
12442: #if defined(LIBXML_HTTP_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
12443: int mem_base;
12444: int ret_val;
12445: void * ctxt; /* the HTTP context */
12446: int n_ctxt;
12447: const char * filename; /* the filename where the content should be saved */
12448: int n_filename;
12449:
12450: for (n_ctxt = 0;n_ctxt < gen_nb_void_ptr;n_ctxt++) {
12451: for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
12452: mem_base = xmlMemBlocks();
12453: ctxt = gen_void_ptr(n_ctxt, 0);
12454: filename = gen_fileoutput(n_filename, 1);
12455:
12456: ret_val = xmlNanoHTTPSave(ctxt, filename);
12457: desret_int(ret_val);
12458: call_tests++;
12459: des_void_ptr(n_ctxt, ctxt, 0);
12460: des_fileoutput(n_filename, filename, 1);
12461: xmlResetLastError();
12462: if (mem_base != xmlMemBlocks()) {
12463: printf("Leak of %d blocks found in xmlNanoHTTPSave",
12464: xmlMemBlocks() - mem_base);
12465: test_ret++;
12466: printf(" %d", n_ctxt);
12467: printf(" %d", n_filename);
12468: printf("\n");
12469: }
12470: }
12471: }
12472: function_tests++;
12473: #endif
12474:
12475: return(test_ret);
12476: }
12477:
12478:
12479: static int
12480: test_xmlNanoHTTPScanProxy(void) {
12481: int test_ret = 0;
12482:
12483: #if defined(LIBXML_HTTP_ENABLED)
12484: const char * URL; /* The proxy URL used to initialize the proxy context */
12485: int n_URL;
12486:
12487: for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12488: URL = gen_filepath(n_URL, 0);
12489:
12490: xmlNanoHTTPScanProxy(URL);
12491: call_tests++;
12492: des_filepath(n_URL, URL, 0);
12493: xmlResetLastError();
12494: }
12495: function_tests++;
12496: #endif
12497:
12498: return(test_ret);
12499: }
12500:
12501: static int
12502: test_nanohttp(void) {
12503: int test_ret = 0;
12504:
12505: if (quiet == 0) printf("Testing nanohttp : 13 of 17 functions ...\n");
12506: test_ret += test_xmlNanoHTTPAuthHeader();
12507: test_ret += test_xmlNanoHTTPCleanup();
12508: test_ret += test_xmlNanoHTTPContentLength();
12509: test_ret += test_xmlNanoHTTPEncoding();
12510: test_ret += test_xmlNanoHTTPFetch();
12511: test_ret += test_xmlNanoHTTPInit();
12512: test_ret += test_xmlNanoHTTPMimeType();
12513: test_ret += test_xmlNanoHTTPOpen();
12514: test_ret += test_xmlNanoHTTPOpenRedir();
12515: test_ret += test_xmlNanoHTTPRead();
12516: test_ret += test_xmlNanoHTTPRedir();
12517: test_ret += test_xmlNanoHTTPReturnCode();
12518: test_ret += test_xmlNanoHTTPSave();
12519: test_ret += test_xmlNanoHTTPScanProxy();
12520:
12521: if (test_ret != 0)
12522: printf("Module nanohttp: %d errors\n", test_ret);
12523: return(test_ret);
12524: }
12525:
12526: static int
12527: test_xmlByteConsumed(void) {
12528: int test_ret = 0;
12529:
12530: int mem_base;
12531: long ret_val;
12532: xmlParserCtxtPtr ctxt; /* an XML parser context */
12533: int n_ctxt;
12534:
12535: for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12536: mem_base = xmlMemBlocks();
12537: ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12538:
12539: ret_val = xmlByteConsumed(ctxt);
12540: desret_long(ret_val);
12541: call_tests++;
12542: des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12543: xmlResetLastError();
12544: if (mem_base != xmlMemBlocks()) {
12545: printf("Leak of %d blocks found in xmlByteConsumed",
12546: xmlMemBlocks() - mem_base);
12547: test_ret++;
12548: printf(" %d", n_ctxt);
12549: printf("\n");
12550: }
12551: }
12552: function_tests++;
12553:
12554: return(test_ret);
12555: }
12556:
12557:
12558: static int
12559: test_xmlClearNodeInfoSeq(void) {
12560: int test_ret = 0;
12561:
12562: int mem_base;
12563: xmlParserNodeInfoSeqPtr seq; /* a node info sequence pointer */
12564: int n_seq;
12565:
12566: for (n_seq = 0;n_seq < gen_nb_xmlParserNodeInfoSeqPtr;n_seq++) {
12567: mem_base = xmlMemBlocks();
12568: seq = gen_xmlParserNodeInfoSeqPtr(n_seq, 0);
12569:
12570: xmlClearNodeInfoSeq(seq);
12571: call_tests++;
12572: des_xmlParserNodeInfoSeqPtr(n_seq, seq, 0);
12573: xmlResetLastError();
12574: if (mem_base != xmlMemBlocks()) {
12575: printf("Leak of %d blocks found in xmlClearNodeInfoSeq",
12576: xmlMemBlocks() - mem_base);
12577: test_ret++;
12578: printf(" %d", n_seq);
12579: printf("\n");
12580: }
12581: }
12582: function_tests++;
12583:
12584: return(test_ret);
12585: }
12586:
12587:
12588: static int
12589: test_xmlClearParserCtxt(void) {
12590: int test_ret = 0;
12591:
12592: int mem_base;
12593: xmlParserCtxtPtr ctxt; /* an XML parser context */
12594: int n_ctxt;
12595:
12596: for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12597: mem_base = xmlMemBlocks();
12598: ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12599:
12600: xmlClearParserCtxt(ctxt);
12601: call_tests++;
12602: des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12603: xmlResetLastError();
12604: if (mem_base != xmlMemBlocks()) {
12605: printf("Leak of %d blocks found in xmlClearParserCtxt",
12606: xmlMemBlocks() - mem_base);
12607: test_ret++;
12608: printf(" %d", n_ctxt);
12609: printf("\n");
12610: }
12611: }
12612: function_tests++;
12613:
12614: return(test_ret);
12615: }
12616:
12617:
12618: static int
12619: test_xmlCreateDocParserCtxt(void) {
12620: int test_ret = 0;
12621:
12622: int mem_base;
12623: xmlParserCtxtPtr ret_val;
12624: xmlChar * cur; /* a pointer to an array of xmlChar */
12625: int n_cur;
12626:
12627: for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
12628: mem_base = xmlMemBlocks();
12629: cur = gen_const_xmlChar_ptr(n_cur, 0);
12630:
12631: ret_val = xmlCreateDocParserCtxt((const xmlChar *)cur);
12632: desret_xmlParserCtxtPtr(ret_val);
12633: call_tests++;
12634: des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
12635: xmlResetLastError();
12636: if (mem_base != xmlMemBlocks()) {
12637: printf("Leak of %d blocks found in xmlCreateDocParserCtxt",
12638: xmlMemBlocks() - mem_base);
12639: test_ret++;
12640: printf(" %d", n_cur);
12641: printf("\n");
12642: }
12643: }
12644: function_tests++;
12645:
12646: return(test_ret);
12647: }
12648:
12649:
12650: static int
12651: test_xmlCreatePushParserCtxt(void) {
12652: int test_ret = 0;
12653:
12654: #if defined(LIBXML_PUSH_ENABLED)
12655: int mem_base;
12656: xmlParserCtxtPtr ret_val;
12657: xmlSAXHandlerPtr sax; /* a SAX handler */
12658: int n_sax;
12659: void * user_data; /* The user data returned on SAX callbacks */
12660: int n_user_data;
12661: char * chunk; /* a pointer to an array of chars */
12662: int n_chunk;
12663: int size; /* number of chars in the array */
12664: int n_size;
12665: const char * filename; /* an optional file name or URI */
12666: int n_filename;
12667:
12668: for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
12669: for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
12670: for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
12671: for (n_size = 0;n_size < gen_nb_int;n_size++) {
12672: for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
12673: mem_base = xmlMemBlocks();
12674: sax = gen_xmlSAXHandlerPtr(n_sax, 0);
12675: user_data = gen_userdata(n_user_data, 1);
12676: chunk = gen_const_char_ptr(n_chunk, 2);
12677: size = gen_int(n_size, 3);
12678: filename = gen_fileoutput(n_filename, 4);
12679:
12680: ret_val = xmlCreatePushParserCtxt(sax, user_data, (const char *)chunk, size, filename);
12681: desret_xmlParserCtxtPtr(ret_val);
12682: call_tests++;
12683: des_xmlSAXHandlerPtr(n_sax, sax, 0);
12684: des_userdata(n_user_data, user_data, 1);
12685: des_const_char_ptr(n_chunk, (const char *)chunk, 2);
12686: des_int(n_size, size, 3);
12687: des_fileoutput(n_filename, filename, 4);
12688: xmlResetLastError();
12689: if (mem_base != xmlMemBlocks()) {
12690: printf("Leak of %d blocks found in xmlCreatePushParserCtxt",
12691: xmlMemBlocks() - mem_base);
12692: test_ret++;
12693: printf(" %d", n_sax);
12694: printf(" %d", n_user_data);
12695: printf(" %d", n_chunk);
12696: printf(" %d", n_size);
12697: printf(" %d", n_filename);
12698: printf("\n");
12699: }
12700: }
12701: }
12702: }
12703: }
12704: }
12705: function_tests++;
12706: #endif
12707:
12708: return(test_ret);
12709: }
12710:
12711:
12712: static int
12713: test_xmlCtxtReadDoc(void) {
12714: int test_ret = 0;
12715:
12716: int mem_base;
12717: xmlDocPtr ret_val;
12718: xmlParserCtxtPtr ctxt; /* an XML parser context */
12719: int n_ctxt;
12720: xmlChar * cur; /* a pointer to a zero terminated string */
12721: int n_cur;
12722: const char * URL; /* the base URL to use for the document */
12723: int n_URL;
12724: char * encoding; /* the document encoding, or NULL */
12725: int n_encoding;
12726: int options; /* a combination of xmlParserOption */
12727: int n_options;
12728:
12729: for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12730: for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
12731: for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12732: for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
12733: for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
12734: mem_base = xmlMemBlocks();
12735: ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12736: cur = gen_const_xmlChar_ptr(n_cur, 1);
12737: URL = gen_filepath(n_URL, 2);
12738: encoding = gen_const_char_ptr(n_encoding, 3);
12739: options = gen_parseroptions(n_options, 4);
12740:
12741: ret_val = xmlCtxtReadDoc(ctxt, (const xmlChar *)cur, URL, (const char *)encoding, options);
12742: desret_xmlDocPtr(ret_val);
12743: call_tests++;
12744: des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12745: des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1);
12746: des_filepath(n_URL, URL, 2);
12747: des_const_char_ptr(n_encoding, (const char *)encoding, 3);
12748: des_parseroptions(n_options, options, 4);
12749: xmlResetLastError();
12750: if (mem_base != xmlMemBlocks()) {
12751: printf("Leak of %d blocks found in xmlCtxtReadDoc",
12752: xmlMemBlocks() - mem_base);
12753: test_ret++;
12754: printf(" %d", n_ctxt);
12755: printf(" %d", n_cur);
12756: printf(" %d", n_URL);
12757: printf(" %d", n_encoding);
12758: printf(" %d", n_options);
12759: printf("\n");
12760: }
12761: }
12762: }
12763: }
12764: }
12765: }
12766: function_tests++;
12767:
12768: return(test_ret);
12769: }
12770:
12771:
12772: static int
12773: test_xmlCtxtReadFile(void) {
12774: int test_ret = 0;
12775:
12776: int mem_base;
12777: xmlDocPtr ret_val;
12778: xmlParserCtxtPtr ctxt; /* an XML parser context */
12779: int n_ctxt;
12780: const char * filename; /* a file or URL */
12781: int n_filename;
12782: char * encoding; /* the document encoding, or NULL */
12783: int n_encoding;
12784: int options; /* a combination of xmlParserOption */
12785: int n_options;
12786:
12787: for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12788: for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
12789: for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
12790: for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
12791: mem_base = xmlMemBlocks();
12792: ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12793: filename = gen_filepath(n_filename, 1);
12794: encoding = gen_const_char_ptr(n_encoding, 2);
12795: options = gen_parseroptions(n_options, 3);
12796:
12797: ret_val = xmlCtxtReadFile(ctxt, filename, (const char *)encoding, options);
12798: desret_xmlDocPtr(ret_val);
12799: call_tests++;
12800: des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12801: des_filepath(n_filename, filename, 1);
12802: des_const_char_ptr(n_encoding, (const char *)encoding, 2);
12803: des_parseroptions(n_options, options, 3);
12804: xmlResetLastError();
12805: if (mem_base != xmlMemBlocks()) {
12806: printf("Leak of %d blocks found in xmlCtxtReadFile",
12807: xmlMemBlocks() - mem_base);
12808: test_ret++;
12809: printf(" %d", n_ctxt);
12810: printf(" %d", n_filename);
12811: printf(" %d", n_encoding);
12812: printf(" %d", n_options);
12813: printf("\n");
12814: }
12815: }
12816: }
12817: }
12818: }
12819: function_tests++;
12820:
12821: return(test_ret);
12822: }
12823:
12824:
12825: static int
12826: test_xmlCtxtReadMemory(void) {
12827: int test_ret = 0;
12828:
12829: int mem_base;
12830: xmlDocPtr ret_val;
12831: xmlParserCtxtPtr ctxt; /* an XML parser context */
12832: int n_ctxt;
12833: char * buffer; /* a pointer to a char array */
12834: int n_buffer;
12835: int size; /* the size of the array */
12836: int n_size;
12837: const char * URL; /* the base URL to use for the document */
12838: int n_URL;
12839: char * encoding; /* the document encoding, or NULL */
12840: int n_encoding;
12841: int options; /* a combination of xmlParserOption */
12842: int n_options;
12843:
12844: for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12845: for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
12846: for (n_size = 0;n_size < gen_nb_int;n_size++) {
12847: for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12848: for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
12849: for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
12850: mem_base = xmlMemBlocks();
12851: ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12852: buffer = gen_const_char_ptr(n_buffer, 1);
12853: size = gen_int(n_size, 2);
12854: URL = gen_filepath(n_URL, 3);
12855: encoding = gen_const_char_ptr(n_encoding, 4);
12856: options = gen_parseroptions(n_options, 5);
12857:
12858: ret_val = xmlCtxtReadMemory(ctxt, (const char *)buffer, size, URL, (const char *)encoding, options);
12859: desret_xmlDocPtr(ret_val);
12860: call_tests++;
12861: des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12862: des_const_char_ptr(n_buffer, (const char *)buffer, 1);
12863: des_int(n_size, size, 2);
12864: des_filepath(n_URL, URL, 3);
12865: des_const_char_ptr(n_encoding, (const char *)encoding, 4);
12866: des_parseroptions(n_options, options, 5);
12867: xmlResetLastError();
12868: if (mem_base != xmlMemBlocks()) {
12869: printf("Leak of %d blocks found in xmlCtxtReadMemory",
12870: xmlMemBlocks() - mem_base);
12871: test_ret++;
12872: printf(" %d", n_ctxt);
12873: printf(" %d", n_buffer);
12874: printf(" %d", n_size);
12875: printf(" %d", n_URL);
12876: printf(" %d", n_encoding);
12877: printf(" %d", n_options);
12878: printf("\n");
12879: }
12880: }
12881: }
12882: }
12883: }
12884: }
12885: }
12886: function_tests++;
12887:
12888: return(test_ret);
12889: }
12890:
12891:
12892: static int
12893: test_xmlCtxtReset(void) {
12894: int test_ret = 0;
12895:
12896: int mem_base;
12897: xmlParserCtxtPtr ctxt; /* an XML parser context */
12898: int n_ctxt;
12899:
12900: for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12901: mem_base = xmlMemBlocks();
12902: ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12903:
12904: xmlCtxtReset(ctxt);
12905: call_tests++;
12906: des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12907: xmlResetLastError();
12908: if (mem_base != xmlMemBlocks()) {
12909: printf("Leak of %d blocks found in xmlCtxtReset",
12910: xmlMemBlocks() - mem_base);
12911: test_ret++;
12912: printf(" %d", n_ctxt);
12913: printf("\n");
12914: }
12915: }
12916: function_tests++;
12917:
12918: return(test_ret);
12919: }
12920:
12921:
12922: static int
12923: test_xmlCtxtResetPush(void) {
12924: int test_ret = 0;
12925:
12926: int mem_base;
12927: int ret_val;
12928: xmlParserCtxtPtr ctxt; /* an XML parser context */
12929: int n_ctxt;
12930: char * chunk; /* a pointer to an array of chars */
12931: int n_chunk;
12932: int size; /* number of chars in the array */
12933: int n_size;
12934: const char * filename; /* an optional file name or URI */
12935: int n_filename;
12936: char * encoding; /* the document encoding, or NULL */
12937: int n_encoding;
12938:
12939: for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12940: for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
12941: for (n_size = 0;n_size < gen_nb_int;n_size++) {
12942: for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
12943: for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
12944: mem_base = xmlMemBlocks();
12945: ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12946: chunk = gen_const_char_ptr(n_chunk, 1);
12947: size = gen_int(n_size, 2);
12948: filename = gen_filepath(n_filename, 3);
12949: encoding = gen_const_char_ptr(n_encoding, 4);
12950:
12951: ret_val = xmlCtxtResetPush(ctxt, (const char *)chunk, size, filename, (const char *)encoding);
12952: desret_int(ret_val);
12953: call_tests++;
12954: des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12955: des_const_char_ptr(n_chunk, (const char *)chunk, 1);
12956: des_int(n_size, size, 2);
12957: des_filepath(n_filename, filename, 3);
12958: des_const_char_ptr(n_encoding, (const char *)encoding, 4);
12959: xmlResetLastError();
12960: if (mem_base != xmlMemBlocks()) {
12961: printf("Leak of %d blocks found in xmlCtxtResetPush",
12962: xmlMemBlocks() - mem_base);
12963: test_ret++;
12964: printf(" %d", n_ctxt);
12965: printf(" %d", n_chunk);
12966: printf(" %d", n_size);
12967: printf(" %d", n_filename);
12968: printf(" %d", n_encoding);
12969: printf("\n");
12970: }
12971: }
12972: }
12973: }
12974: }
12975: }
12976: function_tests++;
12977:
12978: return(test_ret);
12979: }
12980:
12981:
12982: static int
12983: test_xmlCtxtUseOptions(void) {
12984: int test_ret = 0;
12985:
12986: int mem_base;
12987: int ret_val;
12988: xmlParserCtxtPtr ctxt; /* an XML parser context */
12989: int n_ctxt;
12990: int options; /* a combination of xmlParserOption */
12991: int n_options;
12992:
12993: for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12994: for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
12995: mem_base = xmlMemBlocks();
12996: ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12997: options = gen_parseroptions(n_options, 1);
12998:
12999: ret_val = xmlCtxtUseOptions(ctxt, options);
13000: desret_int(ret_val);
13001: call_tests++;
13002: des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13003: des_parseroptions(n_options, options, 1);
13004: xmlResetLastError();
13005: if (mem_base != xmlMemBlocks()) {
13006: printf("Leak of %d blocks found in xmlCtxtUseOptions",
13007: xmlMemBlocks() - mem_base);
13008: test_ret++;
13009: printf(" %d", n_ctxt);
13010: printf(" %d", n_options);
13011: printf("\n");
13012: }
13013: }
13014: }
13015: function_tests++;
13016:
13017: return(test_ret);
13018: }
13019:
13020:
13021: static int
13022: test_xmlGetExternalEntityLoader(void) {
13023: int test_ret = 0;
13024:
13025:
13026: /* missing type support */
13027: return(test_ret);
13028: }
13029:
13030:
13031: static int
13032: test_xmlGetFeature(void) {
13033: int test_ret = 0;
13034:
13035: #if defined(LIBXML_LEGACY_ENABLED)
13036: #ifdef LIBXML_LEGACY_ENABLED
13037: int mem_base;
13038: int ret_val;
13039: xmlParserCtxtPtr ctxt; /* an XML/HTML parser context */
13040: int n_ctxt;
13041: char * name; /* the feature name */
13042: int n_name;
13043: void * result; /* location to store the result */
13044: int n_result;
13045:
13046: for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13047: for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
13048: for (n_result = 0;n_result < gen_nb_void_ptr;n_result++) {
13049: mem_base = xmlMemBlocks();
13050: ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13051: name = gen_const_char_ptr(n_name, 1);
13052: result = gen_void_ptr(n_result, 2);
13053:
13054: ret_val = xmlGetFeature(ctxt, (const char *)name, result);
13055: desret_int(ret_val);
13056: call_tests++;
13057: des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13058: des_const_char_ptr(n_name, (const char *)name, 1);
13059: des_void_ptr(n_result, result, 2);
13060: xmlResetLastError();
13061: if (mem_base != xmlMemBlocks()) {
13062: printf("Leak of %d blocks found in xmlGetFeature",
13063: xmlMemBlocks() - mem_base);
13064: test_ret++;
13065: printf(" %d", n_ctxt);
13066: printf(" %d", n_name);
13067: printf(" %d", n_result);
13068: printf("\n");
13069: }
13070: }
13071: }
13072: }
13073: function_tests++;
13074: #endif
13075: #endif
13076:
13077: return(test_ret);
13078: }
13079:
13080:
13081: #define gen_nb_const_char_ptr_ptr 1
13082: static char ** gen_const_char_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
13083: return(NULL);
13084: }
13085: static void des_const_char_ptr_ptr(int no ATTRIBUTE_UNUSED, const char ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
13086: }
13087:
13088: static int
13089: test_xmlGetFeaturesList(void) {
13090: int test_ret = 0;
13091:
13092: #if defined(LIBXML_LEGACY_ENABLED)
13093: #ifdef LIBXML_LEGACY_ENABLED
13094: int mem_base;
13095: int ret_val;
13096: int * len; /* the length of the features name array (input/output) */
13097: int n_len;
13098: char ** result; /* an array of string to be filled with the features name. */
13099: int n_result;
13100:
13101: for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
13102: for (n_result = 0;n_result < gen_nb_const_char_ptr_ptr;n_result++) {
13103: mem_base = xmlMemBlocks();
13104: len = gen_int_ptr(n_len, 0);
13105: result = gen_const_char_ptr_ptr(n_result, 1);
13106:
13107: ret_val = xmlGetFeaturesList(len, (const char **)result);
13108: desret_int(ret_val);
13109: call_tests++;
13110: des_int_ptr(n_len, len, 0);
13111: des_const_char_ptr_ptr(n_result, (const char **)result, 1);
13112: xmlResetLastError();
13113: if (mem_base != xmlMemBlocks()) {
13114: printf("Leak of %d blocks found in xmlGetFeaturesList",
13115: xmlMemBlocks() - mem_base);
13116: test_ret++;
13117: printf(" %d", n_len);
13118: printf(" %d", n_result);
13119: printf("\n");
13120: }
13121: }
13122: }
13123: function_tests++;
13124: #endif
13125: #endif
13126:
13127: return(test_ret);
13128: }
13129:
13130:
13131: static int
13132: test_xmlHasFeature(void) {
13133: int test_ret = 0;
13134:
13135: int mem_base;
13136: int ret_val;
13137: xmlFeature feature; /* the feature to be examined */
13138: int n_feature;
13139:
13140: for (n_feature = 0;n_feature < gen_nb_xmlFeature;n_feature++) {
13141: mem_base = xmlMemBlocks();
13142: feature = gen_xmlFeature(n_feature, 0);
13143:
13144: ret_val = xmlHasFeature(feature);
13145: desret_int(ret_val);
13146: call_tests++;
13147: des_xmlFeature(n_feature, feature, 0);
13148: xmlResetLastError();
13149: if (mem_base != xmlMemBlocks()) {
13150: printf("Leak of %d blocks found in xmlHasFeature",
13151: xmlMemBlocks() - mem_base);
13152: test_ret++;
13153: printf(" %d", n_feature);
13154: printf("\n");
13155: }
13156: }
13157: function_tests++;
13158:
13159: return(test_ret);
13160: }
13161:
13162:
13163: static int
13164: test_xmlIOParseDTD(void) {
13165: int test_ret = 0;
13166:
13167: #if defined(LIBXML_VALID_ENABLED)
13168: #ifdef LIBXML_VALID_ENABLED
13169: xmlDtdPtr ret_val;
13170: xmlSAXHandlerPtr sax; /* the SAX handler block or NULL */
13171: int n_sax;
13172: xmlParserInputBufferPtr input; /* an Input Buffer */
13173: int n_input;
13174: xmlCharEncoding enc; /* the charset encoding if known */
13175: int n_enc;
13176:
13177: for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
13178: for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
13179: for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
13180: sax = gen_xmlSAXHandlerPtr(n_sax, 0);
13181: input = gen_xmlParserInputBufferPtr(n_input, 1);
13182: enc = gen_xmlCharEncoding(n_enc, 2);
13183:
13184: ret_val = xmlIOParseDTD(sax, input, enc);
13185: input = NULL;
13186: desret_xmlDtdPtr(ret_val);
13187: call_tests++;
13188: des_xmlSAXHandlerPtr(n_sax, sax, 0);
13189: des_xmlParserInputBufferPtr(n_input, input, 1);
13190: des_xmlCharEncoding(n_enc, enc, 2);
13191: xmlResetLastError();
13192: }
13193: }
13194: }
13195: function_tests++;
13196: #endif
13197: #endif
13198:
13199: return(test_ret);
13200: }
13201:
13202:
13203: static int
13204: test_xmlInitNodeInfoSeq(void) {
13205: int test_ret = 0;
13206:
13207: int mem_base;
13208: xmlParserNodeInfoSeqPtr seq; /* a node info sequence pointer */
13209: int n_seq;
13210:
13211: for (n_seq = 0;n_seq < gen_nb_xmlParserNodeInfoSeqPtr;n_seq++) {
13212: mem_base = xmlMemBlocks();
13213: seq = gen_xmlParserNodeInfoSeqPtr(n_seq, 0);
13214:
13215: xmlInitNodeInfoSeq(seq);
13216: call_tests++;
13217: des_xmlParserNodeInfoSeqPtr(n_seq, seq, 0);
13218: xmlResetLastError();
13219: if (mem_base != xmlMemBlocks()) {
13220: printf("Leak of %d blocks found in xmlInitNodeInfoSeq",
13221: xmlMemBlocks() - mem_base);
13222: test_ret++;
13223: printf(" %d", n_seq);
13224: printf("\n");
13225: }
13226: }
13227: function_tests++;
13228:
13229: return(test_ret);
13230: }
13231:
13232:
13233: static int
13234: test_xmlInitParser(void) {
13235: int test_ret = 0;
13236:
13237: int mem_base;
13238:
13239: mem_base = xmlMemBlocks();
13240:
13241: xmlInitParser();
13242: call_tests++;
13243: xmlResetLastError();
13244: if (mem_base != xmlMemBlocks()) {
13245: printf("Leak of %d blocks found in xmlInitParser",
13246: xmlMemBlocks() - mem_base);
13247: test_ret++;
13248: printf("\n");
13249: }
13250: function_tests++;
13251:
13252: return(test_ret);
13253: }
13254:
13255:
13256: static int
13257: test_xmlInitParserCtxt(void) {
13258: int test_ret = 0;
13259:
13260: int mem_base;
13261: int ret_val;
13262: xmlParserCtxtPtr ctxt; /* an XML parser context */
13263: int n_ctxt;
13264:
13265: for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13266: mem_base = xmlMemBlocks();
13267: ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13268:
13269: ret_val = xmlInitParserCtxt(ctxt);
13270: desret_int(ret_val);
13271: call_tests++;
13272: des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13273: xmlResetLastError();
13274: if (mem_base != xmlMemBlocks()) {
13275: printf("Leak of %d blocks found in xmlInitParserCtxt",
13276: xmlMemBlocks() - mem_base);
13277: test_ret++;
13278: printf(" %d", n_ctxt);
13279: printf("\n");
13280: }
13281: }
13282: function_tests++;
13283:
13284: return(test_ret);
13285: }
13286:
13287:
13288: static int
13289: test_xmlKeepBlanksDefault(void) {
13290: int test_ret = 0;
13291:
13292: int mem_base;
13293: int ret_val;
13294: int val; /* int 0 or 1 */
13295: int n_val;
13296:
13297: for (n_val = 0;n_val < gen_nb_int;n_val++) {
13298: mem_base = xmlMemBlocks();
13299: val = gen_int(n_val, 0);
13300:
13301: ret_val = xmlKeepBlanksDefault(val);
13302: desret_int(ret_val);
13303: call_tests++;
13304: des_int(n_val, val, 0);
13305: xmlResetLastError();
13306: if (mem_base != xmlMemBlocks()) {
13307: printf("Leak of %d blocks found in xmlKeepBlanksDefault",
13308: xmlMemBlocks() - mem_base);
13309: test_ret++;
13310: printf(" %d", n_val);
13311: printf("\n");
13312: }
13313: }
13314: function_tests++;
13315:
13316: return(test_ret);
13317: }
13318:
13319:
13320: static int
13321: test_xmlLineNumbersDefault(void) {
13322: int test_ret = 0;
13323:
13324: int mem_base;
13325: int ret_val;
13326: int val; /* int 0 or 1 */
13327: int n_val;
13328:
13329: for (n_val = 0;n_val < gen_nb_int;n_val++) {
13330: mem_base = xmlMemBlocks();
13331: val = gen_int(n_val, 0);
13332:
13333: ret_val = xmlLineNumbersDefault(val);
13334: desret_int(ret_val);
13335: call_tests++;
13336: des_int(n_val, val, 0);
13337: xmlResetLastError();
13338: if (mem_base != xmlMemBlocks()) {
13339: printf("Leak of %d blocks found in xmlLineNumbersDefault",
13340: xmlMemBlocks() - mem_base);
13341: test_ret++;
13342: printf(" %d", n_val);
13343: printf("\n");
13344: }
13345: }
13346: function_tests++;
13347:
13348: return(test_ret);
13349: }
13350:
13351:
13352: static int
13353: test_xmlLoadExternalEntity(void) {
13354: int test_ret = 0;
13355:
13356: int mem_base;
13357: xmlParserInputPtr ret_val;
13358: const char * URL; /* the URL for the entity to load */
13359: int n_URL;
13360: char * ID; /* the Public ID for the entity to load */
13361: int n_ID;
13362: xmlParserCtxtPtr ctxt; /* the context in which the entity is called or NULL */
13363: int n_ctxt;
13364:
13365: for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
13366: for (n_ID = 0;n_ID < gen_nb_const_char_ptr;n_ID++) {
13367: for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13368: mem_base = xmlMemBlocks();
13369: URL = gen_filepath(n_URL, 0);
13370: ID = gen_const_char_ptr(n_ID, 1);
13371: ctxt = gen_xmlParserCtxtPtr(n_ctxt, 2);
13372:
13373: ret_val = xmlLoadExternalEntity(URL, (const char *)ID, ctxt);
13374: desret_xmlParserInputPtr(ret_val);
13375: call_tests++;
13376: des_filepath(n_URL, URL, 0);
13377: des_const_char_ptr(n_ID, (const char *)ID, 1);
13378: des_xmlParserCtxtPtr(n_ctxt, ctxt, 2);
13379: xmlResetLastError();
13380: if (mem_base != xmlMemBlocks()) {
13381: printf("Leak of %d blocks found in xmlLoadExternalEntity",
13382: xmlMemBlocks() - mem_base);
13383: test_ret++;
13384: printf(" %d", n_URL);
13385: printf(" %d", n_ID);
13386: printf(" %d", n_ctxt);
13387: printf("\n");
13388: }
13389: }
13390: }
13391: }
13392: function_tests++;
13393:
13394: return(test_ret);
13395: }
13396:
13397:
13398: static int
13399: test_xmlNewIOInputStream(void) {
13400: int test_ret = 0;
13401:
13402: int mem_base;
13403: xmlParserInputPtr ret_val;
13404: xmlParserCtxtPtr ctxt; /* an XML parser context */
13405: int n_ctxt;
13406: xmlParserInputBufferPtr input; /* an I/O Input */
13407: int n_input;
13408: xmlCharEncoding enc; /* the charset encoding if known */
13409: int n_enc;
13410:
13411: for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13412: for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
13413: for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
13414: mem_base = xmlMemBlocks();
13415: ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13416: input = gen_xmlParserInputBufferPtr(n_input, 1);
13417: enc = gen_xmlCharEncoding(n_enc, 2);
13418:
13419: ret_val = xmlNewIOInputStream(ctxt, input, enc);
13420: if (ret_val != NULL) input = NULL;
13421: desret_xmlParserInputPtr(ret_val);
13422: call_tests++;
13423: des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13424: des_xmlParserInputBufferPtr(n_input, input, 1);
13425: des_xmlCharEncoding(n_enc, enc, 2);
13426: xmlResetLastError();
13427: if (mem_base != xmlMemBlocks()) {
13428: printf("Leak of %d blocks found in xmlNewIOInputStream",
13429: xmlMemBlocks() - mem_base);
13430: test_ret++;
13431: printf(" %d", n_ctxt);
13432: printf(" %d", n_input);
13433: printf(" %d", n_enc);
13434: printf("\n");
13435: }
13436: }
13437: }
13438: }
13439: function_tests++;
13440:
13441: return(test_ret);
13442: }
13443:
13444:
13445: static int
13446: test_xmlNewParserCtxt(void) {
13447: int test_ret = 0;
13448:
13449: int mem_base;
13450: xmlParserCtxtPtr ret_val;
13451:
13452: mem_base = xmlMemBlocks();
13453:
13454: ret_val = xmlNewParserCtxt();
13455: desret_xmlParserCtxtPtr(ret_val);
13456: call_tests++;
13457: xmlResetLastError();
13458: if (mem_base != xmlMemBlocks()) {
13459: printf("Leak of %d blocks found in xmlNewParserCtxt",
13460: xmlMemBlocks() - mem_base);
13461: test_ret++;
13462: printf("\n");
13463: }
13464: function_tests++;
13465:
13466: return(test_ret);
13467: }
13468:
13469:
13470: #define gen_nb_xmlNodePtr_ptr 1
13471: static xmlNodePtr * gen_xmlNodePtr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
13472: return(NULL);
13473: }
13474: static void des_xmlNodePtr_ptr(int no ATTRIBUTE_UNUSED, xmlNodePtr * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
13475: }
13476:
13477: static int
13478: test_xmlParseBalancedChunkMemory(void) {
13479: int test_ret = 0;
13480:
13481: #if defined(LIBXML_SAX1_ENABLED)
13482: #ifdef LIBXML_SAX1_ENABLED
13483: int mem_base;
13484: int ret_val;
13485: xmlDocPtr doc; /* the document the chunk pertains to */
13486: int n_doc;
13487: xmlSAXHandlerPtr sax; /* the SAX handler bloc (possibly NULL) */
13488: int n_sax;
13489: void * user_data; /* The user data returned on SAX callbacks (possibly NULL) */
13490: int n_user_data;
13491: int depth; /* Used for loop detection, use 0 */
13492: int n_depth;
13493: xmlChar * string; /* the input string in UTF8 or ISO-Latin (zero terminated) */
13494: int n_string;
13495: xmlNodePtr * lst; /* the return value for the set of parsed nodes */
13496: int n_lst;
13497:
13498: for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
13499: for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
13500: for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
13501: for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
13502: for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
13503: for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
13504: mem_base = xmlMemBlocks();
13505: doc = gen_xmlDocPtr(n_doc, 0);
13506: sax = gen_xmlSAXHandlerPtr(n_sax, 1);
13507: user_data = gen_userdata(n_user_data, 2);
13508: depth = gen_int(n_depth, 3);
13509: string = gen_const_xmlChar_ptr(n_string, 4);
13510: lst = gen_xmlNodePtr_ptr(n_lst, 5);
13511:
13512: #ifdef LIBXML_SAX1_ENABLED
13513: if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL;
13514: #endif
13515:
13516:
13517: ret_val = xmlParseBalancedChunkMemory(doc, sax, user_data, depth, (const xmlChar *)string, lst);
13518: desret_int(ret_val);
13519: call_tests++;
13520: des_xmlDocPtr(n_doc, doc, 0);
13521: des_xmlSAXHandlerPtr(n_sax, sax, 1);
13522: des_userdata(n_user_data, user_data, 2);
13523: des_int(n_depth, depth, 3);
13524: des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 4);
13525: des_xmlNodePtr_ptr(n_lst, lst, 5);
13526: xmlResetLastError();
13527: if (mem_base != xmlMemBlocks()) {
13528: printf("Leak of %d blocks found in xmlParseBalancedChunkMemory",
13529: xmlMemBlocks() - mem_base);
13530: test_ret++;
13531: printf(" %d", n_doc);
13532: printf(" %d", n_sax);
13533: printf(" %d", n_user_data);
13534: printf(" %d", n_depth);
13535: printf(" %d", n_string);
13536: printf(" %d", n_lst);
13537: printf("\n");
13538: }
13539: }
13540: }
13541: }
13542: }
13543: }
13544: }
13545: function_tests++;
13546: #endif
13547: #endif
13548:
13549: return(test_ret);
13550: }
13551:
13552:
13553: static int
13554: test_xmlParseBalancedChunkMemoryRecover(void) {
13555: int test_ret = 0;
13556:
13557: #if defined(LIBXML_SAX1_ENABLED)
13558: #ifdef LIBXML_SAX1_ENABLED
13559: int mem_base;
13560: int ret_val;
13561: xmlDocPtr doc; /* the document the chunk pertains to */
13562: int n_doc;
13563: xmlSAXHandlerPtr sax; /* the SAX handler bloc (possibly NULL) */
13564: int n_sax;
13565: void * user_data; /* The user data returned on SAX callbacks (possibly NULL) */
13566: int n_user_data;
13567: int depth; /* Used for loop detection, use 0 */
13568: int n_depth;
13569: xmlChar * string; /* the input string in UTF8 or ISO-Latin (zero terminated) */
13570: int n_string;
13571: xmlNodePtr * lst; /* the return value for the set of parsed nodes */
13572: int n_lst;
13573: int recover; /* return nodes even if the data is broken (use 0) */
13574: int n_recover;
13575:
13576: for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
13577: for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
13578: for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
13579: for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
13580: for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
13581: for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
13582: for (n_recover = 0;n_recover < gen_nb_int;n_recover++) {
13583: mem_base = xmlMemBlocks();
13584: doc = gen_xmlDocPtr(n_doc, 0);
13585: sax = gen_xmlSAXHandlerPtr(n_sax, 1);
13586: user_data = gen_userdata(n_user_data, 2);
13587: depth = gen_int(n_depth, 3);
13588: string = gen_const_xmlChar_ptr(n_string, 4);
13589: lst = gen_xmlNodePtr_ptr(n_lst, 5);
13590: recover = gen_int(n_recover, 6);
13591:
13592: #ifdef LIBXML_SAX1_ENABLED
13593: if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL;
13594: #endif
13595:
13596:
13597: ret_val = xmlParseBalancedChunkMemoryRecover(doc, sax, user_data, depth, (const xmlChar *)string, lst, recover);
13598: desret_int(ret_val);
13599: call_tests++;
13600: des_xmlDocPtr(n_doc, doc, 0);
13601: des_xmlSAXHandlerPtr(n_sax, sax, 1);
13602: des_userdata(n_user_data, user_data, 2);
13603: des_int(n_depth, depth, 3);
13604: des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 4);
13605: des_xmlNodePtr_ptr(n_lst, lst, 5);
13606: des_int(n_recover, recover, 6);
13607: xmlResetLastError();
13608: if (mem_base != xmlMemBlocks()) {
13609: printf("Leak of %d blocks found in xmlParseBalancedChunkMemoryRecover",
13610: xmlMemBlocks() - mem_base);
13611: test_ret++;
13612: printf(" %d", n_doc);
13613: printf(" %d", n_sax);
13614: printf(" %d", n_user_data);
13615: printf(" %d", n_depth);
13616: printf(" %d", n_string);
13617: printf(" %d", n_lst);
13618: printf(" %d", n_recover);
13619: printf("\n");
13620: }
13621: }
13622: }
13623: }
13624: }
13625: }
13626: }
13627: }
13628: function_tests++;
13629: #endif
13630: #endif
13631:
13632: return(test_ret);
13633: }
13634:
13635:
13636: static int
13637: test_xmlParseChunk(void) {
13638: int test_ret = 0;
13639:
13640: #if defined(LIBXML_PUSH_ENABLED)
13641: int mem_base;
13642: int ret_val;
13643: xmlParserCtxtPtr ctxt; /* an XML parser context */
13644: int n_ctxt;
13645: char * chunk; /* an char array */
13646: int n_chunk;
13647: int size; /* the size in byte of the chunk */
13648: int n_size;
13649: int terminate; /* last chunk indicator */
13650: int n_terminate;
13651:
13652: for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13653: for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
13654: for (n_size = 0;n_size < gen_nb_int;n_size++) {
13655: for (n_terminate = 0;n_terminate < gen_nb_int;n_terminate++) {
13656: mem_base = xmlMemBlocks();
13657: ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13658: chunk = gen_const_char_ptr(n_chunk, 1);
13659: size = gen_int(n_size, 2);
13660: terminate = gen_int(n_terminate, 3);
13661:
13662: ret_val = xmlParseChunk(ctxt, (const char *)chunk, size, terminate);
13663: if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}
13664: desret_int(ret_val);
13665: call_tests++;
13666: des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13667: des_const_char_ptr(n_chunk, (const char *)chunk, 1);
13668: des_int(n_size, size, 2);
13669: des_int(n_terminate, terminate, 3);
13670: xmlResetLastError();
13671: if (mem_base != xmlMemBlocks()) {
13672: printf("Leak of %d blocks found in xmlParseChunk",
13673: xmlMemBlocks() - mem_base);
13674: test_ret++;
13675: printf(" %d", n_ctxt);
13676: printf(" %d", n_chunk);
13677: printf(" %d", n_size);
13678: printf(" %d", n_terminate);
13679: printf("\n");
13680: }
13681: }
13682: }
13683: }
13684: }
13685: function_tests++;
13686: #endif
13687:
13688: return(test_ret);
13689: }
13690:
13691:
13692: static int
13693: test_xmlParseCtxtExternalEntity(void) {
13694: int test_ret = 0;
13695:
13696: int mem_base;
13697: int ret_val;
13698: xmlParserCtxtPtr ctx; /* the existing parsing context */
13699: int n_ctx;
13700: xmlChar * URL; /* the URL for the entity to load */
13701: int n_URL;
13702: xmlChar * ID; /* the System ID for the entity to load */
13703: int n_ID;
13704: xmlNodePtr * lst; /* the return value for the set of parsed nodes */
13705: int n_lst;
13706:
13707: for (n_ctx = 0;n_ctx < gen_nb_xmlParserCtxtPtr;n_ctx++) {
13708: for (n_URL = 0;n_URL < gen_nb_const_xmlChar_ptr;n_URL++) {
13709: for (n_ID = 0;n_ID < gen_nb_const_xmlChar_ptr;n_ID++) {
13710: for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
13711: mem_base = xmlMemBlocks();
13712: ctx = gen_xmlParserCtxtPtr(n_ctx, 0);
13713: URL = gen_const_xmlChar_ptr(n_URL, 1);
13714: ID = gen_const_xmlChar_ptr(n_ID, 2);
13715: lst = gen_xmlNodePtr_ptr(n_lst, 3);
13716:
13717: ret_val = xmlParseCtxtExternalEntity(ctx, (const xmlChar *)URL, (const xmlChar *)ID, lst);
13718: desret_int(ret_val);
13719: call_tests++;
13720: des_xmlParserCtxtPtr(n_ctx, ctx, 0);
13721: des_const_xmlChar_ptr(n_URL, (const xmlChar *)URL, 1);
13722: des_const_xmlChar_ptr(n_ID, (const xmlChar *)ID, 2);
13723: des_xmlNodePtr_ptr(n_lst, lst, 3);
13724: xmlResetLastError();
13725: if (mem_base != xmlMemBlocks()) {
13726: printf("Leak of %d blocks found in xmlParseCtxtExternalEntity",
13727: xmlMemBlocks() - mem_base);
13728: test_ret++;
13729: printf(" %d", n_ctx);
13730: printf(" %d", n_URL);
13731: printf(" %d", n_ID);
13732: printf(" %d", n_lst);
13733: printf("\n");
13734: }
13735: }
13736: }
13737: }
13738: }
13739: function_tests++;
13740:
13741: return(test_ret);
13742: }
13743:
13744:
13745: static int
13746: test_xmlParseDTD(void) {
13747: int test_ret = 0;
13748:
13749: #if defined(LIBXML_VALID_ENABLED)
13750: #ifdef LIBXML_VALID_ENABLED
13751: int mem_base;
13752: xmlDtdPtr ret_val;
13753: xmlChar * ExternalID; /* a NAME* containing the External ID of the DTD */
13754: int n_ExternalID;
13755: xmlChar * SystemID; /* a NAME* containing the URL to the DTD */
13756: int n_SystemID;
13757:
13758: for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
13759: for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
13760: mem_base = xmlMemBlocks();
13761: ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 0);
13762: SystemID = gen_const_xmlChar_ptr(n_SystemID, 1);
13763:
13764: ret_val = xmlParseDTD((const xmlChar *)ExternalID, (const xmlChar *)SystemID);
13765: desret_xmlDtdPtr(ret_val);
13766: call_tests++;
13767: des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 0);
13768: des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 1);
13769: xmlResetLastError();
13770: if (mem_base != xmlMemBlocks()) {
13771: printf("Leak of %d blocks found in xmlParseDTD",
13772: xmlMemBlocks() - mem_base);
13773: test_ret++;
13774: printf(" %d", n_ExternalID);
13775: printf(" %d", n_SystemID);
13776: printf("\n");
13777: }
13778: }
13779: }
13780: function_tests++;
13781: #endif
13782: #endif
13783:
13784: return(test_ret);
13785: }
13786:
13787:
13788: static int
13789: test_xmlParseDoc(void) {
13790: int test_ret = 0;
13791:
13792: #if defined(LIBXML_SAX1_ENABLED)
13793: #ifdef LIBXML_SAX1_ENABLED
13794: int mem_base;
13795: xmlDocPtr ret_val;
13796: xmlChar * cur; /* a pointer to an array of xmlChar */
13797: int n_cur;
13798:
13799: for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
13800: mem_base = xmlMemBlocks();
13801: cur = gen_const_xmlChar_ptr(n_cur, 0);
13802:
13803: ret_val = xmlParseDoc((const xmlChar *)cur);
13804: desret_xmlDocPtr(ret_val);
13805: call_tests++;
13806: des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
13807: xmlResetLastError();
13808: if (mem_base != xmlMemBlocks()) {
13809: printf("Leak of %d blocks found in xmlParseDoc",
13810: xmlMemBlocks() - mem_base);
13811: test_ret++;
13812: printf(" %d", n_cur);
13813: printf("\n");
13814: }
13815: }
13816: function_tests++;
13817: #endif
13818: #endif
13819:
13820: return(test_ret);
13821: }
13822:
13823:
13824: static int
13825: test_xmlParseDocument(void) {
13826: int test_ret = 0;
13827:
13828: int mem_base;
13829: int ret_val;
13830: xmlParserCtxtPtr ctxt; /* an XML parser context */
13831: int n_ctxt;
13832:
13833: for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13834: mem_base = xmlMemBlocks();
13835: ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13836:
13837: ret_val = xmlParseDocument(ctxt);
13838: if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}
13839: desret_int(ret_val);
13840: call_tests++;
13841: des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13842: xmlResetLastError();
13843: if (mem_base != xmlMemBlocks()) {
13844: printf("Leak of %d blocks found in xmlParseDocument",
13845: xmlMemBlocks() - mem_base);
13846: test_ret++;
13847: printf(" %d", n_ctxt);
13848: printf("\n");
13849: }
13850: }
13851: function_tests++;
13852:
13853: return(test_ret);
13854: }
13855:
13856:
13857: static int
13858: test_xmlParseEntity(void) {
13859: int test_ret = 0;
13860:
13861: #if defined(LIBXML_SAX1_ENABLED)
13862: #ifdef LIBXML_SAX1_ENABLED
13863: int mem_base;
13864: xmlDocPtr ret_val;
13865: const char * filename; /* the filename */
13866: int n_filename;
13867:
13868: for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
13869: mem_base = xmlMemBlocks();
13870: filename = gen_filepath(n_filename, 0);
13871:
13872: ret_val = xmlParseEntity(filename);
13873: desret_xmlDocPtr(ret_val);
13874: call_tests++;
13875: des_filepath(n_filename, filename, 0);
13876: xmlResetLastError();
13877: if (mem_base != xmlMemBlocks()) {
13878: printf("Leak of %d blocks found in xmlParseEntity",
13879: xmlMemBlocks() - mem_base);
13880: test_ret++;
13881: printf(" %d", n_filename);
13882: printf("\n");
13883: }
13884: }
13885: function_tests++;
13886: #endif
13887: #endif
13888:
13889: return(test_ret);
13890: }
13891:
13892:
13893: static int
13894: test_xmlParseExtParsedEnt(void) {
13895: int test_ret = 0;
13896:
13897: int mem_base;
13898: int ret_val;
13899: xmlParserCtxtPtr ctxt; /* an XML parser context */
13900: int n_ctxt;
13901:
13902: for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13903: mem_base = xmlMemBlocks();
13904: ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13905:
13906: ret_val = xmlParseExtParsedEnt(ctxt);
13907: if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}
13908: desret_int(ret_val);
13909: call_tests++;
13910: des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13911: xmlResetLastError();
13912: if (mem_base != xmlMemBlocks()) {
13913: printf("Leak of %d blocks found in xmlParseExtParsedEnt",
13914: xmlMemBlocks() - mem_base);
13915: test_ret++;
13916: printf(" %d", n_ctxt);
13917: printf("\n");
13918: }
13919: }
13920: function_tests++;
13921:
13922: return(test_ret);
13923: }
13924:
13925:
13926: static int
13927: test_xmlParseExternalEntity(void) {
13928: int test_ret = 0;
13929:
13930: #if defined(LIBXML_SAX1_ENABLED)
13931: #ifdef LIBXML_SAX1_ENABLED
13932: int mem_base;
13933: int ret_val;
13934: xmlDocPtr doc; /* the document the chunk pertains to */
13935: int n_doc;
13936: xmlSAXHandlerPtr sax; /* the SAX handler bloc (possibly NULL) */
13937: int n_sax;
13938: void * user_data; /* The user data returned on SAX callbacks (possibly NULL) */
13939: int n_user_data;
13940: int depth; /* Used for loop detection, use 0 */
13941: int n_depth;
13942: xmlChar * URL; /* the URL for the entity to load */
13943: int n_URL;
13944: xmlChar * ID; /* the System ID for the entity to load */
13945: int n_ID;
13946: xmlNodePtr * lst; /* the return value for the set of parsed nodes */
13947: int n_lst;
13948:
13949: for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
13950: for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
13951: for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
13952: for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
13953: for (n_URL = 0;n_URL < gen_nb_const_xmlChar_ptr;n_URL++) {
13954: for (n_ID = 0;n_ID < gen_nb_const_xmlChar_ptr;n_ID++) {
13955: for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
13956: mem_base = xmlMemBlocks();
13957: doc = gen_xmlDocPtr(n_doc, 0);
13958: sax = gen_xmlSAXHandlerPtr(n_sax, 1);
13959: user_data = gen_userdata(n_user_data, 2);
13960: depth = gen_int(n_depth, 3);
13961: URL = gen_const_xmlChar_ptr(n_URL, 4);
13962: ID = gen_const_xmlChar_ptr(n_ID, 5);
13963: lst = gen_xmlNodePtr_ptr(n_lst, 6);
13964:
13965: ret_val = xmlParseExternalEntity(doc, sax, user_data, depth, (const xmlChar *)URL, (const xmlChar *)ID, lst);
13966: desret_int(ret_val);
13967: call_tests++;
13968: des_xmlDocPtr(n_doc, doc, 0);
13969: des_xmlSAXHandlerPtr(n_sax, sax, 1);
13970: des_userdata(n_user_data, user_data, 2);
13971: des_int(n_depth, depth, 3);
13972: des_const_xmlChar_ptr(n_URL, (const xmlChar *)URL, 4);
13973: des_const_xmlChar_ptr(n_ID, (const xmlChar *)ID, 5);
13974: des_xmlNodePtr_ptr(n_lst, lst, 6);
13975: xmlResetLastError();
13976: if (mem_base != xmlMemBlocks()) {
13977: printf("Leak of %d blocks found in xmlParseExternalEntity",
13978: xmlMemBlocks() - mem_base);
13979: test_ret++;
13980: printf(" %d", n_doc);
13981: printf(" %d", n_sax);
13982: printf(" %d", n_user_data);
13983: printf(" %d", n_depth);
13984: printf(" %d", n_URL);
13985: printf(" %d", n_ID);
13986: printf(" %d", n_lst);
13987: printf("\n");
13988: }
13989: }
13990: }
13991: }
13992: }
13993: }
13994: }
13995: }
13996: function_tests++;
13997: #endif
13998: #endif
13999:
14000: return(test_ret);
14001: }
14002:
14003:
14004: static int
14005: test_xmlParseFile(void) {
14006: int test_ret = 0;
14007:
14008: #if defined(LIBXML_SAX1_ENABLED)
14009: #ifdef LIBXML_SAX1_ENABLED
14010: int mem_base;
14011: xmlDocPtr ret_val;
14012: const char * filename; /* the filename */
14013: int n_filename;
14014:
14015: for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14016: mem_base = xmlMemBlocks();
14017: filename = gen_filepath(n_filename, 0);
14018:
14019: ret_val = xmlParseFile(filename);
14020: desret_xmlDocPtr(ret_val);
14021: call_tests++;
14022: des_filepath(n_filename, filename, 0);
14023: xmlResetLastError();
14024: if (mem_base != xmlMemBlocks()) {
14025: printf("Leak of %d blocks found in xmlParseFile",
14026: xmlMemBlocks() - mem_base);
14027: test_ret++;
14028: printf(" %d", n_filename);
14029: printf("\n");
14030: }
14031: }
14032: function_tests++;
14033: #endif
14034: #endif
14035:
14036: return(test_ret);
14037: }
14038:
14039:
14040: static int
14041: test_xmlParseInNodeContext(void) {
14042: int test_ret = 0;
14043:
14044: int mem_base;
14045: xmlParserErrors ret_val;
14046: xmlNodePtr node; /* the context node */
14047: int n_node;
14048: char * data; /* the input string */
14049: int n_data;
14050: int datalen; /* the input string length in bytes */
14051: int n_datalen;
14052: int options; /* a combination of xmlParserOption */
14053: int n_options;
14054: xmlNodePtr * lst; /* the return value for the set of parsed nodes */
14055: int n_lst;
14056:
14057: for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
14058: for (n_data = 0;n_data < gen_nb_const_char_ptr;n_data++) {
14059: for (n_datalen = 0;n_datalen < gen_nb_int;n_datalen++) {
14060: for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
14061: for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
14062: mem_base = xmlMemBlocks();
14063: node = gen_xmlNodePtr(n_node, 0);
14064: data = gen_const_char_ptr(n_data, 1);
14065: datalen = gen_int(n_datalen, 2);
14066: options = gen_parseroptions(n_options, 3);
14067: lst = gen_xmlNodePtr_ptr(n_lst, 4);
14068:
14069: ret_val = xmlParseInNodeContext(node, (const char *)data, datalen, options, lst);
14070: desret_xmlParserErrors(ret_val);
14071: call_tests++;
14072: des_xmlNodePtr(n_node, node, 0);
14073: des_const_char_ptr(n_data, (const char *)data, 1);
14074: des_int(n_datalen, datalen, 2);
14075: des_parseroptions(n_options, options, 3);
14076: des_xmlNodePtr_ptr(n_lst, lst, 4);
14077: xmlResetLastError();
14078: if (mem_base != xmlMemBlocks()) {
14079: printf("Leak of %d blocks found in xmlParseInNodeContext",
14080: xmlMemBlocks() - mem_base);
14081: test_ret++;
14082: printf(" %d", n_node);
14083: printf(" %d", n_data);
14084: printf(" %d", n_datalen);
14085: printf(" %d", n_options);
14086: printf(" %d", n_lst);
14087: printf("\n");
14088: }
14089: }
14090: }
14091: }
14092: }
14093: }
14094: function_tests++;
14095:
14096: return(test_ret);
14097: }
14098:
14099:
14100: static int
14101: test_xmlParseMemory(void) {
14102: int test_ret = 0;
14103:
14104: #if defined(LIBXML_SAX1_ENABLED)
14105: #ifdef LIBXML_SAX1_ENABLED
14106: int mem_base;
14107: xmlDocPtr ret_val;
14108: char * buffer; /* an pointer to a char array */
14109: int n_buffer;
14110: int size; /* the size of the array */
14111: int n_size;
14112:
14113: for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
14114: for (n_size = 0;n_size < gen_nb_int;n_size++) {
14115: mem_base = xmlMemBlocks();
14116: buffer = gen_const_char_ptr(n_buffer, 0);
14117: size = gen_int(n_size, 1);
14118:
14119: ret_val = xmlParseMemory((const char *)buffer, size);
14120: desret_xmlDocPtr(ret_val);
14121: call_tests++;
14122: des_const_char_ptr(n_buffer, (const char *)buffer, 0);
14123: des_int(n_size, size, 1);
14124: xmlResetLastError();
14125: if (mem_base != xmlMemBlocks()) {
14126: printf("Leak of %d blocks found in xmlParseMemory",
14127: xmlMemBlocks() - mem_base);
14128: test_ret++;
14129: printf(" %d", n_buffer);
14130: printf(" %d", n_size);
14131: printf("\n");
14132: }
14133: }
14134: }
14135: function_tests++;
14136: #endif
14137: #endif
14138:
14139: return(test_ret);
14140: }
14141:
14142:
14143: #define gen_nb_const_xmlParserNodeInfoPtr 1
14144: static xmlParserNodeInfoPtr gen_const_xmlParserNodeInfoPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14145: return(NULL);
14146: }
14147: static void des_const_xmlParserNodeInfoPtr(int no ATTRIBUTE_UNUSED, const xmlParserNodeInfoPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14148: }
14149:
14150: static int
14151: test_xmlParserAddNodeInfo(void) {
14152: int test_ret = 0;
14153:
14154: int mem_base;
14155: xmlParserCtxtPtr ctxt; /* an XML parser context */
14156: int n_ctxt;
14157: xmlParserNodeInfoPtr info; /* a node info sequence pointer */
14158: int n_info;
14159:
14160: for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
14161: for (n_info = 0;n_info < gen_nb_const_xmlParserNodeInfoPtr;n_info++) {
14162: mem_base = xmlMemBlocks();
14163: ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
14164: info = gen_const_xmlParserNodeInfoPtr(n_info, 1);
14165:
14166: xmlParserAddNodeInfo(ctxt, (const xmlParserNodeInfoPtr)info);
14167: call_tests++;
14168: des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
14169: des_const_xmlParserNodeInfoPtr(n_info, (const xmlParserNodeInfoPtr)info, 1);
14170: xmlResetLastError();
14171: if (mem_base != xmlMemBlocks()) {
14172: printf("Leak of %d blocks found in xmlParserAddNodeInfo",
14173: xmlMemBlocks() - mem_base);
14174: test_ret++;
14175: printf(" %d", n_ctxt);
14176: printf(" %d", n_info);
14177: printf("\n");
14178: }
14179: }
14180: }
14181: function_tests++;
14182:
14183: return(test_ret);
14184: }
14185:
14186:
14187: #define gen_nb_const_xmlParserCtxtPtr 1
14188: static xmlParserCtxtPtr gen_const_xmlParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14189: return(NULL);
14190: }
14191: static void des_const_xmlParserCtxtPtr(int no ATTRIBUTE_UNUSED, const xmlParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14192: }
14193:
14194: #define gen_nb_const_xmlNodePtr 1
14195: static xmlNodePtr gen_const_xmlNodePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14196: return(NULL);
14197: }
14198: static void des_const_xmlNodePtr(int no ATTRIBUTE_UNUSED, const xmlNodePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14199: }
14200:
14201: static int
14202: test_xmlParserFindNodeInfo(void) {
14203: int test_ret = 0;
14204:
14205: int mem_base;
14206: const xmlParserNodeInfo * ret_val;
14207: xmlParserCtxtPtr ctx; /* an XML parser context */
14208: int n_ctx;
14209: xmlNodePtr node; /* an XML node within the tree */
14210: int n_node;
14211:
14212: for (n_ctx = 0;n_ctx < gen_nb_const_xmlParserCtxtPtr;n_ctx++) {
14213: for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
14214: mem_base = xmlMemBlocks();
14215: ctx = gen_const_xmlParserCtxtPtr(n_ctx, 0);
14216: node = gen_const_xmlNodePtr(n_node, 1);
14217:
14218: ret_val = xmlParserFindNodeInfo((const xmlParserCtxtPtr)ctx, (const xmlNodePtr)node);
14219: desret_const_xmlParserNodeInfo_ptr(ret_val);
14220: call_tests++;
14221: des_const_xmlParserCtxtPtr(n_ctx, (const xmlParserCtxtPtr)ctx, 0);
14222: des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 1);
14223: xmlResetLastError();
14224: if (mem_base != xmlMemBlocks()) {
14225: printf("Leak of %d blocks found in xmlParserFindNodeInfo",
14226: xmlMemBlocks() - mem_base);
14227: test_ret++;
14228: printf(" %d", n_ctx);
14229: printf(" %d", n_node);
14230: printf("\n");
14231: }
14232: }
14233: }
14234: function_tests++;
14235:
14236: return(test_ret);
14237: }
14238:
14239:
14240: #define gen_nb_const_xmlParserNodeInfoSeqPtr 1
14241: static xmlParserNodeInfoSeqPtr gen_const_xmlParserNodeInfoSeqPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14242: return(NULL);
14243: }
14244: static void des_const_xmlParserNodeInfoSeqPtr(int no ATTRIBUTE_UNUSED, const xmlParserNodeInfoSeqPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14245: }
14246:
14247: static int
14248: test_xmlParserFindNodeInfoIndex(void) {
14249: int test_ret = 0;
14250:
14251: int mem_base;
14252: unsigned long ret_val;
14253: xmlParserNodeInfoSeqPtr seq; /* a node info sequence pointer */
14254: int n_seq;
14255: xmlNodePtr node; /* an XML node pointer */
14256: int n_node;
14257:
14258: for (n_seq = 0;n_seq < gen_nb_const_xmlParserNodeInfoSeqPtr;n_seq++) {
14259: for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
14260: mem_base = xmlMemBlocks();
14261: seq = gen_const_xmlParserNodeInfoSeqPtr(n_seq, 0);
14262: node = gen_const_xmlNodePtr(n_node, 1);
14263:
14264: ret_val = xmlParserFindNodeInfoIndex((const xmlParserNodeInfoSeqPtr)seq, (const xmlNodePtr)node);
14265: desret_unsigned_long(ret_val);
14266: call_tests++;
14267: des_const_xmlParserNodeInfoSeqPtr(n_seq, (const xmlParserNodeInfoSeqPtr)seq, 0);
14268: des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 1);
14269: xmlResetLastError();
14270: if (mem_base != xmlMemBlocks()) {
14271: printf("Leak of %d blocks found in xmlParserFindNodeInfoIndex",
14272: xmlMemBlocks() - mem_base);
14273: test_ret++;
14274: printf(" %d", n_seq);
14275: printf(" %d", n_node);
14276: printf("\n");
14277: }
14278: }
14279: }
14280: function_tests++;
14281:
14282: return(test_ret);
14283: }
14284:
14285:
14286: #define gen_nb_xmlParserInputPtr 1
14287: static xmlParserInputPtr gen_xmlParserInputPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14288: return(NULL);
14289: }
14290: static void des_xmlParserInputPtr(int no ATTRIBUTE_UNUSED, xmlParserInputPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14291: }
14292:
14293: static int
14294: test_xmlParserInputGrow(void) {
14295: int test_ret = 0;
14296:
14297: int mem_base;
14298: int ret_val;
14299: xmlParserInputPtr in; /* an XML parser input */
14300: int n_in;
14301: int len; /* an indicative size for the lookahead */
14302: int n_len;
14303:
14304: for (n_in = 0;n_in < gen_nb_xmlParserInputPtr;n_in++) {
14305: for (n_len = 0;n_len < gen_nb_int;n_len++) {
14306: mem_base = xmlMemBlocks();
14307: in = gen_xmlParserInputPtr(n_in, 0);
14308: len = gen_int(n_len, 1);
14309:
14310: ret_val = xmlParserInputGrow(in, len);
14311: desret_int(ret_val);
14312: call_tests++;
14313: des_xmlParserInputPtr(n_in, in, 0);
14314: des_int(n_len, len, 1);
14315: xmlResetLastError();
14316: if (mem_base != xmlMemBlocks()) {
14317: printf("Leak of %d blocks found in xmlParserInputGrow",
14318: xmlMemBlocks() - mem_base);
14319: test_ret++;
14320: printf(" %d", n_in);
14321: printf(" %d", n_len);
14322: printf("\n");
14323: }
14324: }
14325: }
14326: function_tests++;
14327:
14328: return(test_ret);
14329: }
14330:
14331:
14332: static int
14333: test_xmlParserInputRead(void) {
14334: int test_ret = 0;
14335:
14336: int mem_base;
14337: int ret_val;
14338: xmlParserInputPtr in; /* an XML parser input */
14339: int n_in;
14340: int len; /* an indicative size for the lookahead */
14341: int n_len;
14342:
14343: for (n_in = 0;n_in < gen_nb_xmlParserInputPtr;n_in++) {
14344: for (n_len = 0;n_len < gen_nb_int;n_len++) {
14345: mem_base = xmlMemBlocks();
14346: in = gen_xmlParserInputPtr(n_in, 0);
14347: len = gen_int(n_len, 1);
14348:
14349: ret_val = xmlParserInputRead(in, len);
14350: desret_int(ret_val);
14351: call_tests++;
14352: des_xmlParserInputPtr(n_in, in, 0);
14353: des_int(n_len, len, 1);
14354: xmlResetLastError();
14355: if (mem_base != xmlMemBlocks()) {
14356: printf("Leak of %d blocks found in xmlParserInputRead",
14357: xmlMemBlocks() - mem_base);
14358: test_ret++;
14359: printf(" %d", n_in);
14360: printf(" %d", n_len);
14361: printf("\n");
14362: }
14363: }
14364: }
14365: function_tests++;
14366:
14367: return(test_ret);
14368: }
14369:
14370:
14371: static int
14372: test_xmlPedanticParserDefault(void) {
14373: int test_ret = 0;
14374:
14375: int mem_base;
14376: int ret_val;
14377: int val; /* int 0 or 1 */
14378: int n_val;
14379:
14380: for (n_val = 0;n_val < gen_nb_int;n_val++) {
14381: mem_base = xmlMemBlocks();
14382: val = gen_int(n_val, 0);
14383:
14384: ret_val = xmlPedanticParserDefault(val);
14385: desret_int(ret_val);
14386: call_tests++;
14387: des_int(n_val, val, 0);
14388: xmlResetLastError();
14389: if (mem_base != xmlMemBlocks()) {
14390: printf("Leak of %d blocks found in xmlPedanticParserDefault",
14391: xmlMemBlocks() - mem_base);
14392: test_ret++;
14393: printf(" %d", n_val);
14394: printf("\n");
14395: }
14396: }
14397: function_tests++;
14398:
14399: return(test_ret);
14400: }
14401:
14402:
14403: static int
14404: test_xmlReadDoc(void) {
14405: int test_ret = 0;
14406:
14407: int mem_base;
14408: xmlDocPtr ret_val;
14409: xmlChar * cur; /* a pointer to a zero terminated string */
14410: int n_cur;
14411: const char * URL; /* the base URL to use for the document */
14412: int n_URL;
14413: char * encoding; /* the document encoding, or NULL */
14414: int n_encoding;
14415: int options; /* a combination of xmlParserOption */
14416: int n_options;
14417:
14418: for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
14419: for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
14420: for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
14421: for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
14422: mem_base = xmlMemBlocks();
14423: cur = gen_const_xmlChar_ptr(n_cur, 0);
14424: URL = gen_filepath(n_URL, 1);
14425: encoding = gen_const_char_ptr(n_encoding, 2);
14426: options = gen_parseroptions(n_options, 3);
14427:
14428: ret_val = xmlReadDoc((const xmlChar *)cur, URL, (const char *)encoding, options);
14429: desret_xmlDocPtr(ret_val);
14430: call_tests++;
14431: des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
14432: des_filepath(n_URL, URL, 1);
14433: des_const_char_ptr(n_encoding, (const char *)encoding, 2);
14434: des_parseroptions(n_options, options, 3);
14435: xmlResetLastError();
14436: if (mem_base != xmlMemBlocks()) {
14437: printf("Leak of %d blocks found in xmlReadDoc",
14438: xmlMemBlocks() - mem_base);
14439: test_ret++;
14440: printf(" %d", n_cur);
14441: printf(" %d", n_URL);
14442: printf(" %d", n_encoding);
14443: printf(" %d", n_options);
14444: printf("\n");
14445: }
14446: }
14447: }
14448: }
14449: }
14450: function_tests++;
14451:
14452: return(test_ret);
14453: }
14454:
14455:
14456: static int
14457: test_xmlReadFile(void) {
14458: int test_ret = 0;
14459:
14460: int mem_base;
14461: xmlDocPtr ret_val;
14462: const char * filename; /* a file or URL */
14463: int n_filename;
14464: char * encoding; /* the document encoding, or NULL */
14465: int n_encoding;
14466: int options; /* a combination of xmlParserOption */
14467: int n_options;
14468:
14469: for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14470: for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
14471: for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
14472: mem_base = xmlMemBlocks();
14473: filename = gen_filepath(n_filename, 0);
14474: encoding = gen_const_char_ptr(n_encoding, 1);
14475: options = gen_parseroptions(n_options, 2);
14476:
14477: ret_val = xmlReadFile(filename, (const char *)encoding, options);
14478: desret_xmlDocPtr(ret_val);
14479: call_tests++;
14480: des_filepath(n_filename, filename, 0);
14481: des_const_char_ptr(n_encoding, (const char *)encoding, 1);
14482: des_parseroptions(n_options, options, 2);
14483: xmlResetLastError();
14484: if (mem_base != xmlMemBlocks()) {
14485: printf("Leak of %d blocks found in xmlReadFile",
14486: xmlMemBlocks() - mem_base);
14487: test_ret++;
14488: printf(" %d", n_filename);
14489: printf(" %d", n_encoding);
14490: printf(" %d", n_options);
14491: printf("\n");
14492: }
14493: }
14494: }
14495: }
14496: function_tests++;
14497:
14498: return(test_ret);
14499: }
14500:
14501:
14502: static int
14503: test_xmlReadMemory(void) {
14504: int test_ret = 0;
14505:
14506: int mem_base;
14507: xmlDocPtr ret_val;
14508: char * buffer; /* a pointer to a char array */
14509: int n_buffer;
14510: int size; /* the size of the array */
14511: int n_size;
14512: const char * URL; /* the base URL to use for the document */
14513: int n_URL;
14514: char * encoding; /* the document encoding, or NULL */
14515: int n_encoding;
14516: int options; /* a combination of xmlParserOption */
14517: int n_options;
14518:
14519: for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
14520: for (n_size = 0;n_size < gen_nb_int;n_size++) {
14521: for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
14522: for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
14523: for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
14524: mem_base = xmlMemBlocks();
14525: buffer = gen_const_char_ptr(n_buffer, 0);
14526: size = gen_int(n_size, 1);
14527: URL = gen_filepath(n_URL, 2);
14528: encoding = gen_const_char_ptr(n_encoding, 3);
14529: options = gen_parseroptions(n_options, 4);
14530:
14531: ret_val = xmlReadMemory((const char *)buffer, size, URL, (const char *)encoding, options);
14532: desret_xmlDocPtr(ret_val);
14533: call_tests++;
14534: des_const_char_ptr(n_buffer, (const char *)buffer, 0);
14535: des_int(n_size, size, 1);
14536: des_filepath(n_URL, URL, 2);
14537: des_const_char_ptr(n_encoding, (const char *)encoding, 3);
14538: des_parseroptions(n_options, options, 4);
14539: xmlResetLastError();
14540: if (mem_base != xmlMemBlocks()) {
14541: printf("Leak of %d blocks found in xmlReadMemory",
14542: xmlMemBlocks() - mem_base);
14543: test_ret++;
14544: printf(" %d", n_buffer);
14545: printf(" %d", n_size);
14546: printf(" %d", n_URL);
14547: printf(" %d", n_encoding);
14548: printf(" %d", n_options);
14549: printf("\n");
14550: }
14551: }
14552: }
14553: }
14554: }
14555: }
14556: function_tests++;
14557:
14558: return(test_ret);
14559: }
14560:
14561:
14562: static int
14563: test_xmlRecoverDoc(void) {
14564: int test_ret = 0;
14565:
14566: #if defined(LIBXML_SAX1_ENABLED)
14567: #ifdef LIBXML_SAX1_ENABLED
14568: int mem_base;
14569: xmlDocPtr ret_val;
14570: xmlChar * cur; /* a pointer to an array of xmlChar */
14571: int n_cur;
14572:
14573: for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
14574: mem_base = xmlMemBlocks();
14575: cur = gen_const_xmlChar_ptr(n_cur, 0);
14576:
14577: ret_val = xmlRecoverDoc((const xmlChar *)cur);
14578: desret_xmlDocPtr(ret_val);
14579: call_tests++;
14580: des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
14581: xmlResetLastError();
14582: if (mem_base != xmlMemBlocks()) {
14583: printf("Leak of %d blocks found in xmlRecoverDoc",
14584: xmlMemBlocks() - mem_base);
14585: test_ret++;
14586: printf(" %d", n_cur);
14587: printf("\n");
14588: }
14589: }
14590: function_tests++;
14591: #endif
14592: #endif
14593:
14594: return(test_ret);
14595: }
14596:
14597:
14598: static int
14599: test_xmlRecoverFile(void) {
14600: int test_ret = 0;
14601:
14602: #if defined(LIBXML_SAX1_ENABLED)
14603: #ifdef LIBXML_SAX1_ENABLED
14604: int mem_base;
14605: xmlDocPtr ret_val;
14606: const char * filename; /* the filename */
14607: int n_filename;
14608:
14609: for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14610: mem_base = xmlMemBlocks();
14611: filename = gen_filepath(n_filename, 0);
14612:
14613: ret_val = xmlRecoverFile(filename);
14614: desret_xmlDocPtr(ret_val);
14615: call_tests++;
14616: des_filepath(n_filename, filename, 0);
14617: xmlResetLastError();
14618: if (mem_base != xmlMemBlocks()) {
14619: printf("Leak of %d blocks found in xmlRecoverFile",
14620: xmlMemBlocks() - mem_base);
14621: test_ret++;
14622: printf(" %d", n_filename);
14623: printf("\n");
14624: }
14625: }
14626: function_tests++;
14627: #endif
14628: #endif
14629:
14630: return(test_ret);
14631: }
14632:
14633:
14634: static int
14635: test_xmlRecoverMemory(void) {
14636: int test_ret = 0;
14637:
14638: #if defined(LIBXML_SAX1_ENABLED)
14639: #ifdef LIBXML_SAX1_ENABLED
14640: int mem_base;
14641: xmlDocPtr ret_val;
14642: char * buffer; /* an pointer to a char array */
14643: int n_buffer;
14644: int size; /* the size of the array */
14645: int n_size;
14646:
14647: for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
14648: for (n_size = 0;n_size < gen_nb_int;n_size++) {
14649: mem_base = xmlMemBlocks();
14650: buffer = gen_const_char_ptr(n_buffer, 0);
14651: size = gen_int(n_size, 1);
14652:
14653: ret_val = xmlRecoverMemory((const char *)buffer, size);
14654: desret_xmlDocPtr(ret_val);
14655: call_tests++;
14656: des_const_char_ptr(n_buffer, (const char *)buffer, 0);
14657: des_int(n_size, size, 1);
14658: xmlResetLastError();
14659: if (mem_base != xmlMemBlocks()) {
14660: printf("Leak of %d blocks found in xmlRecoverMemory",
14661: xmlMemBlocks() - mem_base);
14662: test_ret++;
14663: printf(" %d", n_buffer);
14664: printf(" %d", n_size);
14665: printf("\n");
14666: }
14667: }
14668: }
14669: function_tests++;
14670: #endif
14671: #endif
14672:
14673: return(test_ret);
14674: }
14675:
14676:
14677: static int
14678: test_xmlSAXParseDTD(void) {
14679: int test_ret = 0;
14680:
14681: #if defined(LIBXML_VALID_ENABLED)
14682: #ifdef LIBXML_SAX1_ENABLED
14683: int mem_base;
14684: xmlDtdPtr ret_val;
14685: xmlSAXHandlerPtr sax; /* the SAX handler block */
14686: int n_sax;
14687: xmlChar * ExternalID; /* a NAME* containing the External ID of the DTD */
14688: int n_ExternalID;
14689: xmlChar * SystemID; /* a NAME* containing the URL to the DTD */
14690: int n_SystemID;
14691:
14692: for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14693: for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
14694: for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
14695: mem_base = xmlMemBlocks();
14696: sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14697: ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 1);
14698: SystemID = gen_const_xmlChar_ptr(n_SystemID, 2);
14699:
14700: ret_val = xmlSAXParseDTD(sax, (const xmlChar *)ExternalID, (const xmlChar *)SystemID);
14701: desret_xmlDtdPtr(ret_val);
14702: call_tests++;
14703: des_xmlSAXHandlerPtr(n_sax, sax, 0);
14704: des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 1);
14705: des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 2);
14706: xmlResetLastError();
14707: if (mem_base != xmlMemBlocks()) {
14708: printf("Leak of %d blocks found in xmlSAXParseDTD",
14709: xmlMemBlocks() - mem_base);
14710: test_ret++;
14711: printf(" %d", n_sax);
14712: printf(" %d", n_ExternalID);
14713: printf(" %d", n_SystemID);
14714: printf("\n");
14715: }
14716: }
14717: }
14718: }
14719: function_tests++;
14720: #endif
14721: #endif
14722:
14723: return(test_ret);
14724: }
14725:
14726:
14727: static int
14728: test_xmlSAXParseDoc(void) {
14729: int test_ret = 0;
14730:
14731: #if defined(LIBXML_SAX1_ENABLED)
14732: #ifdef LIBXML_SAX1_ENABLED
14733: int mem_base;
14734: xmlDocPtr ret_val;
14735: xmlSAXHandlerPtr sax; /* the SAX handler block */
14736: int n_sax;
14737: xmlChar * cur; /* a pointer to an array of xmlChar */
14738: int n_cur;
14739: int recovery; /* work in recovery mode, i.e. tries to read no Well Formed documents */
14740: int n_recovery;
14741:
14742: for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14743: for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
14744: for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
14745: mem_base = xmlMemBlocks();
14746: sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14747: cur = gen_const_xmlChar_ptr(n_cur, 1);
14748: recovery = gen_int(n_recovery, 2);
14749:
14750: ret_val = xmlSAXParseDoc(sax, (const xmlChar *)cur, recovery);
14751: desret_xmlDocPtr(ret_val);
14752: call_tests++;
14753: des_xmlSAXHandlerPtr(n_sax, sax, 0);
14754: des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1);
14755: des_int(n_recovery, recovery, 2);
14756: xmlResetLastError();
14757: if (mem_base != xmlMemBlocks()) {
14758: printf("Leak of %d blocks found in xmlSAXParseDoc",
14759: xmlMemBlocks() - mem_base);
14760: test_ret++;
14761: printf(" %d", n_sax);
14762: printf(" %d", n_cur);
14763: printf(" %d", n_recovery);
14764: printf("\n");
14765: }
14766: }
14767: }
14768: }
14769: function_tests++;
14770: #endif
14771: #endif
14772:
14773: return(test_ret);
14774: }
14775:
14776:
14777: static int
14778: test_xmlSAXParseEntity(void) {
14779: int test_ret = 0;
14780:
14781: #if defined(LIBXML_SAX1_ENABLED)
14782: #ifdef LIBXML_SAX1_ENABLED
14783: int mem_base;
14784: xmlDocPtr ret_val;
14785: xmlSAXHandlerPtr sax; /* the SAX handler block */
14786: int n_sax;
14787: const char * filename; /* the filename */
14788: int n_filename;
14789:
14790: for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14791: for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14792: mem_base = xmlMemBlocks();
14793: sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14794: filename = gen_filepath(n_filename, 1);
14795:
14796: ret_val = xmlSAXParseEntity(sax, filename);
14797: desret_xmlDocPtr(ret_val);
14798: call_tests++;
14799: des_xmlSAXHandlerPtr(n_sax, sax, 0);
14800: des_filepath(n_filename, filename, 1);
14801: xmlResetLastError();
14802: if (mem_base != xmlMemBlocks()) {
14803: printf("Leak of %d blocks found in xmlSAXParseEntity",
14804: xmlMemBlocks() - mem_base);
14805: test_ret++;
14806: printf(" %d", n_sax);
14807: printf(" %d", n_filename);
14808: printf("\n");
14809: }
14810: }
14811: }
14812: function_tests++;
14813: #endif
14814: #endif
14815:
14816: return(test_ret);
14817: }
14818:
14819:
14820: static int
14821: test_xmlSAXParseFile(void) {
14822: int test_ret = 0;
14823:
14824: #if defined(LIBXML_SAX1_ENABLED)
14825: #ifdef LIBXML_SAX1_ENABLED
14826: int mem_base;
14827: xmlDocPtr ret_val;
14828: xmlSAXHandlerPtr sax; /* the SAX handler block */
14829: int n_sax;
14830: const char * filename; /* the filename */
14831: int n_filename;
14832: int recovery; /* work in recovery mode, i.e. tries to read no Well Formed documents */
14833: int n_recovery;
14834:
14835: for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14836: for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14837: for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
14838: mem_base = xmlMemBlocks();
14839: sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14840: filename = gen_filepath(n_filename, 1);
14841: recovery = gen_int(n_recovery, 2);
14842:
14843: ret_val = xmlSAXParseFile(sax, filename, recovery);
14844: desret_xmlDocPtr(ret_val);
14845: call_tests++;
14846: des_xmlSAXHandlerPtr(n_sax, sax, 0);
14847: des_filepath(n_filename, filename, 1);
14848: des_int(n_recovery, recovery, 2);
14849: xmlResetLastError();
14850: if (mem_base != xmlMemBlocks()) {
14851: printf("Leak of %d blocks found in xmlSAXParseFile",
14852: xmlMemBlocks() - mem_base);
14853: test_ret++;
14854: printf(" %d", n_sax);
14855: printf(" %d", n_filename);
14856: printf(" %d", n_recovery);
14857: printf("\n");
14858: }
14859: }
14860: }
14861: }
14862: function_tests++;
14863: #endif
14864: #endif
14865:
14866: return(test_ret);
14867: }
14868:
14869:
14870: static int
14871: test_xmlSAXParseFileWithData(void) {
14872: int test_ret = 0;
14873:
14874: #if defined(LIBXML_SAX1_ENABLED)
14875: #ifdef LIBXML_SAX1_ENABLED
14876: int mem_base;
14877: xmlDocPtr ret_val;
14878: xmlSAXHandlerPtr sax; /* the SAX handler block */
14879: int n_sax;
14880: const char * filename; /* the filename */
14881: int n_filename;
14882: int recovery; /* work in recovery mode, i.e. tries to read no Well Formed documents */
14883: int n_recovery;
14884: void * data; /* the userdata */
14885: int n_data;
14886:
14887: for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14888: for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14889: for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
14890: for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
14891: mem_base = xmlMemBlocks();
14892: sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14893: filename = gen_filepath(n_filename, 1);
14894: recovery = gen_int(n_recovery, 2);
14895: data = gen_userdata(n_data, 3);
14896:
14897: ret_val = xmlSAXParseFileWithData(sax, filename, recovery, data);
14898: desret_xmlDocPtr(ret_val);
14899: call_tests++;
14900: des_xmlSAXHandlerPtr(n_sax, sax, 0);
14901: des_filepath(n_filename, filename, 1);
14902: des_int(n_recovery, recovery, 2);
14903: des_userdata(n_data, data, 3);
14904: xmlResetLastError();
14905: if (mem_base != xmlMemBlocks()) {
14906: printf("Leak of %d blocks found in xmlSAXParseFileWithData",
14907: xmlMemBlocks() - mem_base);
14908: test_ret++;
14909: printf(" %d", n_sax);
14910: printf(" %d", n_filename);
14911: printf(" %d", n_recovery);
14912: printf(" %d", n_data);
14913: printf("\n");
14914: }
14915: }
14916: }
14917: }
14918: }
14919: function_tests++;
14920: #endif
14921: #endif
14922:
14923: return(test_ret);
14924: }
14925:
14926:
14927: static int
14928: test_xmlSAXParseMemory(void) {
14929: int test_ret = 0;
14930:
14931: #if defined(LIBXML_SAX1_ENABLED)
14932: #ifdef LIBXML_SAX1_ENABLED
14933: int mem_base;
14934: xmlDocPtr ret_val;
14935: xmlSAXHandlerPtr sax; /* the SAX handler block */
14936: int n_sax;
14937: char * buffer; /* an pointer to a char array */
14938: int n_buffer;
14939: int size; /* the size of the array */
14940: int n_size;
14941: int recovery; /* work in recovery mode, i.e. tries to read not Well Formed documents */
14942: int n_recovery;
14943:
14944: for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14945: for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
14946: for (n_size = 0;n_size < gen_nb_int;n_size++) {
14947: for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
14948: mem_base = xmlMemBlocks();
14949: sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14950: buffer = gen_const_char_ptr(n_buffer, 1);
14951: size = gen_int(n_size, 2);
14952: recovery = gen_int(n_recovery, 3);
14953:
14954: ret_val = xmlSAXParseMemory(sax, (const char *)buffer, size, recovery);
14955: desret_xmlDocPtr(ret_val);
14956: call_tests++;
14957: des_xmlSAXHandlerPtr(n_sax, sax, 0);
14958: des_const_char_ptr(n_buffer, (const char *)buffer, 1);
14959: des_int(n_size, size, 2);
14960: des_int(n_recovery, recovery, 3);
14961: xmlResetLastError();
14962: if (mem_base != xmlMemBlocks()) {
14963: printf("Leak of %d blocks found in xmlSAXParseMemory",
14964: xmlMemBlocks() - mem_base);
14965: test_ret++;
14966: printf(" %d", n_sax);
14967: printf(" %d", n_buffer);
14968: printf(" %d", n_size);
14969: printf(" %d", n_recovery);
14970: printf("\n");
14971: }
14972: }
14973: }
14974: }
14975: }
14976: function_tests++;
14977: #endif
14978: #endif
14979:
14980: return(test_ret);
14981: }
14982:
14983:
14984: static int
14985: test_xmlSAXParseMemoryWithData(void) {
14986: int test_ret = 0;
14987:
14988: #if defined(LIBXML_SAX1_ENABLED)
14989: #ifdef LIBXML_SAX1_ENABLED
14990: int mem_base;
14991: xmlDocPtr ret_val;
14992: xmlSAXHandlerPtr sax; /* the SAX handler block */
14993: int n_sax;
14994: char * buffer; /* an pointer to a char array */
14995: int n_buffer;
14996: int size; /* the size of the array */
14997: int n_size;
14998: int recovery; /* work in recovery mode, i.e. tries to read no Well Formed documents */
14999: int n_recovery;
15000: void * data; /* the userdata */
15001: int n_data;
15002:
15003: for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
15004: for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
15005: for (n_size = 0;n_size < gen_nb_int;n_size++) {
15006: for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
15007: for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
15008: mem_base = xmlMemBlocks();
15009: sax = gen_xmlSAXHandlerPtr(n_sax, 0);
15010: buffer = gen_const_char_ptr(n_buffer, 1);
15011: size = gen_int(n_size, 2);
15012: recovery = gen_int(n_recovery, 3);
15013: data = gen_userdata(n_data, 4);
15014:
15015: ret_val = xmlSAXParseMemoryWithData(sax, (const char *)buffer, size, recovery, data);
15016: desret_xmlDocPtr(ret_val);
15017: call_tests++;
15018: des_xmlSAXHandlerPtr(n_sax, sax, 0);
15019: des_const_char_ptr(n_buffer, (const char *)buffer, 1);
15020: des_int(n_size, size, 2);
15021: des_int(n_recovery, recovery, 3);
15022: des_userdata(n_data, data, 4);
15023: xmlResetLastError();
15024: if (mem_base != xmlMemBlocks()) {
15025: printf("Leak of %d blocks found in xmlSAXParseMemoryWithData",
15026: xmlMemBlocks() - mem_base);
15027: test_ret++;
15028: printf(" %d", n_sax);
15029: printf(" %d", n_buffer);
15030: printf(" %d", n_size);
15031: printf(" %d", n_recovery);
15032: printf(" %d", n_data);
15033: printf("\n");
15034: }
15035: }
15036: }
15037: }
15038: }
15039: }
15040: function_tests++;
15041: #endif
15042: #endif
15043:
15044: return(test_ret);
15045: }
15046:
15047:
15048: static int
15049: test_xmlSAXUserParseFile(void) {
15050: int test_ret = 0;
15051:
15052: #if defined(LIBXML_SAX1_ENABLED)
15053: #ifdef LIBXML_SAX1_ENABLED
15054: int mem_base;
15055: int ret_val;
15056: xmlSAXHandlerPtr sax; /* a SAX handler */
15057: int n_sax;
15058: void * user_data; /* The user data returned on SAX callbacks */
15059: int n_user_data;
15060: const char * filename; /* a file name */
15061: int n_filename;
15062:
15063: for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
15064: for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
15065: for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
15066: mem_base = xmlMemBlocks();
15067: sax = gen_xmlSAXHandlerPtr(n_sax, 0);
15068: user_data = gen_userdata(n_user_data, 1);
15069: filename = gen_filepath(n_filename, 2);
15070:
15071: #ifdef LIBXML_SAX1_ENABLED
15072: if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL;
15073: #endif
15074:
15075:
15076: ret_val = xmlSAXUserParseFile(sax, user_data, filename);
15077: desret_int(ret_val);
15078: call_tests++;
15079: des_xmlSAXHandlerPtr(n_sax, sax, 0);
15080: des_userdata(n_user_data, user_data, 1);
15081: des_filepath(n_filename, filename, 2);
15082: xmlResetLastError();
15083: if (mem_base != xmlMemBlocks()) {
15084: printf("Leak of %d blocks found in xmlSAXUserParseFile",
15085: xmlMemBlocks() - mem_base);
15086: test_ret++;
15087: printf(" %d", n_sax);
15088: printf(" %d", n_user_data);
15089: printf(" %d", n_filename);
15090: printf("\n");
15091: }
15092: }
15093: }
15094: }
15095: function_tests++;
15096: #endif
15097: #endif
15098:
15099: return(test_ret);
15100: }
15101:
15102:
15103: static int
15104: test_xmlSAXUserParseMemory(void) {
15105: int test_ret = 0;
15106:
15107: #if defined(LIBXML_SAX1_ENABLED)
15108: #ifdef LIBXML_SAX1_ENABLED
15109: int mem_base;
15110: int ret_val;
15111: xmlSAXHandlerPtr sax; /* a SAX handler */
15112: int n_sax;
15113: void * user_data; /* The user data returned on SAX callbacks */
15114: int n_user_data;
15115: char * buffer; /* an in-memory XML document input */
15116: int n_buffer;
15117: int size; /* the length of the XML document in bytes */
15118: int n_size;
15119:
15120: for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
15121: for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
15122: for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
15123: for (n_size = 0;n_size < gen_nb_int;n_size++) {
15124: mem_base = xmlMemBlocks();
15125: sax = gen_xmlSAXHandlerPtr(n_sax, 0);
15126: user_data = gen_userdata(n_user_data, 1);
15127: buffer = gen_const_char_ptr(n_buffer, 2);
15128: size = gen_int(n_size, 3);
15129:
15130: #ifdef LIBXML_SAX1_ENABLED
15131: if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL;
15132: #endif
15133:
15134:
15135: ret_val = xmlSAXUserParseMemory(sax, user_data, (const char *)buffer, size);
15136: desret_int(ret_val);
15137: call_tests++;
15138: des_xmlSAXHandlerPtr(n_sax, sax, 0);
15139: des_userdata(n_user_data, user_data, 1);
15140: des_const_char_ptr(n_buffer, (const char *)buffer, 2);
15141: des_int(n_size, size, 3);
15142: xmlResetLastError();
15143: if (mem_base != xmlMemBlocks()) {
15144: printf("Leak of %d blocks found in xmlSAXUserParseMemory",
15145: xmlMemBlocks() - mem_base);
15146: test_ret++;
15147: printf(" %d", n_sax);
15148: printf(" %d", n_user_data);
15149: printf(" %d", n_buffer);
15150: printf(" %d", n_size);
15151: printf("\n");
15152: }
15153: }
15154: }
15155: }
15156: }
15157: function_tests++;
15158: #endif
15159: #endif
15160:
15161: return(test_ret);
15162: }
15163:
15164:
15165: static int
15166: test_xmlSetExternalEntityLoader(void) {
15167: int test_ret = 0;
15168:
15169:
15170: /* missing type support */
15171: return(test_ret);
15172: }
15173:
15174:
15175: static int
15176: test_xmlSetFeature(void) {
15177: int test_ret = 0;
15178:
15179: #if defined(LIBXML_LEGACY_ENABLED)
15180: #ifdef LIBXML_LEGACY_ENABLED
15181: int mem_base;
15182: int ret_val;
15183: xmlParserCtxtPtr ctxt; /* an XML/HTML parser context */
15184: int n_ctxt;
15185: char * name; /* the feature name */
15186: int n_name;
15187: void * value; /* pointer to the location of the new value */
15188: int n_value;
15189:
15190: for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15191: for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
15192: for (n_value = 0;n_value < gen_nb_void_ptr;n_value++) {
15193: mem_base = xmlMemBlocks();
15194: ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15195: name = gen_const_char_ptr(n_name, 1);
15196: value = gen_void_ptr(n_value, 2);
15197:
15198: ret_val = xmlSetFeature(ctxt, (const char *)name, value);
15199: desret_int(ret_val);
15200: call_tests++;
15201: des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15202: des_const_char_ptr(n_name, (const char *)name, 1);
15203: des_void_ptr(n_value, value, 2);
15204: xmlResetLastError();
15205: if (mem_base != xmlMemBlocks()) {
15206: printf("Leak of %d blocks found in xmlSetFeature",
15207: xmlMemBlocks() - mem_base);
15208: test_ret++;
15209: printf(" %d", n_ctxt);
15210: printf(" %d", n_name);
15211: printf(" %d", n_value);
15212: printf("\n");
15213: }
15214: }
15215: }
15216: }
15217: function_tests++;
15218: #endif
15219: #endif
15220:
15221: return(test_ret);
15222: }
15223:
15224:
15225: static int
15226: test_xmlSetupParserForBuffer(void) {
15227: int test_ret = 0;
15228:
15229: #if defined(LIBXML_SAX1_ENABLED)
15230: #ifdef LIBXML_SAX1_ENABLED
15231: int mem_base;
15232: xmlParserCtxtPtr ctxt; /* an XML parser context */
15233: int n_ctxt;
15234: xmlChar * buffer; /* a xmlChar * buffer */
15235: int n_buffer;
15236: const char * filename; /* a file name */
15237: int n_filename;
15238:
15239: for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15240: for (n_buffer = 0;n_buffer < gen_nb_const_xmlChar_ptr;n_buffer++) {
15241: for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
15242: mem_base = xmlMemBlocks();
15243: ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15244: buffer = gen_const_xmlChar_ptr(n_buffer, 1);
15245: filename = gen_filepath(n_filename, 2);
15246:
15247: xmlSetupParserForBuffer(ctxt, (const xmlChar *)buffer, filename);
15248: call_tests++;
15249: des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15250: des_const_xmlChar_ptr(n_buffer, (const xmlChar *)buffer, 1);
15251: des_filepath(n_filename, filename, 2);
15252: xmlResetLastError();
15253: if (mem_base != xmlMemBlocks()) {
15254: printf("Leak of %d blocks found in xmlSetupParserForBuffer",
15255: xmlMemBlocks() - mem_base);
15256: test_ret++;
15257: printf(" %d", n_ctxt);
15258: printf(" %d", n_buffer);
15259: printf(" %d", n_filename);
15260: printf("\n");
15261: }
15262: }
15263: }
15264: }
15265: function_tests++;
15266: #endif
15267: #endif
15268:
15269: return(test_ret);
15270: }
15271:
15272:
15273: static int
15274: test_xmlStopParser(void) {
15275: int test_ret = 0;
15276:
15277: #ifdef LIBXML_PUSH_ENABLED
15278: int mem_base;
15279: xmlParserCtxtPtr ctxt; /* an XML parser context */
15280: int n_ctxt;
15281:
15282: for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15283: mem_base = xmlMemBlocks();
15284: ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15285:
15286: xmlStopParser(ctxt);
15287: call_tests++;
15288: des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15289: xmlResetLastError();
15290: if (mem_base != xmlMemBlocks()) {
15291: printf("Leak of %d blocks found in xmlStopParser",
15292: xmlMemBlocks() - mem_base);
15293: test_ret++;
15294: printf(" %d", n_ctxt);
15295: printf("\n");
15296: }
15297: }
15298: function_tests++;
15299: #endif
15300:
15301: return(test_ret);
15302: }
15303:
15304:
15305: static int
15306: test_xmlSubstituteEntitiesDefault(void) {
15307: int test_ret = 0;
15308:
15309: int mem_base;
15310: int ret_val;
15311: int val; /* int 0 or 1 */
15312: int n_val;
15313:
15314: for (n_val = 0;n_val < gen_nb_int;n_val++) {
15315: mem_base = xmlMemBlocks();
15316: val = gen_int(n_val, 0);
15317:
15318: ret_val = xmlSubstituteEntitiesDefault(val);
15319: desret_int(ret_val);
15320: call_tests++;
15321: des_int(n_val, val, 0);
15322: xmlResetLastError();
15323: if (mem_base != xmlMemBlocks()) {
15324: printf("Leak of %d blocks found in xmlSubstituteEntitiesDefault",
15325: xmlMemBlocks() - mem_base);
15326: test_ret++;
15327: printf(" %d", n_val);
15328: printf("\n");
15329: }
15330: }
15331: function_tests++;
15332:
15333: return(test_ret);
15334: }
15335:
15336: static int
15337: test_parser(void) {
15338: int test_ret = 0;
15339:
15340: if (quiet == 0) printf("Testing parser : 61 of 70 functions ...\n");
15341: test_ret += test_xmlByteConsumed();
15342: test_ret += test_xmlClearNodeInfoSeq();
15343: test_ret += test_xmlClearParserCtxt();
15344: test_ret += test_xmlCreateDocParserCtxt();
15345: test_ret += test_xmlCreatePushParserCtxt();
15346: test_ret += test_xmlCtxtReadDoc();
15347: test_ret += test_xmlCtxtReadFile();
15348: test_ret += test_xmlCtxtReadMemory();
15349: test_ret += test_xmlCtxtReset();
15350: test_ret += test_xmlCtxtResetPush();
15351: test_ret += test_xmlCtxtUseOptions();
15352: test_ret += test_xmlGetExternalEntityLoader();
15353: test_ret += test_xmlGetFeature();
15354: test_ret += test_xmlGetFeaturesList();
15355: test_ret += test_xmlHasFeature();
15356: test_ret += test_xmlIOParseDTD();
15357: test_ret += test_xmlInitNodeInfoSeq();
15358: test_ret += test_xmlInitParser();
15359: test_ret += test_xmlInitParserCtxt();
15360: test_ret += test_xmlKeepBlanksDefault();
15361: test_ret += test_xmlLineNumbersDefault();
15362: test_ret += test_xmlLoadExternalEntity();
15363: test_ret += test_xmlNewIOInputStream();
15364: test_ret += test_xmlNewParserCtxt();
15365: test_ret += test_xmlParseBalancedChunkMemory();
15366: test_ret += test_xmlParseBalancedChunkMemoryRecover();
15367: test_ret += test_xmlParseChunk();
15368: test_ret += test_xmlParseCtxtExternalEntity();
15369: test_ret += test_xmlParseDTD();
15370: test_ret += test_xmlParseDoc();
15371: test_ret += test_xmlParseDocument();
15372: test_ret += test_xmlParseEntity();
15373: test_ret += test_xmlParseExtParsedEnt();
15374: test_ret += test_xmlParseExternalEntity();
15375: test_ret += test_xmlParseFile();
15376: test_ret += test_xmlParseInNodeContext();
15377: test_ret += test_xmlParseMemory();
15378: test_ret += test_xmlParserAddNodeInfo();
15379: test_ret += test_xmlParserFindNodeInfo();
15380: test_ret += test_xmlParserFindNodeInfoIndex();
15381: test_ret += test_xmlParserInputGrow();
15382: test_ret += test_xmlParserInputRead();
15383: test_ret += test_xmlPedanticParserDefault();
15384: test_ret += test_xmlReadDoc();
15385: test_ret += test_xmlReadFile();
15386: test_ret += test_xmlReadMemory();
15387: test_ret += test_xmlRecoverDoc();
15388: test_ret += test_xmlRecoverFile();
15389: test_ret += test_xmlRecoverMemory();
15390: test_ret += test_xmlSAXParseDTD();
15391: test_ret += test_xmlSAXParseDoc();
15392: test_ret += test_xmlSAXParseEntity();
15393: test_ret += test_xmlSAXParseFile();
15394: test_ret += test_xmlSAXParseFileWithData();
15395: test_ret += test_xmlSAXParseMemory();
15396: test_ret += test_xmlSAXParseMemoryWithData();
15397: test_ret += test_xmlSAXUserParseFile();
15398: test_ret += test_xmlSAXUserParseMemory();
15399: test_ret += test_xmlSetExternalEntityLoader();
15400: test_ret += test_xmlSetFeature();
15401: test_ret += test_xmlSetupParserForBuffer();
15402: test_ret += test_xmlStopParser();
15403: test_ret += test_xmlSubstituteEntitiesDefault();
15404:
15405: if (test_ret != 0)
15406: printf("Module parser: %d errors\n", test_ret);
15407: return(test_ret);
15408: }
15409:
15410: static int
15411: test_htmlCreateFileParserCtxt(void) {
15412: int test_ret = 0;
15413:
15414: #if defined(LIBXML_HTML_ENABLED)
15415: int mem_base;
15416: htmlParserCtxtPtr ret_val;
15417: const char * filename; /* the filename */
15418: int n_filename;
15419: char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
15420: int n_encoding;
15421:
15422: for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
15423: for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
15424: mem_base = xmlMemBlocks();
15425: filename = gen_fileoutput(n_filename, 0);
15426: encoding = gen_const_char_ptr(n_encoding, 1);
15427:
15428: ret_val = htmlCreateFileParserCtxt(filename, (const char *)encoding);
15429: desret_htmlParserCtxtPtr(ret_val);
15430: call_tests++;
15431: des_fileoutput(n_filename, filename, 0);
15432: des_const_char_ptr(n_encoding, (const char *)encoding, 1);
15433: xmlResetLastError();
15434: if (mem_base != xmlMemBlocks()) {
15435: printf("Leak of %d blocks found in htmlCreateFileParserCtxt",
15436: xmlMemBlocks() - mem_base);
15437: test_ret++;
15438: printf(" %d", n_filename);
15439: printf(" %d", n_encoding);
15440: printf("\n");
15441: }
15442: }
15443: }
15444: function_tests++;
15445: #endif
15446:
15447: return(test_ret);
15448: }
15449:
15450:
15451: static int
15452: test_htmlInitAutoClose(void) {
15453: int test_ret = 0;
15454:
15455: #if defined(LIBXML_HTML_ENABLED)
15456: int mem_base;
15457:
15458: mem_base = xmlMemBlocks();
15459:
15460: htmlInitAutoClose();
15461: call_tests++;
15462: xmlResetLastError();
15463: if (mem_base != xmlMemBlocks()) {
15464: printf("Leak of %d blocks found in htmlInitAutoClose",
15465: xmlMemBlocks() - mem_base);
15466: test_ret++;
15467: printf("\n");
15468: }
15469: function_tests++;
15470: #endif
15471:
15472: return(test_ret);
15473: }
15474:
15475:
15476: static int
15477: test_inputPop(void) {
15478: int test_ret = 0;
15479:
15480: int mem_base;
15481: xmlParserInputPtr ret_val;
15482: xmlParserCtxtPtr ctxt; /* an XML parser context */
15483: int n_ctxt;
15484:
15485: for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15486: mem_base = xmlMemBlocks();
15487: ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15488:
15489: ret_val = inputPop(ctxt);
15490: desret_xmlParserInputPtr(ret_val);
15491: call_tests++;
15492: des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15493: xmlResetLastError();
15494: if (mem_base != xmlMemBlocks()) {
15495: printf("Leak of %d blocks found in inputPop",
15496: xmlMemBlocks() - mem_base);
15497: test_ret++;
15498: printf(" %d", n_ctxt);
15499: printf("\n");
15500: }
15501: }
15502: function_tests++;
15503:
15504: return(test_ret);
15505: }
15506:
15507:
15508: static int
15509: test_inputPush(void) {
15510: int test_ret = 0;
15511:
15512: int mem_base;
15513: int ret_val;
15514: xmlParserCtxtPtr ctxt; /* an XML parser context */
15515: int n_ctxt;
15516: xmlParserInputPtr value; /* the parser input */
15517: int n_value;
15518:
15519: for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15520: for (n_value = 0;n_value < gen_nb_xmlParserInputPtr;n_value++) {
15521: mem_base = xmlMemBlocks();
15522: ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15523: value = gen_xmlParserInputPtr(n_value, 1);
15524:
15525: ret_val = inputPush(ctxt, value);
15526: desret_int(ret_val);
15527: call_tests++;
15528: des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15529: des_xmlParserInputPtr(n_value, value, 1);
15530: xmlResetLastError();
15531: if (mem_base != xmlMemBlocks()) {
15532: printf("Leak of %d blocks found in inputPush",
15533: xmlMemBlocks() - mem_base);
15534: test_ret++;
15535: printf(" %d", n_ctxt);
15536: printf(" %d", n_value);
15537: printf("\n");
15538: }
15539: }
15540: }
15541: function_tests++;
15542:
15543: return(test_ret);
15544: }
15545:
15546:
15547: static int
15548: test_namePop(void) {
15549: int test_ret = 0;
15550:
15551: int mem_base;
15552: const xmlChar * ret_val;
15553: xmlParserCtxtPtr ctxt; /* an XML parser context */
15554: int n_ctxt;
15555:
15556: for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15557: mem_base = xmlMemBlocks();
15558: ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15559:
15560: ret_val = namePop(ctxt);
15561: desret_const_xmlChar_ptr(ret_val);
15562: call_tests++;
15563: des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15564: xmlResetLastError();
15565: if (mem_base != xmlMemBlocks()) {
15566: printf("Leak of %d blocks found in namePop",
15567: xmlMemBlocks() - mem_base);
15568: test_ret++;
15569: printf(" %d", n_ctxt);
15570: printf("\n");
15571: }
15572: }
15573: function_tests++;
15574:
15575: return(test_ret);
15576: }
15577:
15578:
15579: static int
15580: test_namePush(void) {
15581: int test_ret = 0;
15582:
15583: int mem_base;
15584: int ret_val;
15585: xmlParserCtxtPtr ctxt; /* an XML parser context */
15586: int n_ctxt;
15587: xmlChar * value; /* the element name */
15588: int n_value;
15589:
15590: for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15591: for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
15592: mem_base = xmlMemBlocks();
15593: ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15594: value = gen_const_xmlChar_ptr(n_value, 1);
15595:
15596: ret_val = namePush(ctxt, (const xmlChar *)value);
15597: desret_int(ret_val);
15598: call_tests++;
15599: des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15600: des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
15601: xmlResetLastError();
15602: if (mem_base != xmlMemBlocks()) {
15603: printf("Leak of %d blocks found in namePush",
15604: xmlMemBlocks() - mem_base);
15605: test_ret++;
15606: printf(" %d", n_ctxt);
15607: printf(" %d", n_value);
15608: printf("\n");
15609: }
15610: }
15611: }
15612: function_tests++;
15613:
15614: return(test_ret);
15615: }
15616:
15617:
15618: static int
15619: test_nodePop(void) {
15620: int test_ret = 0;
15621:
15622: int mem_base;
15623: xmlNodePtr ret_val;
15624: xmlParserCtxtPtr ctxt; /* an XML parser context */
15625: int n_ctxt;
15626:
15627: for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15628: mem_base = xmlMemBlocks();
15629: ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15630:
15631: ret_val = nodePop(ctxt);
15632: desret_xmlNodePtr(ret_val);
15633: call_tests++;
15634: des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15635: xmlResetLastError();
15636: if (mem_base != xmlMemBlocks()) {
15637: printf("Leak of %d blocks found in nodePop",
15638: xmlMemBlocks() - mem_base);
15639: test_ret++;
15640: printf(" %d", n_ctxt);
15641: printf("\n");
15642: }
15643: }
15644: function_tests++;
15645:
15646: return(test_ret);
15647: }
15648:
15649:
15650: static int
15651: test_nodePush(void) {
15652: int test_ret = 0;
15653:
15654: int mem_base;
15655: int ret_val;
15656: xmlParserCtxtPtr ctxt; /* an XML parser context */
15657: int n_ctxt;
15658: xmlNodePtr value; /* the element node */
15659: int n_value;
15660:
15661: for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15662: for (n_value = 0;n_value < gen_nb_xmlNodePtr;n_value++) {
15663: mem_base = xmlMemBlocks();
15664: ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15665: value = gen_xmlNodePtr(n_value, 1);
15666:
15667: ret_val = nodePush(ctxt, value);
15668: desret_int(ret_val);
15669: call_tests++;
15670: des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15671: des_xmlNodePtr(n_value, value, 1);
15672: xmlResetLastError();
15673: if (mem_base != xmlMemBlocks()) {
15674: printf("Leak of %d blocks found in nodePush",
15675: xmlMemBlocks() - mem_base);
15676: test_ret++;
15677: printf(" %d", n_ctxt);
15678: printf(" %d", n_value);
15679: printf("\n");
15680: }
15681: }
15682: }
15683: function_tests++;
15684:
15685: return(test_ret);
15686: }
15687:
15688:
15689: static int
15690: test_xmlCheckLanguageID(void) {
15691: int test_ret = 0;
15692:
15693: int mem_base;
15694: int ret_val;
15695: xmlChar * lang; /* pointer to the string value */
15696: int n_lang;
15697:
15698: for (n_lang = 0;n_lang < gen_nb_const_xmlChar_ptr;n_lang++) {
15699: mem_base = xmlMemBlocks();
15700: lang = gen_const_xmlChar_ptr(n_lang, 0);
15701:
15702: ret_val = xmlCheckLanguageID((const xmlChar *)lang);
15703: desret_int(ret_val);
15704: call_tests++;
15705: des_const_xmlChar_ptr(n_lang, (const xmlChar *)lang, 0);
15706: xmlResetLastError();
15707: if (mem_base != xmlMemBlocks()) {
15708: printf("Leak of %d blocks found in xmlCheckLanguageID",
15709: xmlMemBlocks() - mem_base);
15710: test_ret++;
15711: printf(" %d", n_lang);
15712: printf("\n");
15713: }
15714: }
15715: function_tests++;
15716:
15717: return(test_ret);
15718: }
15719:
15720:
15721: static int
15722: test_xmlCopyChar(void) {
15723: int test_ret = 0;
15724:
15725: int mem_base;
15726: int ret_val;
15727: int len; /* Ignored, compatibility */
15728: int n_len;
15729: xmlChar * out; /* pointer to an array of xmlChar */
15730: int n_out;
15731: int val; /* the char value */
15732: int n_val;
15733:
15734: for (n_len = 0;n_len < gen_nb_int;n_len++) {
15735: for (n_out = 0;n_out < gen_nb_xmlChar_ptr;n_out++) {
15736: for (n_val = 0;n_val < gen_nb_int;n_val++) {
15737: mem_base = xmlMemBlocks();
15738: len = gen_int(n_len, 0);
15739: out = gen_xmlChar_ptr(n_out, 1);
15740: val = gen_int(n_val, 2);
15741:
15742: ret_val = xmlCopyChar(len, out, val);
15743: desret_int(ret_val);
15744: call_tests++;
15745: des_int(n_len, len, 0);
15746: des_xmlChar_ptr(n_out, out, 1);
15747: des_int(n_val, val, 2);
15748: xmlResetLastError();
15749: if (mem_base != xmlMemBlocks()) {
15750: printf("Leak of %d blocks found in xmlCopyChar",
15751: xmlMemBlocks() - mem_base);
15752: test_ret++;
15753: printf(" %d", n_len);
15754: printf(" %d", n_out);
15755: printf(" %d", n_val);
15756: printf("\n");
15757: }
15758: }
15759: }
15760: }
15761: function_tests++;
15762:
15763: return(test_ret);
15764: }
15765:
15766:
15767: static int
15768: test_xmlCopyCharMultiByte(void) {
15769: int test_ret = 0;
15770:
15771: int mem_base;
15772: int ret_val;
15773: xmlChar * out; /* pointer to an array of xmlChar */
15774: int n_out;
15775: int val; /* the char value */
15776: int n_val;
15777:
15778: for (n_out = 0;n_out < gen_nb_xmlChar_ptr;n_out++) {
15779: for (n_val = 0;n_val < gen_nb_int;n_val++) {
15780: mem_base = xmlMemBlocks();
15781: out = gen_xmlChar_ptr(n_out, 0);
15782: val = gen_int(n_val, 1);
15783:
15784: ret_val = xmlCopyCharMultiByte(out, val);
15785: desret_int(ret_val);
15786: call_tests++;
15787: des_xmlChar_ptr(n_out, out, 0);
15788: des_int(n_val, val, 1);
15789: xmlResetLastError();
15790: if (mem_base != xmlMemBlocks()) {
15791: printf("Leak of %d blocks found in xmlCopyCharMultiByte",
15792: xmlMemBlocks() - mem_base);
15793: test_ret++;
15794: printf(" %d", n_out);
15795: printf(" %d", n_val);
15796: printf("\n");
15797: }
15798: }
15799: }
15800: function_tests++;
15801:
15802: return(test_ret);
15803: }
15804:
15805:
15806: static int
15807: test_xmlCreateEntityParserCtxt(void) {
15808: int test_ret = 0;
15809:
15810: int mem_base;
15811: xmlParserCtxtPtr ret_val;
15812: xmlChar * URL; /* the entity URL */
15813: int n_URL;
15814: xmlChar * ID; /* the entity PUBLIC ID */
15815: int n_ID;
15816: xmlChar * base; /* a possible base for the target URI */
15817: int n_base;
15818:
15819: for (n_URL = 0;n_URL < gen_nb_const_xmlChar_ptr;n_URL++) {
15820: for (n_ID = 0;n_ID < gen_nb_const_xmlChar_ptr;n_ID++) {
15821: for (n_base = 0;n_base < gen_nb_const_xmlChar_ptr;n_base++) {
15822: mem_base = xmlMemBlocks();
15823: URL = gen_const_xmlChar_ptr(n_URL, 0);
15824: ID = gen_const_xmlChar_ptr(n_ID, 1);
15825: base = gen_const_xmlChar_ptr(n_base, 2);
15826:
15827: ret_val = xmlCreateEntityParserCtxt((const xmlChar *)URL, (const xmlChar *)ID, (const xmlChar *)base);
15828: desret_xmlParserCtxtPtr(ret_val);
15829: call_tests++;
15830: des_const_xmlChar_ptr(n_URL, (const xmlChar *)URL, 0);
15831: des_const_xmlChar_ptr(n_ID, (const xmlChar *)ID, 1);
15832: des_const_xmlChar_ptr(n_base, (const xmlChar *)base, 2);
15833: xmlResetLastError();
15834: if (mem_base != xmlMemBlocks()) {
15835: printf("Leak of %d blocks found in xmlCreateEntityParserCtxt",
15836: xmlMemBlocks() - mem_base);
15837: test_ret++;
15838: printf(" %d", n_URL);
15839: printf(" %d", n_ID);
15840: printf(" %d", n_base);
15841: printf("\n");
15842: }
15843: }
15844: }
15845: }
15846: function_tests++;
15847:
15848: return(test_ret);
15849: }
15850:
15851:
15852: static int
15853: test_xmlCreateFileParserCtxt(void) {
15854: int test_ret = 0;
15855:
15856: int mem_base;
15857: xmlParserCtxtPtr ret_val;
15858: const char * filename; /* the filename */
15859: int n_filename;
15860:
15861: for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
15862: mem_base = xmlMemBlocks();
15863: filename = gen_fileoutput(n_filename, 0);
15864:
15865: ret_val = xmlCreateFileParserCtxt(filename);
15866: desret_xmlParserCtxtPtr(ret_val);
15867: call_tests++;
15868: des_fileoutput(n_filename, filename, 0);
15869: xmlResetLastError();
15870: if (mem_base != xmlMemBlocks()) {
15871: printf("Leak of %d blocks found in xmlCreateFileParserCtxt",
15872: xmlMemBlocks() - mem_base);
15873: test_ret++;
15874: printf(" %d", n_filename);
15875: printf("\n");
15876: }
15877: }
15878: function_tests++;
15879:
15880: return(test_ret);
15881: }
15882:
15883:
15884: static int
15885: test_xmlCreateMemoryParserCtxt(void) {
15886: int test_ret = 0;
15887:
15888: int mem_base;
15889: xmlParserCtxtPtr ret_val;
15890: char * buffer; /* a pointer to a char array */
15891: int n_buffer;
15892: int size; /* the size of the array */
15893: int n_size;
15894:
15895: for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
15896: for (n_size = 0;n_size < gen_nb_int;n_size++) {
15897: mem_base = xmlMemBlocks();
15898: buffer = gen_const_char_ptr(n_buffer, 0);
15899: size = gen_int(n_size, 1);
15900:
15901: ret_val = xmlCreateMemoryParserCtxt((const char *)buffer, size);
15902: desret_xmlParserCtxtPtr(ret_val);
15903: call_tests++;
15904: des_const_char_ptr(n_buffer, (const char *)buffer, 0);
15905: des_int(n_size, size, 1);
15906: xmlResetLastError();
15907: if (mem_base != xmlMemBlocks()) {
15908: printf("Leak of %d blocks found in xmlCreateMemoryParserCtxt",
15909: xmlMemBlocks() - mem_base);
15910: test_ret++;
15911: printf(" %d", n_buffer);
15912: printf(" %d", n_size);
15913: printf("\n");
15914: }
15915: }
15916: }
15917: function_tests++;
15918:
15919: return(test_ret);
15920: }
15921:
15922:
15923: static int
15924: test_xmlCreateURLParserCtxt(void) {
15925: int test_ret = 0;
15926:
15927: int mem_base;
15928: xmlParserCtxtPtr ret_val;
15929: const char * filename; /* the filename or URL */
15930: int n_filename;
15931: int options; /* a combination of xmlParserOption */
15932: int n_options;
15933:
15934: for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
15935: for (n_options = 0;n_options < gen_nb_int;n_options++) {
15936: mem_base = xmlMemBlocks();
15937: filename = gen_fileoutput(n_filename, 0);
15938: options = gen_int(n_options, 1);
15939:
15940: ret_val = xmlCreateURLParserCtxt(filename, options);
15941: desret_xmlParserCtxtPtr(ret_val);
15942: call_tests++;
15943: des_fileoutput(n_filename, filename, 0);
15944: des_int(n_options, options, 1);
15945: xmlResetLastError();
15946: if (mem_base != xmlMemBlocks()) {
15947: printf("Leak of %d blocks found in xmlCreateURLParserCtxt",
15948: xmlMemBlocks() - mem_base);
15949: test_ret++;
15950: printf(" %d", n_filename);
15951: printf(" %d", n_options);
15952: printf("\n");
15953: }
15954: }
15955: }
15956: function_tests++;
15957:
15958: return(test_ret);
15959: }
15960:
15961:
15962: static int
15963: test_xmlCurrentChar(void) {
15964: int test_ret = 0;
15965:
15966: int mem_base;
15967: int ret_val;
15968: xmlParserCtxtPtr ctxt; /* the XML parser context */
15969: int n_ctxt;
15970: int * len; /* pointer to the length of the char read */
15971: int n_len;
15972:
15973: for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15974: for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
15975: mem_base = xmlMemBlocks();
15976: ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15977: len = gen_int_ptr(n_len, 1);
15978:
15979: ret_val = xmlCurrentChar(ctxt, len);
15980: desret_int(ret_val);
15981: call_tests++;
15982: des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15983: des_int_ptr(n_len, len, 1);
15984: xmlResetLastError();
15985: if (mem_base != xmlMemBlocks()) {
15986: printf("Leak of %d blocks found in xmlCurrentChar",
15987: xmlMemBlocks() - mem_base);
15988: test_ret++;
15989: printf(" %d", n_ctxt);
15990: printf(" %d", n_len);
15991: printf("\n");
15992: }
15993: }
15994: }
15995: function_tests++;
15996:
15997: return(test_ret);
15998: }
15999:
16000:
16001: static int
16002: test_xmlErrMemory(void) {
16003: int test_ret = 0;
16004:
16005: int mem_base;
16006: xmlParserCtxtPtr ctxt; /* an XML parser context */
16007: int n_ctxt;
16008: char * extra; /* extra informations */
16009: int n_extra;
16010:
16011: for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16012: for (n_extra = 0;n_extra < gen_nb_const_char_ptr;n_extra++) {
16013: mem_base = xmlMemBlocks();
16014: ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16015: extra = gen_const_char_ptr(n_extra, 1);
16016:
16017: xmlErrMemory(ctxt, (const char *)extra);
16018: call_tests++;
16019: des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16020: des_const_char_ptr(n_extra, (const char *)extra, 1);
16021: xmlResetLastError();
16022: if (mem_base != xmlMemBlocks()) {
16023: printf("Leak of %d blocks found in xmlErrMemory",
16024: xmlMemBlocks() - mem_base);
16025: test_ret++;
16026: printf(" %d", n_ctxt);
16027: printf(" %d", n_extra);
16028: printf("\n");
16029: }
16030: }
16031: }
16032: function_tests++;
16033:
16034: return(test_ret);
16035: }
16036:
16037:
16038: static int
16039: test_xmlIsLetter(void) {
16040: int test_ret = 0;
16041:
16042: int mem_base;
16043: int ret_val;
16044: int c; /* an unicode character (int) */
16045: int n_c;
16046:
16047: for (n_c = 0;n_c < gen_nb_int;n_c++) {
16048: mem_base = xmlMemBlocks();
16049: c = gen_int(n_c, 0);
16050:
16051: ret_val = xmlIsLetter(c);
16052: desret_int(ret_val);
16053: call_tests++;
16054: des_int(n_c, c, 0);
16055: xmlResetLastError();
16056: if (mem_base != xmlMemBlocks()) {
16057: printf("Leak of %d blocks found in xmlIsLetter",
16058: xmlMemBlocks() - mem_base);
16059: test_ret++;
16060: printf(" %d", n_c);
16061: printf("\n");
16062: }
16063: }
16064: function_tests++;
16065:
16066: return(test_ret);
16067: }
16068:
16069:
16070: static int
16071: test_xmlNewEntityInputStream(void) {
16072: int test_ret = 0;
16073:
16074: int mem_base;
16075: xmlParserInputPtr ret_val;
16076: xmlParserCtxtPtr ctxt; /* an XML parser context */
16077: int n_ctxt;
16078: xmlEntityPtr entity; /* an Entity pointer */
16079: int n_entity;
16080:
16081: for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16082: for (n_entity = 0;n_entity < gen_nb_xmlEntityPtr;n_entity++) {
16083: mem_base = xmlMemBlocks();
16084: ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16085: entity = gen_xmlEntityPtr(n_entity, 1);
16086:
16087: ret_val = xmlNewEntityInputStream(ctxt, entity);
16088: desret_xmlParserInputPtr(ret_val);
16089: call_tests++;
16090: des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16091: des_xmlEntityPtr(n_entity, entity, 1);
16092: xmlResetLastError();
16093: if (mem_base != xmlMemBlocks()) {
16094: printf("Leak of %d blocks found in xmlNewEntityInputStream",
16095: xmlMemBlocks() - mem_base);
16096: test_ret++;
16097: printf(" %d", n_ctxt);
16098: printf(" %d", n_entity);
16099: printf("\n");
16100: }
16101: }
16102: }
16103: function_tests++;
16104:
16105: return(test_ret);
16106: }
16107:
16108:
16109: static int
16110: test_xmlNewInputFromFile(void) {
16111: int test_ret = 0;
16112:
16113: int mem_base;
16114: xmlParserInputPtr ret_val;
16115: xmlParserCtxtPtr ctxt; /* an XML parser context */
16116: int n_ctxt;
16117: const char * filename; /* the filename to use as entity */
16118: int n_filename;
16119:
16120: for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16121: for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
16122: mem_base = xmlMemBlocks();
16123: ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16124: filename = gen_filepath(n_filename, 1);
16125:
16126: ret_val = xmlNewInputFromFile(ctxt, filename);
16127: desret_xmlParserInputPtr(ret_val);
16128: call_tests++;
16129: des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16130: des_filepath(n_filename, filename, 1);
16131: xmlResetLastError();
16132: if (mem_base != xmlMemBlocks()) {
16133: printf("Leak of %d blocks found in xmlNewInputFromFile",
16134: xmlMemBlocks() - mem_base);
16135: test_ret++;
16136: printf(" %d", n_ctxt);
16137: printf(" %d", n_filename);
16138: printf("\n");
16139: }
16140: }
16141: }
16142: function_tests++;
16143:
16144: return(test_ret);
16145: }
16146:
16147:
16148: static int
16149: test_xmlNewInputStream(void) {
16150: int test_ret = 0;
16151:
16152: int mem_base;
16153: xmlParserInputPtr ret_val;
16154: xmlParserCtxtPtr ctxt; /* an XML parser context */
16155: int n_ctxt;
16156:
16157: for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16158: mem_base = xmlMemBlocks();
16159: ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16160:
16161: ret_val = xmlNewInputStream(ctxt);
16162: desret_xmlParserInputPtr(ret_val);
16163: call_tests++;
16164: des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16165: xmlResetLastError();
16166: if (mem_base != xmlMemBlocks()) {
16167: printf("Leak of %d blocks found in xmlNewInputStream",
16168: xmlMemBlocks() - mem_base);
16169: test_ret++;
16170: printf(" %d", n_ctxt);
16171: printf("\n");
16172: }
16173: }
16174: function_tests++;
16175:
16176: return(test_ret);
16177: }
16178:
16179:
16180: static int
16181: test_xmlNewStringInputStream(void) {
16182: int test_ret = 0;
16183:
16184: int mem_base;
16185: xmlParserInputPtr ret_val;
16186: xmlParserCtxtPtr ctxt; /* an XML parser context */
16187: int n_ctxt;
16188: xmlChar * buffer; /* an memory buffer */
16189: int n_buffer;
16190:
16191: for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16192: for (n_buffer = 0;n_buffer < gen_nb_const_xmlChar_ptr;n_buffer++) {
16193: mem_base = xmlMemBlocks();
16194: ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16195: buffer = gen_const_xmlChar_ptr(n_buffer, 1);
16196:
16197: ret_val = xmlNewStringInputStream(ctxt, (const xmlChar *)buffer);
16198: desret_xmlParserInputPtr(ret_val);
16199: call_tests++;
16200: des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16201: des_const_xmlChar_ptr(n_buffer, (const xmlChar *)buffer, 1);
16202: xmlResetLastError();
16203: if (mem_base != xmlMemBlocks()) {
16204: printf("Leak of %d blocks found in xmlNewStringInputStream",
16205: xmlMemBlocks() - mem_base);
16206: test_ret++;
16207: printf(" %d", n_ctxt);
16208: printf(" %d", n_buffer);
16209: printf("\n");
16210: }
16211: }
16212: }
16213: function_tests++;
16214:
16215: return(test_ret);
16216: }
16217:
16218:
16219: static int
16220: test_xmlNextChar(void) {
16221: int test_ret = 0;
16222:
16223: int mem_base;
16224: xmlParserCtxtPtr ctxt; /* the XML parser context */
16225: int n_ctxt;
16226:
16227: for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16228: mem_base = xmlMemBlocks();
16229: ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16230:
16231: xmlNextChar(ctxt);
16232: call_tests++;
16233: des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16234: xmlResetLastError();
16235: if (mem_base != xmlMemBlocks()) {
16236: printf("Leak of %d blocks found in xmlNextChar",
16237: xmlMemBlocks() - mem_base);
16238: test_ret++;
16239: printf(" %d", n_ctxt);
16240: printf("\n");
16241: }
16242: }
16243: function_tests++;
16244:
16245: return(test_ret);
16246: }
16247:
16248:
16249: static int
16250: test_xmlParserInputShrink(void) {
16251: int test_ret = 0;
16252:
16253: int mem_base;
16254: xmlParserInputPtr in; /* an XML parser input */
16255: int n_in;
16256:
16257: for (n_in = 0;n_in < gen_nb_xmlParserInputPtr;n_in++) {
16258: mem_base = xmlMemBlocks();
16259: in = gen_xmlParserInputPtr(n_in, 0);
16260:
16261: xmlParserInputShrink(in);
16262: call_tests++;
16263: des_xmlParserInputPtr(n_in, in, 0);
16264: xmlResetLastError();
16265: if (mem_base != xmlMemBlocks()) {
16266: printf("Leak of %d blocks found in xmlParserInputShrink",
16267: xmlMemBlocks() - mem_base);
16268: test_ret++;
16269: printf(" %d", n_in);
16270: printf("\n");
16271: }
16272: }
16273: function_tests++;
16274:
16275: return(test_ret);
16276: }
16277:
16278:
16279: static int
16280: test_xmlPopInput(void) {
16281: int test_ret = 0;
16282:
16283: int mem_base;
16284: xmlChar ret_val;
16285: xmlParserCtxtPtr ctxt; /* an XML parser context */
16286: int n_ctxt;
16287:
16288: for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16289: mem_base = xmlMemBlocks();
16290: ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16291:
16292: ret_val = xmlPopInput(ctxt);
16293: desret_xmlChar(ret_val);
16294: call_tests++;
16295: des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16296: xmlResetLastError();
16297: if (mem_base != xmlMemBlocks()) {
16298: printf("Leak of %d blocks found in xmlPopInput",
16299: xmlMemBlocks() - mem_base);
16300: test_ret++;
16301: printf(" %d", n_ctxt);
16302: printf("\n");
16303: }
16304: }
16305: function_tests++;
16306:
16307: return(test_ret);
16308: }
16309:
16310:
16311: static int
16312: test_xmlPushInput(void) {
16313: int test_ret = 0;
16314:
16315: int mem_base;
16316: int ret_val;
16317: xmlParserCtxtPtr ctxt; /* an XML parser context */
16318: int n_ctxt;
16319: xmlParserInputPtr input; /* an XML parser input fragment (entity, XML fragment ...). */
16320: int n_input;
16321:
16322: for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16323: for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) {
16324: mem_base = xmlMemBlocks();
16325: ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16326: input = gen_xmlParserInputPtr(n_input, 1);
16327:
16328: ret_val = xmlPushInput(ctxt, input);
16329: desret_int(ret_val);
16330: call_tests++;
16331: des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16332: des_xmlParserInputPtr(n_input, input, 1);
16333: xmlResetLastError();
16334: if (mem_base != xmlMemBlocks()) {
16335: printf("Leak of %d blocks found in xmlPushInput",
16336: xmlMemBlocks() - mem_base);
16337: test_ret++;
16338: printf(" %d", n_ctxt);
16339: printf(" %d", n_input);
16340: printf("\n");
16341: }
16342: }
16343: }
16344: function_tests++;
16345:
16346: return(test_ret);
16347: }
16348:
16349:
16350: static int
16351: test_xmlSetEntityReferenceFunc(void) {
16352: int test_ret = 0;
16353:
16354:
16355: /* missing type support */
16356: return(test_ret);
16357: }
16358:
16359:
16360: static int
16361: test_xmlSplitQName(void) {
16362: int test_ret = 0;
16363:
16364: int mem_base;
16365: xmlChar * ret_val;
16366: xmlParserCtxtPtr ctxt; /* an XML parser context */
16367: int n_ctxt;
16368: xmlChar * name; /* an XML parser context */
16369: int n_name;
16370: xmlChar ** prefix; /* a xmlChar ** */
16371: int n_prefix;
16372:
16373: for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16374: for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
16375: for (n_prefix = 0;n_prefix < gen_nb_xmlChar_ptr_ptr;n_prefix++) {
16376: mem_base = xmlMemBlocks();
16377: ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16378: name = gen_const_xmlChar_ptr(n_name, 1);
16379: prefix = gen_xmlChar_ptr_ptr(n_prefix, 2);
16380:
16381: ret_val = xmlSplitQName(ctxt, (const xmlChar *)name, prefix);
16382: desret_xmlChar_ptr(ret_val);
16383: call_tests++;
16384: des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16385: des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
16386: des_xmlChar_ptr_ptr(n_prefix, prefix, 2);
16387: xmlResetLastError();
16388: if (mem_base != xmlMemBlocks()) {
16389: printf("Leak of %d blocks found in xmlSplitQName",
16390: xmlMemBlocks() - mem_base);
16391: test_ret++;
16392: printf(" %d", n_ctxt);
16393: printf(" %d", n_name);
16394: printf(" %d", n_prefix);
16395: printf("\n");
16396: }
16397: }
16398: }
16399: }
16400: function_tests++;
16401:
16402: return(test_ret);
16403: }
16404:
16405:
16406: static int
16407: test_xmlStringCurrentChar(void) {
16408: int test_ret = 0;
16409:
16410: int mem_base;
16411: int ret_val;
16412: xmlParserCtxtPtr ctxt; /* the XML parser context */
16413: int n_ctxt;
16414: xmlChar * cur; /* pointer to the beginning of the char */
16415: int n_cur;
16416: int * len; /* pointer to the length of the char read */
16417: int n_len;
16418:
16419: for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16420: for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
16421: for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
16422: mem_base = xmlMemBlocks();
16423: ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16424: cur = gen_const_xmlChar_ptr(n_cur, 1);
16425: len = gen_int_ptr(n_len, 2);
16426:
16427: ret_val = xmlStringCurrentChar(ctxt, (const xmlChar *)cur, len);
16428: desret_int(ret_val);
16429: call_tests++;
16430: des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16431: des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1);
16432: des_int_ptr(n_len, len, 2);
16433: xmlResetLastError();
16434: if (mem_base != xmlMemBlocks()) {
16435: printf("Leak of %d blocks found in xmlStringCurrentChar",
16436: xmlMemBlocks() - mem_base);
16437: test_ret++;
16438: printf(" %d", n_ctxt);
16439: printf(" %d", n_cur);
16440: printf(" %d", n_len);
16441: printf("\n");
16442: }
16443: }
16444: }
16445: }
16446: function_tests++;
16447:
16448: return(test_ret);
16449: }
16450:
16451:
16452: static int
16453: test_xmlStringDecodeEntities(void) {
16454: int test_ret = 0;
16455:
16456: int mem_base;
16457: xmlChar * ret_val;
16458: xmlParserCtxtPtr ctxt; /* the parser context */
16459: int n_ctxt;
16460: xmlChar * str; /* the input string */
16461: int n_str;
16462: int what; /* combination of XML_SUBSTITUTE_REF and XML_SUBSTITUTE_PEREF */
16463: int n_what;
16464: xmlChar end; /* an end marker xmlChar, 0 if none */
16465: int n_end;
16466: xmlChar end2; /* an end marker xmlChar, 0 if none */
16467: int n_end2;
16468: xmlChar end3; /* an end marker xmlChar, 0 if none */
16469: int n_end3;
16470:
16471: for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16472: for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
16473: for (n_what = 0;n_what < gen_nb_int;n_what++) {
16474: for (n_end = 0;n_end < gen_nb_xmlChar;n_end++) {
16475: for (n_end2 = 0;n_end2 < gen_nb_xmlChar;n_end2++) {
16476: for (n_end3 = 0;n_end3 < gen_nb_xmlChar;n_end3++) {
16477: mem_base = xmlMemBlocks();
16478: ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16479: str = gen_const_xmlChar_ptr(n_str, 1);
16480: what = gen_int(n_what, 2);
16481: end = gen_xmlChar(n_end, 3);
16482: end2 = gen_xmlChar(n_end2, 4);
16483: end3 = gen_xmlChar(n_end3, 5);
16484:
16485: ret_val = xmlStringDecodeEntities(ctxt, (const xmlChar *)str, what, end, end2, end3);
16486: desret_xmlChar_ptr(ret_val);
16487: call_tests++;
16488: des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16489: des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
16490: des_int(n_what, what, 2);
16491: des_xmlChar(n_end, end, 3);
16492: des_xmlChar(n_end2, end2, 4);
16493: des_xmlChar(n_end3, end3, 5);
16494: xmlResetLastError();
16495: if (mem_base != xmlMemBlocks()) {
16496: printf("Leak of %d blocks found in xmlStringDecodeEntities",
16497: xmlMemBlocks() - mem_base);
16498: test_ret++;
16499: printf(" %d", n_ctxt);
16500: printf(" %d", n_str);
16501: printf(" %d", n_what);
16502: printf(" %d", n_end);
16503: printf(" %d", n_end2);
16504: printf(" %d", n_end3);
16505: printf("\n");
16506: }
16507: }
16508: }
16509: }
16510: }
16511: }
16512: }
16513: function_tests++;
16514:
16515: return(test_ret);
16516: }
16517:
16518:
16519: static int
16520: test_xmlStringLenDecodeEntities(void) {
16521: int test_ret = 0;
16522:
16523: int mem_base;
16524: xmlChar * ret_val;
16525: xmlParserCtxtPtr ctxt; /* the parser context */
16526: int n_ctxt;
16527: xmlChar * str; /* the input string */
16528: int n_str;
16529: int len; /* the string length */
16530: int n_len;
16531: int what; /* combination of XML_SUBSTITUTE_REF and XML_SUBSTITUTE_PEREF */
16532: int n_what;
16533: xmlChar end; /* an end marker xmlChar, 0 if none */
16534: int n_end;
16535: xmlChar end2; /* an end marker xmlChar, 0 if none */
16536: int n_end2;
16537: xmlChar end3; /* an end marker xmlChar, 0 if none */
16538: int n_end3;
16539:
16540: for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16541: for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
16542: for (n_len = 0;n_len < gen_nb_int;n_len++) {
16543: for (n_what = 0;n_what < gen_nb_int;n_what++) {
16544: for (n_end = 0;n_end < gen_nb_xmlChar;n_end++) {
16545: for (n_end2 = 0;n_end2 < gen_nb_xmlChar;n_end2++) {
16546: for (n_end3 = 0;n_end3 < gen_nb_xmlChar;n_end3++) {
16547: mem_base = xmlMemBlocks();
16548: ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16549: str = gen_const_xmlChar_ptr(n_str, 1);
16550: len = gen_int(n_len, 2);
16551: what = gen_int(n_what, 3);
16552: end = gen_xmlChar(n_end, 4);
16553: end2 = gen_xmlChar(n_end2, 5);
16554: end3 = gen_xmlChar(n_end3, 6);
16555:
16556: ret_val = xmlStringLenDecodeEntities(ctxt, (const xmlChar *)str, len, what, end, end2, end3);
16557: desret_xmlChar_ptr(ret_val);
16558: call_tests++;
16559: des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16560: des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
16561: des_int(n_len, len, 2);
16562: des_int(n_what, what, 3);
16563: des_xmlChar(n_end, end, 4);
16564: des_xmlChar(n_end2, end2, 5);
16565: des_xmlChar(n_end3, end3, 6);
16566: xmlResetLastError();
16567: if (mem_base != xmlMemBlocks()) {
16568: printf("Leak of %d blocks found in xmlStringLenDecodeEntities",
16569: xmlMemBlocks() - mem_base);
16570: test_ret++;
16571: printf(" %d", n_ctxt);
16572: printf(" %d", n_str);
16573: printf(" %d", n_len);
16574: printf(" %d", n_what);
16575: printf(" %d", n_end);
16576: printf(" %d", n_end2);
16577: printf(" %d", n_end3);
16578: printf("\n");
16579: }
16580: }
16581: }
16582: }
16583: }
16584: }
16585: }
16586: }
16587: function_tests++;
16588:
16589: return(test_ret);
16590: }
16591:
16592:
16593: static int
16594: test_xmlSwitchEncoding(void) {
16595: int test_ret = 0;
16596:
16597: int mem_base;
16598: int ret_val;
16599: xmlParserCtxtPtr ctxt; /* the parser context */
16600: int n_ctxt;
16601: xmlCharEncoding enc; /* the encoding value (number) */
16602: int n_enc;
16603:
16604: for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16605: for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
16606: mem_base = xmlMemBlocks();
16607: ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16608: enc = gen_xmlCharEncoding(n_enc, 1);
16609:
16610: ret_val = xmlSwitchEncoding(ctxt, enc);
16611: desret_int(ret_val);
16612: call_tests++;
16613: des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16614: des_xmlCharEncoding(n_enc, enc, 1);
16615: xmlResetLastError();
16616: if (mem_base != xmlMemBlocks()) {
16617: printf("Leak of %d blocks found in xmlSwitchEncoding",
16618: xmlMemBlocks() - mem_base);
16619: test_ret++;
16620: printf(" %d", n_ctxt);
16621: printf(" %d", n_enc);
16622: printf("\n");
16623: }
16624: }
16625: }
16626: function_tests++;
16627:
16628: return(test_ret);
16629: }
16630:
16631:
16632: static int
16633: test_xmlSwitchInputEncoding(void) {
16634: int test_ret = 0;
16635:
16636: int mem_base;
16637: int ret_val;
16638: xmlParserCtxtPtr ctxt; /* the parser context */
16639: int n_ctxt;
16640: xmlParserInputPtr input; /* the input stream */
16641: int n_input;
16642: xmlCharEncodingHandlerPtr handler; /* the encoding handler */
16643: int n_handler;
16644:
16645: for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16646: for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) {
16647: for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandlerPtr;n_handler++) {
16648: mem_base = xmlMemBlocks();
16649: ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16650: input = gen_xmlParserInputPtr(n_input, 1);
16651: handler = gen_xmlCharEncodingHandlerPtr(n_handler, 2);
16652:
16653: ret_val = xmlSwitchInputEncoding(ctxt, input, handler);
16654: desret_int(ret_val);
16655: call_tests++;
16656: des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16657: des_xmlParserInputPtr(n_input, input, 1);
16658: des_xmlCharEncodingHandlerPtr(n_handler, handler, 2);
16659: xmlResetLastError();
16660: if (mem_base != xmlMemBlocks()) {
16661: printf("Leak of %d blocks found in xmlSwitchInputEncoding",
16662: xmlMemBlocks() - mem_base);
16663: test_ret++;
16664: printf(" %d", n_ctxt);
16665: printf(" %d", n_input);
16666: printf(" %d", n_handler);
16667: printf("\n");
16668: }
16669: }
16670: }
16671: }
16672: function_tests++;
16673:
16674: return(test_ret);
16675: }
16676:
16677:
16678: static int
16679: test_xmlSwitchToEncoding(void) {
16680: int test_ret = 0;
16681:
16682: int mem_base;
16683: int ret_val;
16684: xmlParserCtxtPtr ctxt; /* the parser context */
16685: int n_ctxt;
16686: xmlCharEncodingHandlerPtr handler; /* the encoding handler */
16687: int n_handler;
16688:
16689: for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16690: for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandlerPtr;n_handler++) {
16691: mem_base = xmlMemBlocks();
16692: ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16693: handler = gen_xmlCharEncodingHandlerPtr(n_handler, 1);
16694:
16695: ret_val = xmlSwitchToEncoding(ctxt, handler);
16696: desret_int(ret_val);
16697: call_tests++;
16698: des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16699: des_xmlCharEncodingHandlerPtr(n_handler, handler, 1);
16700: xmlResetLastError();
16701: if (mem_base != xmlMemBlocks()) {
16702: printf("Leak of %d blocks found in xmlSwitchToEncoding",
16703: xmlMemBlocks() - mem_base);
16704: test_ret++;
16705: printf(" %d", n_ctxt);
16706: printf(" %d", n_handler);
16707: printf("\n");
16708: }
16709: }
16710: }
16711: function_tests++;
16712:
16713: return(test_ret);
16714: }
16715:
16716: static int
16717: test_parserInternals(void) {
16718: int test_ret = 0;
16719:
16720: if (quiet == 0) printf("Testing parserInternals : 33 of 90 functions ...\n");
16721: test_ret += test_htmlCreateFileParserCtxt();
16722: test_ret += test_htmlInitAutoClose();
16723: test_ret += test_inputPop();
16724: test_ret += test_inputPush();
16725: test_ret += test_namePop();
16726: test_ret += test_namePush();
16727: test_ret += test_nodePop();
16728: test_ret += test_nodePush();
16729: test_ret += test_xmlCheckLanguageID();
16730: test_ret += test_xmlCopyChar();
16731: test_ret += test_xmlCopyCharMultiByte();
16732: test_ret += test_xmlCreateEntityParserCtxt();
16733: test_ret += test_xmlCreateFileParserCtxt();
16734: test_ret += test_xmlCreateMemoryParserCtxt();
16735: test_ret += test_xmlCreateURLParserCtxt();
16736: test_ret += test_xmlCurrentChar();
16737: test_ret += test_xmlErrMemory();
16738: test_ret += test_xmlIsLetter();
16739: test_ret += test_xmlNewEntityInputStream();
16740: test_ret += test_xmlNewInputFromFile();
16741: test_ret += test_xmlNewInputStream();
16742: test_ret += test_xmlNewStringInputStream();
16743: test_ret += test_xmlNextChar();
16744: test_ret += test_xmlParserInputShrink();
16745: test_ret += test_xmlPopInput();
16746: test_ret += test_xmlPushInput();
16747: test_ret += test_xmlSetEntityReferenceFunc();
16748: test_ret += test_xmlSplitQName();
16749: test_ret += test_xmlStringCurrentChar();
16750: test_ret += test_xmlStringDecodeEntities();
16751: test_ret += test_xmlStringLenDecodeEntities();
16752: test_ret += test_xmlSwitchEncoding();
16753: test_ret += test_xmlSwitchInputEncoding();
16754: test_ret += test_xmlSwitchToEncoding();
16755:
16756: if (test_ret != 0)
16757: printf("Module parserInternals: %d errors\n", test_ret);
16758: return(test_ret);
16759: }
16760:
16761: static int
16762: test_xmlPatternFromRoot(void) {
16763: int test_ret = 0;
16764:
16765: #if defined(LIBXML_PATTERN_ENABLED)
16766: int mem_base;
16767: int ret_val;
16768: xmlPatternPtr comp; /* the precompiled pattern */
16769: int n_comp;
16770:
16771: for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
16772: mem_base = xmlMemBlocks();
16773: comp = gen_xmlPatternPtr(n_comp, 0);
16774:
16775: ret_val = xmlPatternFromRoot(comp);
16776: desret_int(ret_val);
16777: call_tests++;
16778: des_xmlPatternPtr(n_comp, comp, 0);
16779: xmlResetLastError();
16780: if (mem_base != xmlMemBlocks()) {
16781: printf("Leak of %d blocks found in xmlPatternFromRoot",
16782: xmlMemBlocks() - mem_base);
16783: test_ret++;
16784: printf(" %d", n_comp);
16785: printf("\n");
16786: }
16787: }
16788: function_tests++;
16789: #endif
16790:
16791: return(test_ret);
16792: }
16793:
16794:
16795: static int
16796: test_xmlPatternGetStreamCtxt(void) {
16797: int test_ret = 0;
16798:
16799:
16800: /* missing type support */
16801: return(test_ret);
16802: }
16803:
16804:
16805: static int
16806: test_xmlPatternMatch(void) {
16807: int test_ret = 0;
16808:
16809: #if defined(LIBXML_PATTERN_ENABLED)
16810: int mem_base;
16811: int ret_val;
16812: xmlPatternPtr comp; /* the precompiled pattern */
16813: int n_comp;
16814: xmlNodePtr node; /* a node */
16815: int n_node;
16816:
16817: for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
16818: for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
16819: mem_base = xmlMemBlocks();
16820: comp = gen_xmlPatternPtr(n_comp, 0);
16821: node = gen_xmlNodePtr(n_node, 1);
16822:
16823: ret_val = xmlPatternMatch(comp, node);
16824: desret_int(ret_val);
16825: call_tests++;
16826: des_xmlPatternPtr(n_comp, comp, 0);
16827: des_xmlNodePtr(n_node, node, 1);
16828: xmlResetLastError();
16829: if (mem_base != xmlMemBlocks()) {
16830: printf("Leak of %d blocks found in xmlPatternMatch",
16831: xmlMemBlocks() - mem_base);
16832: test_ret++;
16833: printf(" %d", n_comp);
16834: printf(" %d", n_node);
16835: printf("\n");
16836: }
16837: }
16838: }
16839: function_tests++;
16840: #endif
16841:
16842: return(test_ret);
16843: }
16844:
16845:
16846: static int
16847: test_xmlPatternMaxDepth(void) {
16848: int test_ret = 0;
16849:
16850: #if defined(LIBXML_PATTERN_ENABLED)
16851: int mem_base;
16852: int ret_val;
16853: xmlPatternPtr comp; /* the precompiled pattern */
16854: int n_comp;
16855:
16856: for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
16857: mem_base = xmlMemBlocks();
16858: comp = gen_xmlPatternPtr(n_comp, 0);
16859:
16860: ret_val = xmlPatternMaxDepth(comp);
16861: desret_int(ret_val);
16862: call_tests++;
16863: des_xmlPatternPtr(n_comp, comp, 0);
16864: xmlResetLastError();
16865: if (mem_base != xmlMemBlocks()) {
16866: printf("Leak of %d blocks found in xmlPatternMaxDepth",
16867: xmlMemBlocks() - mem_base);
16868: test_ret++;
16869: printf(" %d", n_comp);
16870: printf("\n");
16871: }
16872: }
16873: function_tests++;
16874: #endif
16875:
16876: return(test_ret);
16877: }
16878:
16879:
16880: static int
16881: test_xmlPatternMinDepth(void) {
16882: int test_ret = 0;
16883:
16884: #if defined(LIBXML_PATTERN_ENABLED)
16885: int mem_base;
16886: int ret_val;
16887: xmlPatternPtr comp; /* the precompiled pattern */
16888: int n_comp;
16889:
16890: for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
16891: mem_base = xmlMemBlocks();
16892: comp = gen_xmlPatternPtr(n_comp, 0);
16893:
16894: ret_val = xmlPatternMinDepth(comp);
16895: desret_int(ret_val);
16896: call_tests++;
16897: des_xmlPatternPtr(n_comp, comp, 0);
16898: xmlResetLastError();
16899: if (mem_base != xmlMemBlocks()) {
16900: printf("Leak of %d blocks found in xmlPatternMinDepth",
16901: xmlMemBlocks() - mem_base);
16902: test_ret++;
16903: printf(" %d", n_comp);
16904: printf("\n");
16905: }
16906: }
16907: function_tests++;
16908: #endif
16909:
16910: return(test_ret);
16911: }
16912:
16913:
16914: static int
16915: test_xmlPatternStreamable(void) {
16916: int test_ret = 0;
16917:
16918: #if defined(LIBXML_PATTERN_ENABLED)
16919: int mem_base;
16920: int ret_val;
16921: xmlPatternPtr comp; /* the precompiled pattern */
16922: int n_comp;
16923:
16924: for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
16925: mem_base = xmlMemBlocks();
16926: comp = gen_xmlPatternPtr(n_comp, 0);
16927:
16928: ret_val = xmlPatternStreamable(comp);
16929: desret_int(ret_val);
16930: call_tests++;
16931: des_xmlPatternPtr(n_comp, comp, 0);
16932: xmlResetLastError();
16933: if (mem_base != xmlMemBlocks()) {
16934: printf("Leak of %d blocks found in xmlPatternStreamable",
16935: xmlMemBlocks() - mem_base);
16936: test_ret++;
16937: printf(" %d", n_comp);
16938: printf("\n");
16939: }
16940: }
16941: function_tests++;
16942: #endif
16943:
16944: return(test_ret);
16945: }
16946:
16947:
16948: static int
16949: test_xmlPatterncompile(void) {
16950: int test_ret = 0;
16951:
16952:
16953: /* missing type support */
16954: return(test_ret);
16955: }
16956:
16957: #ifdef LIBXML_PATTERN_ENABLED
16958:
16959: #define gen_nb_xmlStreamCtxtPtr 1
16960: static xmlStreamCtxtPtr gen_xmlStreamCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
16961: return(NULL);
16962: }
16963: static void des_xmlStreamCtxtPtr(int no ATTRIBUTE_UNUSED, xmlStreamCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
16964: }
16965: #endif
16966:
16967:
16968: static int
16969: test_xmlStreamPop(void) {
16970: int test_ret = 0;
16971:
16972: #if defined(LIBXML_PATTERN_ENABLED)
16973: int mem_base;
16974: int ret_val;
16975: xmlStreamCtxtPtr stream; /* the stream context */
16976: int n_stream;
16977:
16978: for (n_stream = 0;n_stream < gen_nb_xmlStreamCtxtPtr;n_stream++) {
16979: mem_base = xmlMemBlocks();
16980: stream = gen_xmlStreamCtxtPtr(n_stream, 0);
16981:
16982: ret_val = xmlStreamPop(stream);
16983: desret_int(ret_val);
16984: call_tests++;
16985: des_xmlStreamCtxtPtr(n_stream, stream, 0);
16986: xmlResetLastError();
16987: if (mem_base != xmlMemBlocks()) {
16988: printf("Leak of %d blocks found in xmlStreamPop",
16989: xmlMemBlocks() - mem_base);
16990: test_ret++;
16991: printf(" %d", n_stream);
16992: printf("\n");
16993: }
16994: }
16995: function_tests++;
16996: #endif
16997:
16998: return(test_ret);
16999: }
17000:
17001:
17002: static int
17003: test_xmlStreamPush(void) {
17004: int test_ret = 0;
17005:
17006: #if defined(LIBXML_PATTERN_ENABLED)
17007: int mem_base;
17008: int ret_val;
17009: xmlStreamCtxtPtr stream; /* the stream context */
17010: int n_stream;
17011: xmlChar * name; /* the current name */
17012: int n_name;
17013: xmlChar * ns; /* the namespace name */
17014: int n_ns;
17015:
17016: for (n_stream = 0;n_stream < gen_nb_xmlStreamCtxtPtr;n_stream++) {
17017: for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
17018: for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
17019: mem_base = xmlMemBlocks();
17020: stream = gen_xmlStreamCtxtPtr(n_stream, 0);
17021: name = gen_const_xmlChar_ptr(n_name, 1);
17022: ns = gen_const_xmlChar_ptr(n_ns, 2);
17023:
17024: ret_val = xmlStreamPush(stream, (const xmlChar *)name, (const xmlChar *)ns);
17025: desret_int(ret_val);
17026: call_tests++;
17027: des_xmlStreamCtxtPtr(n_stream, stream, 0);
17028: des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
17029: des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 2);
17030: xmlResetLastError();
17031: if (mem_base != xmlMemBlocks()) {
17032: printf("Leak of %d blocks found in xmlStreamPush",
17033: xmlMemBlocks() - mem_base);
17034: test_ret++;
17035: printf(" %d", n_stream);
17036: printf(" %d", n_name);
17037: printf(" %d", n_ns);
17038: printf("\n");
17039: }
17040: }
17041: }
17042: }
17043: function_tests++;
17044: #endif
17045:
17046: return(test_ret);
17047: }
17048:
17049:
17050: static int
17051: test_xmlStreamPushAttr(void) {
17052: int test_ret = 0;
17053:
17054: #if defined(LIBXML_PATTERN_ENABLED)
17055: int mem_base;
17056: int ret_val;
17057: xmlStreamCtxtPtr stream; /* the stream context */
17058: int n_stream;
17059: xmlChar * name; /* the current name */
17060: int n_name;
17061: xmlChar * ns; /* the namespace name */
17062: int n_ns;
17063:
17064: for (n_stream = 0;n_stream < gen_nb_xmlStreamCtxtPtr;n_stream++) {
17065: for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
17066: for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
17067: mem_base = xmlMemBlocks();
17068: stream = gen_xmlStreamCtxtPtr(n_stream, 0);
17069: name = gen_const_xmlChar_ptr(n_name, 1);
17070: ns = gen_const_xmlChar_ptr(n_ns, 2);
17071:
17072: ret_val = xmlStreamPushAttr(stream, (const xmlChar *)name, (const xmlChar *)ns);
17073: desret_int(ret_val);
17074: call_tests++;
17075: des_xmlStreamCtxtPtr(n_stream, stream, 0);
17076: des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
17077: des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 2);
17078: xmlResetLastError();
17079: if (mem_base != xmlMemBlocks()) {
17080: printf("Leak of %d blocks found in xmlStreamPushAttr",
17081: xmlMemBlocks() - mem_base);
17082: test_ret++;
17083: printf(" %d", n_stream);
17084: printf(" %d", n_name);
17085: printf(" %d", n_ns);
17086: printf("\n");
17087: }
17088: }
17089: }
17090: }
17091: function_tests++;
17092: #endif
17093:
17094: return(test_ret);
17095: }
17096:
17097:
17098: static int
17099: test_xmlStreamPushNode(void) {
17100: int test_ret = 0;
17101:
17102: #if defined(LIBXML_PATTERN_ENABLED)
17103: int mem_base;
17104: int ret_val;
17105: xmlStreamCtxtPtr stream; /* the stream context */
17106: int n_stream;
17107: xmlChar * name; /* the current name */
17108: int n_name;
17109: xmlChar * ns; /* the namespace name */
17110: int n_ns;
17111: int nodeType; /* the type of the node being pushed */
17112: int n_nodeType;
17113:
17114: for (n_stream = 0;n_stream < gen_nb_xmlStreamCtxtPtr;n_stream++) {
17115: for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
17116: for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
17117: for (n_nodeType = 0;n_nodeType < gen_nb_int;n_nodeType++) {
17118: mem_base = xmlMemBlocks();
17119: stream = gen_xmlStreamCtxtPtr(n_stream, 0);
17120: name = gen_const_xmlChar_ptr(n_name, 1);
17121: ns = gen_const_xmlChar_ptr(n_ns, 2);
17122: nodeType = gen_int(n_nodeType, 3);
17123:
17124: ret_val = xmlStreamPushNode(stream, (const xmlChar *)name, (const xmlChar *)ns, nodeType);
17125: desret_int(ret_val);
17126: call_tests++;
17127: des_xmlStreamCtxtPtr(n_stream, stream, 0);
17128: des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
17129: des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 2);
17130: des_int(n_nodeType, nodeType, 3);
17131: xmlResetLastError();
17132: if (mem_base != xmlMemBlocks()) {
17133: printf("Leak of %d blocks found in xmlStreamPushNode",
17134: xmlMemBlocks() - mem_base);
17135: test_ret++;
17136: printf(" %d", n_stream);
17137: printf(" %d", n_name);
17138: printf(" %d", n_ns);
17139: printf(" %d", n_nodeType);
17140: printf("\n");
17141: }
17142: }
17143: }
17144: }
17145: }
17146: function_tests++;
17147: #endif
17148:
17149: return(test_ret);
17150: }
17151:
17152:
17153: static int
17154: test_xmlStreamWantsAnyNode(void) {
17155: int test_ret = 0;
17156:
17157: #if defined(LIBXML_PATTERN_ENABLED)
17158: int mem_base;
17159: int ret_val;
17160: xmlStreamCtxtPtr streamCtxt; /* the stream context */
17161: int n_streamCtxt;
17162:
17163: for (n_streamCtxt = 0;n_streamCtxt < gen_nb_xmlStreamCtxtPtr;n_streamCtxt++) {
17164: mem_base = xmlMemBlocks();
17165: streamCtxt = gen_xmlStreamCtxtPtr(n_streamCtxt, 0);
17166:
17167: ret_val = xmlStreamWantsAnyNode(streamCtxt);
17168: desret_int(ret_val);
17169: call_tests++;
17170: des_xmlStreamCtxtPtr(n_streamCtxt, streamCtxt, 0);
17171: xmlResetLastError();
17172: if (mem_base != xmlMemBlocks()) {
17173: printf("Leak of %d blocks found in xmlStreamWantsAnyNode",
17174: xmlMemBlocks() - mem_base);
17175: test_ret++;
17176: printf(" %d", n_streamCtxt);
17177: printf("\n");
17178: }
17179: }
17180: function_tests++;
17181: #endif
17182:
17183: return(test_ret);
17184: }
17185:
17186: static int
17187: test_pattern(void) {
17188: int test_ret = 0;
17189:
17190: if (quiet == 0) printf("Testing pattern : 10 of 15 functions ...\n");
17191: test_ret += test_xmlPatternFromRoot();
17192: test_ret += test_xmlPatternGetStreamCtxt();
17193: test_ret += test_xmlPatternMatch();
17194: test_ret += test_xmlPatternMaxDepth();
17195: test_ret += test_xmlPatternMinDepth();
17196: test_ret += test_xmlPatternStreamable();
17197: test_ret += test_xmlPatterncompile();
17198: test_ret += test_xmlStreamPop();
17199: test_ret += test_xmlStreamPush();
17200: test_ret += test_xmlStreamPushAttr();
17201: test_ret += test_xmlStreamPushNode();
17202: test_ret += test_xmlStreamWantsAnyNode();
17203:
17204: if (test_ret != 0)
17205: printf("Module pattern: %d errors\n", test_ret);
17206: return(test_ret);
17207: }
17208: #ifdef LIBXML_SCHEMAS_ENABLED
17209:
17210: #define gen_nb_xmlRelaxNGPtr 1
17211: static xmlRelaxNGPtr gen_xmlRelaxNGPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17212: return(NULL);
17213: }
17214: static void des_xmlRelaxNGPtr(int no ATTRIBUTE_UNUSED, xmlRelaxNGPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17215: }
17216: #endif
17217:
17218:
17219: static int
17220: test_xmlRelaxNGDump(void) {
17221: int test_ret = 0;
17222:
17223: #if defined(LIBXML_SCHEMAS_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
17224: int mem_base;
17225: FILE * output; /* the file output */
17226: int n_output;
17227: xmlRelaxNGPtr schema; /* a schema structure */
17228: int n_schema;
17229:
17230: for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
17231: for (n_schema = 0;n_schema < gen_nb_xmlRelaxNGPtr;n_schema++) {
17232: mem_base = xmlMemBlocks();
17233: output = gen_FILE_ptr(n_output, 0);
17234: schema = gen_xmlRelaxNGPtr(n_schema, 1);
17235:
17236: xmlRelaxNGDump(output, schema);
17237: call_tests++;
17238: des_FILE_ptr(n_output, output, 0);
17239: des_xmlRelaxNGPtr(n_schema, schema, 1);
17240: xmlResetLastError();
17241: if (mem_base != xmlMemBlocks()) {
17242: printf("Leak of %d blocks found in xmlRelaxNGDump",
17243: xmlMemBlocks() - mem_base);
17244: test_ret++;
17245: printf(" %d", n_output);
17246: printf(" %d", n_schema);
17247: printf("\n");
17248: }
17249: }
17250: }
17251: function_tests++;
17252: #endif
17253:
17254: return(test_ret);
17255: }
17256:
17257:
17258: static int
17259: test_xmlRelaxNGDumpTree(void) {
17260: int test_ret = 0;
17261:
17262: #if defined(LIBXML_SCHEMAS_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
17263: int mem_base;
17264: FILE * output; /* the file output */
17265: int n_output;
17266: xmlRelaxNGPtr schema; /* a schema structure */
17267: int n_schema;
17268:
17269: for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
17270: for (n_schema = 0;n_schema < gen_nb_xmlRelaxNGPtr;n_schema++) {
17271: mem_base = xmlMemBlocks();
17272: output = gen_FILE_ptr(n_output, 0);
17273: schema = gen_xmlRelaxNGPtr(n_schema, 1);
17274:
17275: xmlRelaxNGDumpTree(output, schema);
17276: call_tests++;
17277: des_FILE_ptr(n_output, output, 0);
17278: des_xmlRelaxNGPtr(n_schema, schema, 1);
17279: xmlResetLastError();
17280: if (mem_base != xmlMemBlocks()) {
17281: printf("Leak of %d blocks found in xmlRelaxNGDumpTree",
17282: xmlMemBlocks() - mem_base);
17283: test_ret++;
17284: printf(" %d", n_output);
17285: printf(" %d", n_schema);
17286: printf("\n");
17287: }
17288: }
17289: }
17290: function_tests++;
17291: #endif
17292:
17293: return(test_ret);
17294: }
17295:
17296: #ifdef LIBXML_SCHEMAS_ENABLED
17297:
17298: #define gen_nb_xmlRelaxNGParserCtxtPtr 1
17299: static xmlRelaxNGParserCtxtPtr gen_xmlRelaxNGParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17300: return(NULL);
17301: }
17302: static void des_xmlRelaxNGParserCtxtPtr(int no ATTRIBUTE_UNUSED, xmlRelaxNGParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17303: }
17304: #endif
17305:
17306: #ifdef LIBXML_SCHEMAS_ENABLED
17307:
17308: #define gen_nb_xmlRelaxNGValidityErrorFunc_ptr 1
17309: static xmlRelaxNGValidityErrorFunc * gen_xmlRelaxNGValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17310: return(NULL);
17311: }
17312: static void des_xmlRelaxNGValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED, xmlRelaxNGValidityErrorFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17313: }
17314: #endif
17315:
17316: #ifdef LIBXML_SCHEMAS_ENABLED
17317:
17318: #define gen_nb_xmlRelaxNGValidityWarningFunc_ptr 1
17319: static xmlRelaxNGValidityWarningFunc * gen_xmlRelaxNGValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17320: return(NULL);
17321: }
17322: static void des_xmlRelaxNGValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED, xmlRelaxNGValidityWarningFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17323: }
17324: #endif
17325:
17326:
17327: static int
17328: test_xmlRelaxNGGetParserErrors(void) {
17329: int test_ret = 0;
17330:
17331: #if defined(LIBXML_SCHEMAS_ENABLED)
17332: int mem_base;
17333: int ret_val;
17334: xmlRelaxNGParserCtxtPtr ctxt; /* a Relax-NG validation context */
17335: int n_ctxt;
17336: xmlRelaxNGValidityErrorFunc * err; /* the error callback result */
17337: int n_err;
17338: xmlRelaxNGValidityWarningFunc * warn; /* the warning callback result */
17339: int n_warn;
17340: void ** ctx; /* contextual data for the callbacks result */
17341: int n_ctx;
17342:
17343: for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGParserCtxtPtr;n_ctxt++) {
17344: for (n_err = 0;n_err < gen_nb_xmlRelaxNGValidityErrorFunc_ptr;n_err++) {
17345: for (n_warn = 0;n_warn < gen_nb_xmlRelaxNGValidityWarningFunc_ptr;n_warn++) {
17346: for (n_ctx = 0;n_ctx < gen_nb_void_ptr_ptr;n_ctx++) {
17347: mem_base = xmlMemBlocks();
17348: ctxt = gen_xmlRelaxNGParserCtxtPtr(n_ctxt, 0);
17349: err = gen_xmlRelaxNGValidityErrorFunc_ptr(n_err, 1);
17350: warn = gen_xmlRelaxNGValidityWarningFunc_ptr(n_warn, 2);
17351: ctx = gen_void_ptr_ptr(n_ctx, 3);
17352:
17353: ret_val = xmlRelaxNGGetParserErrors(ctxt, err, warn, ctx);
17354: desret_int(ret_val);
17355: call_tests++;
17356: des_xmlRelaxNGParserCtxtPtr(n_ctxt, ctxt, 0);
17357: des_xmlRelaxNGValidityErrorFunc_ptr(n_err, err, 1);
17358: des_xmlRelaxNGValidityWarningFunc_ptr(n_warn, warn, 2);
17359: des_void_ptr_ptr(n_ctx, ctx, 3);
17360: xmlResetLastError();
17361: if (mem_base != xmlMemBlocks()) {
17362: printf("Leak of %d blocks found in xmlRelaxNGGetParserErrors",
17363: xmlMemBlocks() - mem_base);
17364: test_ret++;
17365: printf(" %d", n_ctxt);
17366: printf(" %d", n_err);
17367: printf(" %d", n_warn);
17368: printf(" %d", n_ctx);
17369: printf("\n");
17370: }
17371: }
17372: }
17373: }
17374: }
17375: function_tests++;
17376: #endif
17377:
17378: return(test_ret);
17379: }
17380:
17381: #ifdef LIBXML_SCHEMAS_ENABLED
17382:
17383: #define gen_nb_xmlRelaxNGValidCtxtPtr 1
17384: static xmlRelaxNGValidCtxtPtr gen_xmlRelaxNGValidCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17385: return(NULL);
17386: }
17387: static void des_xmlRelaxNGValidCtxtPtr(int no ATTRIBUTE_UNUSED, xmlRelaxNGValidCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17388: }
17389: #endif
17390:
17391:
17392: static int
17393: test_xmlRelaxNGGetValidErrors(void) {
17394: int test_ret = 0;
17395:
17396: #if defined(LIBXML_SCHEMAS_ENABLED)
17397: int mem_base;
17398: int ret_val;
17399: xmlRelaxNGValidCtxtPtr ctxt; /* a Relax-NG validation context */
17400: int n_ctxt;
17401: xmlRelaxNGValidityErrorFunc * err; /* the error function result */
17402: int n_err;
17403: xmlRelaxNGValidityWarningFunc * warn; /* the warning function result */
17404: int n_warn;
17405: void ** ctx; /* the functions context result */
17406: int n_ctx;
17407:
17408: for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17409: for (n_err = 0;n_err < gen_nb_xmlRelaxNGValidityErrorFunc_ptr;n_err++) {
17410: for (n_warn = 0;n_warn < gen_nb_xmlRelaxNGValidityWarningFunc_ptr;n_warn++) {
17411: for (n_ctx = 0;n_ctx < gen_nb_void_ptr_ptr;n_ctx++) {
17412: mem_base = xmlMemBlocks();
17413: ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17414: err = gen_xmlRelaxNGValidityErrorFunc_ptr(n_err, 1);
17415: warn = gen_xmlRelaxNGValidityWarningFunc_ptr(n_warn, 2);
17416: ctx = gen_void_ptr_ptr(n_ctx, 3);
17417:
17418: ret_val = xmlRelaxNGGetValidErrors(ctxt, err, warn, ctx);
17419: desret_int(ret_val);
17420: call_tests++;
17421: des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17422: des_xmlRelaxNGValidityErrorFunc_ptr(n_err, err, 1);
17423: des_xmlRelaxNGValidityWarningFunc_ptr(n_warn, warn, 2);
17424: des_void_ptr_ptr(n_ctx, ctx, 3);
17425: xmlResetLastError();
17426: if (mem_base != xmlMemBlocks()) {
17427: printf("Leak of %d blocks found in xmlRelaxNGGetValidErrors",
17428: xmlMemBlocks() - mem_base);
17429: test_ret++;
17430: printf(" %d", n_ctxt);
17431: printf(" %d", n_err);
17432: printf(" %d", n_warn);
17433: printf(" %d", n_ctx);
17434: printf("\n");
17435: }
17436: }
17437: }
17438: }
17439: }
17440: function_tests++;
17441: #endif
17442:
17443: return(test_ret);
17444: }
17445:
17446:
17447: static int
17448: test_xmlRelaxNGInitTypes(void) {
17449: int test_ret = 0;
17450:
17451: #if defined(LIBXML_SCHEMAS_ENABLED)
17452: int mem_base;
17453: int ret_val;
17454:
17455: mem_base = xmlMemBlocks();
17456:
17457: ret_val = xmlRelaxNGInitTypes();
17458: desret_int(ret_val);
17459: call_tests++;
17460: xmlResetLastError();
17461: if (mem_base != xmlMemBlocks()) {
17462: printf("Leak of %d blocks found in xmlRelaxNGInitTypes",
17463: xmlMemBlocks() - mem_base);
17464: test_ret++;
17465: printf("\n");
17466: }
17467: function_tests++;
17468: #endif
17469:
17470: return(test_ret);
17471: }
17472:
17473:
17474: static int
17475: test_xmlRelaxNGNewDocParserCtxt(void) {
17476: int test_ret = 0;
17477:
17478: #if defined(LIBXML_SCHEMAS_ENABLED)
17479: int mem_base;
17480: xmlRelaxNGParserCtxtPtr ret_val;
17481: xmlDocPtr doc; /* a preparsed document tree */
17482: int n_doc;
17483:
17484: for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17485: mem_base = xmlMemBlocks();
17486: doc = gen_xmlDocPtr(n_doc, 0);
17487:
17488: ret_val = xmlRelaxNGNewDocParserCtxt(doc);
17489: desret_xmlRelaxNGParserCtxtPtr(ret_val);
17490: call_tests++;
17491: des_xmlDocPtr(n_doc, doc, 0);
17492: xmlResetLastError();
17493: if (mem_base != xmlMemBlocks()) {
17494: printf("Leak of %d blocks found in xmlRelaxNGNewDocParserCtxt",
17495: xmlMemBlocks() - mem_base);
17496: test_ret++;
17497: printf(" %d", n_doc);
17498: printf("\n");
17499: }
17500: }
17501: function_tests++;
17502: #endif
17503:
17504: return(test_ret);
17505: }
17506:
17507:
17508: static int
17509: test_xmlRelaxNGNewMemParserCtxt(void) {
17510: int test_ret = 0;
17511:
17512: #if defined(LIBXML_SCHEMAS_ENABLED)
17513: int mem_base;
17514: xmlRelaxNGParserCtxtPtr ret_val;
17515: char * buffer; /* a pointer to a char array containing the schemas */
17516: int n_buffer;
17517: int size; /* the size of the array */
17518: int n_size;
17519:
17520: for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
17521: for (n_size = 0;n_size < gen_nb_int;n_size++) {
17522: mem_base = xmlMemBlocks();
17523: buffer = gen_const_char_ptr(n_buffer, 0);
17524: size = gen_int(n_size, 1);
17525:
17526: ret_val = xmlRelaxNGNewMemParserCtxt((const char *)buffer, size);
17527: desret_xmlRelaxNGParserCtxtPtr(ret_val);
17528: call_tests++;
17529: des_const_char_ptr(n_buffer, (const char *)buffer, 0);
17530: des_int(n_size, size, 1);
17531: xmlResetLastError();
17532: if (mem_base != xmlMemBlocks()) {
17533: printf("Leak of %d blocks found in xmlRelaxNGNewMemParserCtxt",
17534: xmlMemBlocks() - mem_base);
17535: test_ret++;
17536: printf(" %d", n_buffer);
17537: printf(" %d", n_size);
17538: printf("\n");
17539: }
17540: }
17541: }
17542: function_tests++;
17543: #endif
17544:
17545: return(test_ret);
17546: }
17547:
17548:
17549: static int
17550: test_xmlRelaxNGNewParserCtxt(void) {
17551: int test_ret = 0;
17552:
17553: #if defined(LIBXML_SCHEMAS_ENABLED)
17554: int mem_base;
17555: xmlRelaxNGParserCtxtPtr ret_val;
17556: char * URL; /* the location of the schema */
17557: int n_URL;
17558:
17559: for (n_URL = 0;n_URL < gen_nb_const_char_ptr;n_URL++) {
17560: mem_base = xmlMemBlocks();
17561: URL = gen_const_char_ptr(n_URL, 0);
17562:
17563: ret_val = xmlRelaxNGNewParserCtxt((const char *)URL);
17564: desret_xmlRelaxNGParserCtxtPtr(ret_val);
17565: call_tests++;
17566: des_const_char_ptr(n_URL, (const char *)URL, 0);
17567: xmlResetLastError();
17568: if (mem_base != xmlMemBlocks()) {
17569: printf("Leak of %d blocks found in xmlRelaxNGNewParserCtxt",
17570: xmlMemBlocks() - mem_base);
17571: test_ret++;
17572: printf(" %d", n_URL);
17573: printf("\n");
17574: }
17575: }
17576: function_tests++;
17577: #endif
17578:
17579: return(test_ret);
17580: }
17581:
17582:
17583: static int
17584: test_xmlRelaxNGNewValidCtxt(void) {
17585: int test_ret = 0;
17586:
17587:
17588: /* missing type support */
17589: return(test_ret);
17590: }
17591:
17592:
17593: static int
17594: test_xmlRelaxNGParse(void) {
17595: int test_ret = 0;
17596:
17597:
17598: /* missing type support */
17599: return(test_ret);
17600: }
17601:
17602:
17603: static int
17604: test_xmlRelaxNGSetParserErrors(void) {
17605: int test_ret = 0;
17606:
17607:
17608: /* missing type support */
17609: return(test_ret);
17610: }
17611:
17612:
17613: static int
17614: test_xmlRelaxNGSetParserStructuredErrors(void) {
17615: int test_ret = 0;
17616:
17617:
17618: /* missing type support */
17619: return(test_ret);
17620: }
17621:
17622:
17623: static int
17624: test_xmlRelaxNGSetValidErrors(void) {
17625: int test_ret = 0;
17626:
17627:
17628: /* missing type support */
17629: return(test_ret);
17630: }
17631:
17632:
17633: static int
17634: test_xmlRelaxNGSetValidStructuredErrors(void) {
17635: int test_ret = 0;
17636:
17637:
17638: /* missing type support */
17639: return(test_ret);
17640: }
17641:
17642:
17643: static int
17644: test_xmlRelaxNGValidateDoc(void) {
17645: int test_ret = 0;
17646:
17647: #if defined(LIBXML_SCHEMAS_ENABLED)
17648: int mem_base;
17649: int ret_val;
17650: xmlRelaxNGValidCtxtPtr ctxt; /* a Relax-NG validation context */
17651: int n_ctxt;
17652: xmlDocPtr doc; /* a parsed document tree */
17653: int n_doc;
17654:
17655: for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17656: for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17657: mem_base = xmlMemBlocks();
17658: ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17659: doc = gen_xmlDocPtr(n_doc, 1);
17660:
17661: ret_val = xmlRelaxNGValidateDoc(ctxt, doc);
17662: desret_int(ret_val);
17663: call_tests++;
17664: des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17665: des_xmlDocPtr(n_doc, doc, 1);
17666: xmlResetLastError();
17667: if (mem_base != xmlMemBlocks()) {
17668: printf("Leak of %d blocks found in xmlRelaxNGValidateDoc",
17669: xmlMemBlocks() - mem_base);
17670: test_ret++;
17671: printf(" %d", n_ctxt);
17672: printf(" %d", n_doc);
17673: printf("\n");
17674: }
17675: }
17676: }
17677: function_tests++;
17678: #endif
17679:
17680: return(test_ret);
17681: }
17682:
17683:
17684: static int
17685: test_xmlRelaxNGValidateFullElement(void) {
17686: int test_ret = 0;
17687:
17688: #if defined(LIBXML_SCHEMAS_ENABLED)
17689: int mem_base;
17690: int ret_val;
17691: xmlRelaxNGValidCtxtPtr ctxt; /* the validation context */
17692: int n_ctxt;
17693: xmlDocPtr doc; /* a document instance */
17694: int n_doc;
17695: xmlNodePtr elem; /* an element instance */
17696: int n_elem;
17697:
17698: for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17699: for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17700: for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
17701: mem_base = xmlMemBlocks();
17702: ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17703: doc = gen_xmlDocPtr(n_doc, 1);
17704: elem = gen_xmlNodePtr(n_elem, 2);
17705:
17706: ret_val = xmlRelaxNGValidateFullElement(ctxt, doc, elem);
17707: desret_int(ret_val);
17708: call_tests++;
17709: des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17710: des_xmlDocPtr(n_doc, doc, 1);
17711: des_xmlNodePtr(n_elem, elem, 2);
17712: xmlResetLastError();
17713: if (mem_base != xmlMemBlocks()) {
17714: printf("Leak of %d blocks found in xmlRelaxNGValidateFullElement",
17715: xmlMemBlocks() - mem_base);
17716: test_ret++;
17717: printf(" %d", n_ctxt);
17718: printf(" %d", n_doc);
17719: printf(" %d", n_elem);
17720: printf("\n");
17721: }
17722: }
17723: }
17724: }
17725: function_tests++;
17726: #endif
17727:
17728: return(test_ret);
17729: }
17730:
17731:
17732: static int
17733: test_xmlRelaxNGValidatePopElement(void) {
17734: int test_ret = 0;
17735:
17736: #if defined(LIBXML_SCHEMAS_ENABLED)
17737: int mem_base;
17738: int ret_val;
17739: xmlRelaxNGValidCtxtPtr ctxt; /* the RelaxNG validation context */
17740: int n_ctxt;
17741: xmlDocPtr doc; /* a document instance */
17742: int n_doc;
17743: xmlNodePtr elem; /* an element instance */
17744: int n_elem;
17745:
17746: for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17747: for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17748: for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
17749: mem_base = xmlMemBlocks();
17750: ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17751: doc = gen_xmlDocPtr(n_doc, 1);
17752: elem = gen_xmlNodePtr(n_elem, 2);
17753:
17754: ret_val = xmlRelaxNGValidatePopElement(ctxt, doc, elem);
17755: desret_int(ret_val);
17756: call_tests++;
17757: des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17758: des_xmlDocPtr(n_doc, doc, 1);
17759: des_xmlNodePtr(n_elem, elem, 2);
17760: xmlResetLastError();
17761: if (mem_base != xmlMemBlocks()) {
17762: printf("Leak of %d blocks found in xmlRelaxNGValidatePopElement",
17763: xmlMemBlocks() - mem_base);
17764: test_ret++;
17765: printf(" %d", n_ctxt);
17766: printf(" %d", n_doc);
17767: printf(" %d", n_elem);
17768: printf("\n");
17769: }
17770: }
17771: }
17772: }
17773: function_tests++;
17774: #endif
17775:
17776: return(test_ret);
17777: }
17778:
17779:
17780: static int
17781: test_xmlRelaxNGValidatePushCData(void) {
17782: int test_ret = 0;
17783:
17784: #if defined(LIBXML_SCHEMAS_ENABLED)
17785: int mem_base;
17786: int ret_val;
17787: xmlRelaxNGValidCtxtPtr ctxt; /* the RelaxNG validation context */
17788: int n_ctxt;
17789: xmlChar * data; /* some character data read */
17790: int n_data;
17791: int len; /* the lenght of the data */
17792: int n_len;
17793:
17794: for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17795: for (n_data = 0;n_data < gen_nb_const_xmlChar_ptr;n_data++) {
17796: for (n_len = 0;n_len < gen_nb_int;n_len++) {
17797: mem_base = xmlMemBlocks();
17798: ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17799: data = gen_const_xmlChar_ptr(n_data, 1);
17800: len = gen_int(n_len, 2);
17801:
17802: ret_val = xmlRelaxNGValidatePushCData(ctxt, (const xmlChar *)data, len);
17803: desret_int(ret_val);
17804: call_tests++;
17805: des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17806: des_const_xmlChar_ptr(n_data, (const xmlChar *)data, 1);
17807: des_int(n_len, len, 2);
17808: xmlResetLastError();
17809: if (mem_base != xmlMemBlocks()) {
17810: printf("Leak of %d blocks found in xmlRelaxNGValidatePushCData",
17811: xmlMemBlocks() - mem_base);
17812: test_ret++;
17813: printf(" %d", n_ctxt);
17814: printf(" %d", n_data);
17815: printf(" %d", n_len);
17816: printf("\n");
17817: }
17818: }
17819: }
17820: }
17821: function_tests++;
17822: #endif
17823:
17824: return(test_ret);
17825: }
17826:
17827:
17828: static int
17829: test_xmlRelaxNGValidatePushElement(void) {
17830: int test_ret = 0;
17831:
17832: #if defined(LIBXML_SCHEMAS_ENABLED)
17833: int mem_base;
17834: int ret_val;
17835: xmlRelaxNGValidCtxtPtr ctxt; /* the validation context */
17836: int n_ctxt;
17837: xmlDocPtr doc; /* a document instance */
17838: int n_doc;
17839: xmlNodePtr elem; /* an element instance */
17840: int n_elem;
17841:
17842: for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17843: for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17844: for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
17845: mem_base = xmlMemBlocks();
17846: ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17847: doc = gen_xmlDocPtr(n_doc, 1);
17848: elem = gen_xmlNodePtr(n_elem, 2);
17849:
17850: ret_val = xmlRelaxNGValidatePushElement(ctxt, doc, elem);
17851: desret_int(ret_val);
17852: call_tests++;
17853: des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17854: des_xmlDocPtr(n_doc, doc, 1);
17855: des_xmlNodePtr(n_elem, elem, 2);
17856: xmlResetLastError();
17857: if (mem_base != xmlMemBlocks()) {
17858: printf("Leak of %d blocks found in xmlRelaxNGValidatePushElement",
17859: xmlMemBlocks() - mem_base);
17860: test_ret++;
17861: printf(" %d", n_ctxt);
17862: printf(" %d", n_doc);
17863: printf(" %d", n_elem);
17864: printf("\n");
17865: }
17866: }
17867: }
17868: }
17869: function_tests++;
17870: #endif
17871:
17872: return(test_ret);
17873: }
17874:
17875:
17876: static int
17877: test_xmlRelaxParserSetFlag(void) {
17878: int test_ret = 0;
17879:
17880: #if defined(LIBXML_SCHEMAS_ENABLED)
17881: int mem_base;
17882: int ret_val;
17883: xmlRelaxNGParserCtxtPtr ctxt; /* a RelaxNG parser context */
17884: int n_ctxt;
17885: int flags; /* a set of flags values */
17886: int n_flags;
17887:
17888: for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGParserCtxtPtr;n_ctxt++) {
17889: for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
17890: mem_base = xmlMemBlocks();
17891: ctxt = gen_xmlRelaxNGParserCtxtPtr(n_ctxt, 0);
17892: flags = gen_int(n_flags, 1);
17893:
17894: ret_val = xmlRelaxParserSetFlag(ctxt, flags);
17895: desret_int(ret_val);
17896: call_tests++;
17897: des_xmlRelaxNGParserCtxtPtr(n_ctxt, ctxt, 0);
17898: des_int(n_flags, flags, 1);
17899: xmlResetLastError();
17900: if (mem_base != xmlMemBlocks()) {
17901: printf("Leak of %d blocks found in xmlRelaxParserSetFlag",
17902: xmlMemBlocks() - mem_base);
17903: test_ret++;
17904: printf(" %d", n_ctxt);
17905: printf(" %d", n_flags);
17906: printf("\n");
17907: }
17908: }
17909: }
17910: function_tests++;
17911: #endif
17912:
17913: return(test_ret);
17914: }
17915:
17916: static int
17917: test_relaxng(void) {
17918: int test_ret = 0;
17919:
17920: if (quiet == 0) printf("Testing relaxng : 14 of 24 functions ...\n");
17921: test_ret += test_xmlRelaxNGDump();
17922: test_ret += test_xmlRelaxNGDumpTree();
17923: test_ret += test_xmlRelaxNGGetParserErrors();
17924: test_ret += test_xmlRelaxNGGetValidErrors();
17925: test_ret += test_xmlRelaxNGInitTypes();
17926: test_ret += test_xmlRelaxNGNewDocParserCtxt();
17927: test_ret += test_xmlRelaxNGNewMemParserCtxt();
17928: test_ret += test_xmlRelaxNGNewParserCtxt();
17929: test_ret += test_xmlRelaxNGNewValidCtxt();
17930: test_ret += test_xmlRelaxNGParse();
17931: test_ret += test_xmlRelaxNGSetParserErrors();
17932: test_ret += test_xmlRelaxNGSetParserStructuredErrors();
17933: test_ret += test_xmlRelaxNGSetValidErrors();
17934: test_ret += test_xmlRelaxNGSetValidStructuredErrors();
17935: test_ret += test_xmlRelaxNGValidateDoc();
17936: test_ret += test_xmlRelaxNGValidateFullElement();
17937: test_ret += test_xmlRelaxNGValidatePopElement();
17938: test_ret += test_xmlRelaxNGValidatePushCData();
17939: test_ret += test_xmlRelaxNGValidatePushElement();
17940: test_ret += test_xmlRelaxParserSetFlag();
17941:
17942: if (test_ret != 0)
17943: printf("Module relaxng: %d errors\n", test_ret);
17944: return(test_ret);
17945: }
17946: static int
17947: test_schemasInternals(void) {
17948: int test_ret = 0;
17949:
17950: if (quiet == 0) printf("Testing schemasInternals : 0 of 2 functions ...\n");
17951:
17952: if (test_ret != 0)
17953: printf("Module schemasInternals: %d errors\n", test_ret);
17954: return(test_ret);
17955: }
17956:
17957: static int
17958: test_xmlSchematronNewDocParserCtxt(void) {
17959: int test_ret = 0;
17960:
17961:
17962: /* missing type support */
17963: return(test_ret);
17964: }
17965:
17966:
17967: static int
17968: test_xmlSchematronNewMemParserCtxt(void) {
17969: int test_ret = 0;
17970:
17971:
17972: /* missing type support */
17973: return(test_ret);
17974: }
17975:
17976:
17977: static int
17978: test_xmlSchematronNewParserCtxt(void) {
17979: int test_ret = 0;
17980:
17981:
17982: /* missing type support */
17983: return(test_ret);
17984: }
17985:
17986: #ifdef LIBXML_SCHEMATRON_ENABLED
17987:
17988: #define gen_nb_xmlSchematronPtr 1
17989: static xmlSchematronPtr gen_xmlSchematronPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17990: return(NULL);
17991: }
17992: static void des_xmlSchematronPtr(int no ATTRIBUTE_UNUSED, xmlSchematronPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17993: }
17994: #endif
17995:
17996:
17997: static int
17998: test_xmlSchematronNewValidCtxt(void) {
17999: int test_ret = 0;
18000:
18001:
18002: /* missing type support */
18003: return(test_ret);
18004: }
18005:
18006: #ifdef LIBXML_SCHEMATRON_ENABLED
18007:
18008: #define gen_nb_xmlSchematronParserCtxtPtr 1
18009: static xmlSchematronParserCtxtPtr gen_xmlSchematronParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18010: return(NULL);
18011: }
18012: static void des_xmlSchematronParserCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSchematronParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18013: }
18014: #endif
18015:
18016:
18017: static int
18018: test_xmlSchematronParse(void) {
18019: int test_ret = 0;
18020:
18021:
18022: /* missing type support */
18023: return(test_ret);
18024: }
18025:
18026: #ifdef LIBXML_SCHEMATRON_ENABLED
18027:
18028: #define gen_nb_xmlSchematronValidCtxtPtr 1
18029: static xmlSchematronValidCtxtPtr gen_xmlSchematronValidCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18030: return(NULL);
18031: }
18032: static void des_xmlSchematronValidCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSchematronValidCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18033: }
18034: #endif
18035:
18036:
18037: static int
18038: test_xmlSchematronSetValidStructuredErrors(void) {
18039: int test_ret = 0;
18040:
18041:
18042: /* missing type support */
18043: return(test_ret);
18044: }
18045:
18046:
18047: static int
18048: test_xmlSchematronValidateDoc(void) {
18049: int test_ret = 0;
18050:
18051: #if defined(LIBXML_SCHEMATRON_ENABLED)
18052: int mem_base;
18053: int ret_val;
18054: xmlSchematronValidCtxtPtr ctxt; /* the schema validation context */
18055: int n_ctxt;
18056: xmlDocPtr instance; /* the document instace tree */
18057: int n_instance;
18058:
18059: for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchematronValidCtxtPtr;n_ctxt++) {
18060: for (n_instance = 0;n_instance < gen_nb_xmlDocPtr;n_instance++) {
18061: mem_base = xmlMemBlocks();
18062: ctxt = gen_xmlSchematronValidCtxtPtr(n_ctxt, 0);
18063: instance = gen_xmlDocPtr(n_instance, 1);
18064:
18065: ret_val = xmlSchematronValidateDoc(ctxt, instance);
18066: desret_int(ret_val);
18067: call_tests++;
18068: des_xmlSchematronValidCtxtPtr(n_ctxt, ctxt, 0);
18069: des_xmlDocPtr(n_instance, instance, 1);
18070: xmlResetLastError();
18071: if (mem_base != xmlMemBlocks()) {
18072: printf("Leak of %d blocks found in xmlSchematronValidateDoc",
18073: xmlMemBlocks() - mem_base);
18074: test_ret++;
18075: printf(" %d", n_ctxt);
18076: printf(" %d", n_instance);
18077: printf("\n");
18078: }
18079: }
18080: }
18081: function_tests++;
18082: #endif
18083:
18084: return(test_ret);
18085: }
18086:
18087: static int
18088: test_schematron(void) {
18089: int test_ret = 0;
18090:
18091: if (quiet == 0) printf("Testing schematron : 1 of 10 functions ...\n");
18092: test_ret += test_xmlSchematronNewDocParserCtxt();
18093: test_ret += test_xmlSchematronNewMemParserCtxt();
18094: test_ret += test_xmlSchematronNewParserCtxt();
18095: test_ret += test_xmlSchematronNewValidCtxt();
18096: test_ret += test_xmlSchematronParse();
18097: test_ret += test_xmlSchematronSetValidStructuredErrors();
18098: test_ret += test_xmlSchematronValidateDoc();
18099:
18100: if (test_ret != 0)
18101: printf("Module schematron: %d errors\n", test_ret);
18102: return(test_ret);
18103: }
18104:
18105: static int
18106: test_xmlAddChild(void) {
18107: int test_ret = 0;
18108:
18109: int mem_base;
18110: xmlNodePtr ret_val;
18111: xmlNodePtr parent; /* the parent node */
18112: int n_parent;
18113: xmlNodePtr cur; /* the child node */
18114: int n_cur;
18115:
18116: for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
18117: for (n_cur = 0;n_cur < gen_nb_xmlNodePtr_in;n_cur++) {
18118: mem_base = xmlMemBlocks();
18119: parent = gen_xmlNodePtr(n_parent, 0);
18120: cur = gen_xmlNodePtr_in(n_cur, 1);
18121:
18122: ret_val = xmlAddChild(parent, cur);
18123: if (ret_val == NULL) { xmlFreeNode(cur) ; cur = NULL ; }
18124: desret_xmlNodePtr(ret_val);
18125: call_tests++;
18126: des_xmlNodePtr(n_parent, parent, 0);
18127: des_xmlNodePtr_in(n_cur, cur, 1);
18128: xmlResetLastError();
18129: if (mem_base != xmlMemBlocks()) {
18130: printf("Leak of %d blocks found in xmlAddChild",
18131: xmlMemBlocks() - mem_base);
18132: test_ret++;
18133: printf(" %d", n_parent);
18134: printf(" %d", n_cur);
18135: printf("\n");
18136: }
18137: }
18138: }
18139: function_tests++;
18140:
18141: return(test_ret);
18142: }
18143:
18144:
18145: static int
18146: test_xmlAddChildList(void) {
18147: int test_ret = 0;
18148:
18149: int mem_base;
18150: xmlNodePtr ret_val;
18151: xmlNodePtr parent; /* the parent node */
18152: int n_parent;
18153: xmlNodePtr cur; /* the first node in the list */
18154: int n_cur;
18155:
18156: for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
18157: for (n_cur = 0;n_cur < gen_nb_xmlNodePtr_in;n_cur++) {
18158: mem_base = xmlMemBlocks();
18159: parent = gen_xmlNodePtr(n_parent, 0);
18160: cur = gen_xmlNodePtr_in(n_cur, 1);
18161:
18162: ret_val = xmlAddChildList(parent, cur);
18163: if (ret_val == NULL) { xmlFreeNodeList(cur) ; cur = NULL ; }
18164: desret_xmlNodePtr(ret_val);
18165: call_tests++;
18166: des_xmlNodePtr(n_parent, parent, 0);
18167: des_xmlNodePtr_in(n_cur, cur, 1);
18168: xmlResetLastError();
18169: if (mem_base != xmlMemBlocks()) {
18170: printf("Leak of %d blocks found in xmlAddChildList",
18171: xmlMemBlocks() - mem_base);
18172: test_ret++;
18173: printf(" %d", n_parent);
18174: printf(" %d", n_cur);
18175: printf("\n");
18176: }
18177: }
18178: }
18179: function_tests++;
18180:
18181: return(test_ret);
18182: }
18183:
18184:
18185: static int
18186: test_xmlAddNextSibling(void) {
18187: int test_ret = 0;
18188:
18189: int mem_base;
18190: xmlNodePtr ret_val;
18191: xmlNodePtr cur; /* the child node */
18192: int n_cur;
18193: xmlNodePtr elem; /* the new node */
18194: int n_elem;
18195:
18196: for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
18197: for (n_elem = 0;n_elem < gen_nb_xmlNodePtr_in;n_elem++) {
18198: mem_base = xmlMemBlocks();
18199: cur = gen_xmlNodePtr(n_cur, 0);
18200: elem = gen_xmlNodePtr_in(n_elem, 1);
18201:
18202: ret_val = xmlAddNextSibling(cur, elem);
18203: if (ret_val == NULL) { xmlFreeNode(elem) ; elem = NULL ; }
18204: desret_xmlNodePtr(ret_val);
18205: call_tests++;
18206: des_xmlNodePtr(n_cur, cur, 0);
18207: des_xmlNodePtr_in(n_elem, elem, 1);
18208: xmlResetLastError();
18209: if (mem_base != xmlMemBlocks()) {
18210: printf("Leak of %d blocks found in xmlAddNextSibling",
18211: xmlMemBlocks() - mem_base);
18212: test_ret++;
18213: printf(" %d", n_cur);
18214: printf(" %d", n_elem);
18215: printf("\n");
18216: }
18217: }
18218: }
18219: function_tests++;
18220:
18221: return(test_ret);
18222: }
18223:
18224:
18225: static int
18226: test_xmlAddPrevSibling(void) {
18227: int test_ret = 0;
18228:
18229: #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
18230: int mem_base;
18231: xmlNodePtr ret_val;
18232: xmlNodePtr cur; /* the child node */
18233: int n_cur;
18234: xmlNodePtr elem; /* the new node */
18235: int n_elem;
18236:
18237: for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
18238: for (n_elem = 0;n_elem < gen_nb_xmlNodePtr_in;n_elem++) {
18239: mem_base = xmlMemBlocks();
18240: cur = gen_xmlNodePtr(n_cur, 0);
18241: elem = gen_xmlNodePtr_in(n_elem, 1);
18242:
18243: ret_val = xmlAddPrevSibling(cur, elem);
18244: if (ret_val == NULL) { xmlFreeNode(elem) ; elem = NULL ; }
18245: desret_xmlNodePtr(ret_val);
18246: call_tests++;
18247: des_xmlNodePtr(n_cur, cur, 0);
18248: des_xmlNodePtr_in(n_elem, elem, 1);
18249: xmlResetLastError();
18250: if (mem_base != xmlMemBlocks()) {
18251: printf("Leak of %d blocks found in xmlAddPrevSibling",
18252: xmlMemBlocks() - mem_base);
18253: test_ret++;
18254: printf(" %d", n_cur);
18255: printf(" %d", n_elem);
18256: printf("\n");
18257: }
18258: }
18259: }
18260: function_tests++;
18261: #endif
18262:
18263: return(test_ret);
18264: }
18265:
18266:
18267: static int
18268: test_xmlAddSibling(void) {
18269: int test_ret = 0;
18270:
18271: int mem_base;
18272: xmlNodePtr ret_val;
18273: xmlNodePtr cur; /* the child node */
18274: int n_cur;
18275: xmlNodePtr elem; /* the new node */
18276: int n_elem;
18277:
18278: for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
18279: for (n_elem = 0;n_elem < gen_nb_xmlNodePtr_in;n_elem++) {
18280: mem_base = xmlMemBlocks();
18281: cur = gen_xmlNodePtr(n_cur, 0);
18282: elem = gen_xmlNodePtr_in(n_elem, 1);
18283:
18284: ret_val = xmlAddSibling(cur, elem);
18285: if (ret_val == NULL) { xmlFreeNode(elem) ; elem = NULL ; }
18286: desret_xmlNodePtr(ret_val);
18287: call_tests++;
18288: des_xmlNodePtr(n_cur, cur, 0);
18289: des_xmlNodePtr_in(n_elem, elem, 1);
18290: xmlResetLastError();
18291: if (mem_base != xmlMemBlocks()) {
18292: printf("Leak of %d blocks found in xmlAddSibling",
18293: xmlMemBlocks() - mem_base);
18294: test_ret++;
18295: printf(" %d", n_cur);
18296: printf(" %d", n_elem);
18297: printf("\n");
18298: }
18299: }
18300: }
18301: function_tests++;
18302:
18303: return(test_ret);
18304: }
18305:
18306:
18307: static int
18308: test_xmlAttrSerializeTxtContent(void) {
18309: int test_ret = 0;
18310:
18311: #if defined(LIBXML_OUTPUT_ENABLED)
18312: #ifdef LIBXML_OUTPUT_ENABLED
18313: int mem_base;
18314: xmlBufferPtr buf; /* the XML buffer output */
18315: int n_buf;
18316: xmlDocPtr doc; /* the document */
18317: int n_doc;
18318: xmlAttrPtr attr; /* the attribute node */
18319: int n_attr;
18320: xmlChar * string; /* the text content */
18321: int n_string;
18322:
18323: for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18324: for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
18325: for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
18326: for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
18327: mem_base = xmlMemBlocks();
18328: buf = gen_xmlBufferPtr(n_buf, 0);
18329: doc = gen_xmlDocPtr(n_doc, 1);
18330: attr = gen_xmlAttrPtr(n_attr, 2);
18331: string = gen_const_xmlChar_ptr(n_string, 3);
18332:
18333: xmlAttrSerializeTxtContent(buf, doc, attr, (const xmlChar *)string);
18334: call_tests++;
18335: des_xmlBufferPtr(n_buf, buf, 0);
18336: des_xmlDocPtr(n_doc, doc, 1);
18337: des_xmlAttrPtr(n_attr, attr, 2);
18338: des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 3);
18339: xmlResetLastError();
18340: if (mem_base != xmlMemBlocks()) {
18341: printf("Leak of %d blocks found in xmlAttrSerializeTxtContent",
18342: xmlMemBlocks() - mem_base);
18343: test_ret++;
18344: printf(" %d", n_buf);
18345: printf(" %d", n_doc);
18346: printf(" %d", n_attr);
18347: printf(" %d", n_string);
18348: printf("\n");
18349: }
18350: }
18351: }
18352: }
18353: }
18354: function_tests++;
18355: #endif
18356: #endif
18357:
18358: return(test_ret);
18359: }
18360:
18361:
18362: static int
18363: test_xmlBufferAdd(void) {
18364: int test_ret = 0;
18365:
18366: int mem_base;
18367: int ret_val;
18368: xmlBufferPtr buf; /* the buffer to dump */
18369: int n_buf;
18370: xmlChar * str; /* the #xmlChar string */
18371: int n_str;
18372: int len; /* the number of #xmlChar to add */
18373: int n_len;
18374:
18375: for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18376: for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
18377: for (n_len = 0;n_len < gen_nb_int;n_len++) {
18378: mem_base = xmlMemBlocks();
18379: buf = gen_xmlBufferPtr(n_buf, 0);
18380: str = gen_const_xmlChar_ptr(n_str, 1);
18381: len = gen_int(n_len, 2);
18382:
18383: ret_val = xmlBufferAdd(buf, (const xmlChar *)str, len);
18384: desret_int(ret_val);
18385: call_tests++;
18386: des_xmlBufferPtr(n_buf, buf, 0);
18387: des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
18388: des_int(n_len, len, 2);
18389: xmlResetLastError();
18390: if (mem_base != xmlMemBlocks()) {
18391: printf("Leak of %d blocks found in xmlBufferAdd",
18392: xmlMemBlocks() - mem_base);
18393: test_ret++;
18394: printf(" %d", n_buf);
18395: printf(" %d", n_str);
18396: printf(" %d", n_len);
18397: printf("\n");
18398: }
18399: }
18400: }
18401: }
18402: function_tests++;
18403:
18404: return(test_ret);
18405: }
18406:
18407:
18408: static int
18409: test_xmlBufferAddHead(void) {
18410: int test_ret = 0;
18411:
18412: int mem_base;
18413: int ret_val;
18414: xmlBufferPtr buf; /* the buffer */
18415: int n_buf;
18416: xmlChar * str; /* the #xmlChar string */
18417: int n_str;
18418: int len; /* the number of #xmlChar to add */
18419: int n_len;
18420:
18421: for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18422: for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
18423: for (n_len = 0;n_len < gen_nb_int;n_len++) {
18424: mem_base = xmlMemBlocks();
18425: buf = gen_xmlBufferPtr(n_buf, 0);
18426: str = gen_const_xmlChar_ptr(n_str, 1);
18427: len = gen_int(n_len, 2);
18428:
18429: ret_val = xmlBufferAddHead(buf, (const xmlChar *)str, len);
18430: desret_int(ret_val);
18431: call_tests++;
18432: des_xmlBufferPtr(n_buf, buf, 0);
18433: des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
18434: des_int(n_len, len, 2);
18435: xmlResetLastError();
18436: if (mem_base != xmlMemBlocks()) {
18437: printf("Leak of %d blocks found in xmlBufferAddHead",
18438: xmlMemBlocks() - mem_base);
18439: test_ret++;
18440: printf(" %d", n_buf);
18441: printf(" %d", n_str);
18442: printf(" %d", n_len);
18443: printf("\n");
18444: }
18445: }
18446: }
18447: }
18448: function_tests++;
18449:
18450: return(test_ret);
18451: }
18452:
18453:
18454: static int
18455: test_xmlBufferCCat(void) {
18456: int test_ret = 0;
18457:
18458: int mem_base;
18459: int ret_val;
18460: xmlBufferPtr buf; /* the buffer to dump */
18461: int n_buf;
18462: char * str; /* the C char string */
18463: int n_str;
18464:
18465: for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18466: for (n_str = 0;n_str < gen_nb_const_char_ptr;n_str++) {
18467: mem_base = xmlMemBlocks();
18468: buf = gen_xmlBufferPtr(n_buf, 0);
18469: str = gen_const_char_ptr(n_str, 1);
18470:
18471: ret_val = xmlBufferCCat(buf, (const char *)str);
18472: desret_int(ret_val);
18473: call_tests++;
18474: des_xmlBufferPtr(n_buf, buf, 0);
18475: des_const_char_ptr(n_str, (const char *)str, 1);
18476: xmlResetLastError();
18477: if (mem_base != xmlMemBlocks()) {
18478: printf("Leak of %d blocks found in xmlBufferCCat",
18479: xmlMemBlocks() - mem_base);
18480: test_ret++;
18481: printf(" %d", n_buf);
18482: printf(" %d", n_str);
18483: printf("\n");
18484: }
18485: }
18486: }
18487: function_tests++;
18488:
18489: return(test_ret);
18490: }
18491:
18492:
18493: static int
18494: test_xmlBufferCat(void) {
18495: int test_ret = 0;
18496:
18497: int mem_base;
18498: int ret_val;
18499: xmlBufferPtr buf; /* the buffer to add to */
18500: int n_buf;
18501: xmlChar * str; /* the #xmlChar string */
18502: int n_str;
18503:
18504: for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18505: for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
18506: mem_base = xmlMemBlocks();
18507: buf = gen_xmlBufferPtr(n_buf, 0);
18508: str = gen_const_xmlChar_ptr(n_str, 1);
18509:
18510: ret_val = xmlBufferCat(buf, (const xmlChar *)str);
18511: desret_int(ret_val);
18512: call_tests++;
18513: des_xmlBufferPtr(n_buf, buf, 0);
18514: des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
18515: xmlResetLastError();
18516: if (mem_base != xmlMemBlocks()) {
18517: printf("Leak of %d blocks found in xmlBufferCat",
18518: xmlMemBlocks() - mem_base);
18519: test_ret++;
18520: printf(" %d", n_buf);
18521: printf(" %d", n_str);
18522: printf("\n");
18523: }
18524: }
18525: }
18526: function_tests++;
18527:
18528: return(test_ret);
18529: }
18530:
18531:
18532: #define gen_nb_const_xmlBufferPtr 1
18533: static xmlBufferPtr gen_const_xmlBufferPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18534: return(NULL);
18535: }
18536: static void des_const_xmlBufferPtr(int no ATTRIBUTE_UNUSED, const xmlBufferPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18537: }
18538:
18539: static int
18540: test_xmlBufferContent(void) {
18541: int test_ret = 0;
18542:
18543: int mem_base;
18544: const xmlChar * ret_val;
18545: xmlBufferPtr buf; /* the buffer */
18546: int n_buf;
18547:
18548: for (n_buf = 0;n_buf < gen_nb_const_xmlBufferPtr;n_buf++) {
18549: mem_base = xmlMemBlocks();
18550: buf = gen_const_xmlBufferPtr(n_buf, 0);
18551:
18552: ret_val = xmlBufferContent((const xmlBufferPtr)buf);
18553: desret_const_xmlChar_ptr(ret_val);
18554: call_tests++;
18555: des_const_xmlBufferPtr(n_buf, (const xmlBufferPtr)buf, 0);
18556: xmlResetLastError();
18557: if (mem_base != xmlMemBlocks()) {
18558: printf("Leak of %d blocks found in xmlBufferContent",
18559: xmlMemBlocks() - mem_base);
18560: test_ret++;
18561: printf(" %d", n_buf);
18562: printf("\n");
18563: }
18564: }
18565: function_tests++;
18566:
18567: return(test_ret);
18568: }
18569:
18570:
18571: static int
18572: test_xmlBufferCreate(void) {
18573: int test_ret = 0;
18574:
18575: int mem_base;
18576: xmlBufferPtr ret_val;
18577:
18578: mem_base = xmlMemBlocks();
18579:
18580: ret_val = xmlBufferCreate();
18581: desret_xmlBufferPtr(ret_val);
18582: call_tests++;
18583: xmlResetLastError();
18584: if (mem_base != xmlMemBlocks()) {
18585: printf("Leak of %d blocks found in xmlBufferCreate",
18586: xmlMemBlocks() - mem_base);
18587: test_ret++;
18588: printf("\n");
18589: }
18590: function_tests++;
18591:
18592: return(test_ret);
18593: }
18594:
18595:
18596: static int
18597: test_xmlBufferCreateSize(void) {
18598: int test_ret = 0;
18599:
18600:
18601: /* missing type support */
18602: return(test_ret);
18603: }
18604:
18605:
18606: static int
18607: test_xmlBufferCreateStatic(void) {
18608: int test_ret = 0;
18609:
18610:
18611: /* missing type support */
18612: return(test_ret);
18613: }
18614:
18615:
18616: static int
18617: test_xmlBufferEmpty(void) {
18618: int test_ret = 0;
18619:
18620: int mem_base;
18621: xmlBufferPtr buf; /* the buffer */
18622: int n_buf;
18623:
18624: for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18625: mem_base = xmlMemBlocks();
18626: buf = gen_xmlBufferPtr(n_buf, 0);
18627:
18628: xmlBufferEmpty(buf);
18629: call_tests++;
18630: des_xmlBufferPtr(n_buf, buf, 0);
18631: xmlResetLastError();
18632: if (mem_base != xmlMemBlocks()) {
18633: printf("Leak of %d blocks found in xmlBufferEmpty",
18634: xmlMemBlocks() - mem_base);
18635: test_ret++;
18636: printf(" %d", n_buf);
18637: printf("\n");
18638: }
18639: }
18640: function_tests++;
18641:
18642: return(test_ret);
18643: }
18644:
18645:
18646: static int
18647: test_xmlBufferGrow(void) {
18648: int test_ret = 0;
18649:
18650: int mem_base;
18651: int ret_val;
18652: xmlBufferPtr buf; /* the buffer */
18653: int n_buf;
18654: unsigned int len; /* the minimum free size to allocate */
18655: int n_len;
18656:
18657: for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18658: for (n_len = 0;n_len < gen_nb_unsigned_int;n_len++) {
18659: mem_base = xmlMemBlocks();
18660: buf = gen_xmlBufferPtr(n_buf, 0);
18661: len = gen_unsigned_int(n_len, 1);
18662:
18663: ret_val = xmlBufferGrow(buf, len);
18664: desret_int(ret_val);
18665: call_tests++;
18666: des_xmlBufferPtr(n_buf, buf, 0);
18667: des_unsigned_int(n_len, len, 1);
18668: xmlResetLastError();
18669: if (mem_base != xmlMemBlocks()) {
18670: printf("Leak of %d blocks found in xmlBufferGrow",
18671: xmlMemBlocks() - mem_base);
18672: test_ret++;
18673: printf(" %d", n_buf);
18674: printf(" %d", n_len);
18675: printf("\n");
18676: }
18677: }
18678: }
18679: function_tests++;
18680:
18681: return(test_ret);
18682: }
18683:
18684:
18685: static int
18686: test_xmlBufferLength(void) {
18687: int test_ret = 0;
18688:
18689: int mem_base;
18690: int ret_val;
18691: xmlBufferPtr buf; /* the buffer */
18692: int n_buf;
18693:
18694: for (n_buf = 0;n_buf < gen_nb_const_xmlBufferPtr;n_buf++) {
18695: mem_base = xmlMemBlocks();
18696: buf = gen_const_xmlBufferPtr(n_buf, 0);
18697:
18698: ret_val = xmlBufferLength((const xmlBufferPtr)buf);
18699: desret_int(ret_val);
18700: call_tests++;
18701: des_const_xmlBufferPtr(n_buf, (const xmlBufferPtr)buf, 0);
18702: xmlResetLastError();
18703: if (mem_base != xmlMemBlocks()) {
18704: printf("Leak of %d blocks found in xmlBufferLength",
18705: xmlMemBlocks() - mem_base);
18706: test_ret++;
18707: printf(" %d", n_buf);
18708: printf("\n");
18709: }
18710: }
18711: function_tests++;
18712:
18713: return(test_ret);
18714: }
18715:
18716:
18717: static int
18718: test_xmlBufferResize(void) {
18719: int test_ret = 0;
18720:
18721: int mem_base;
18722: int ret_val;
18723: xmlBufferPtr buf; /* the buffer to resize */
18724: int n_buf;
18725: unsigned int size; /* the desired size */
18726: int n_size;
18727:
18728: for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18729: for (n_size = 0;n_size < gen_nb_unsigned_int;n_size++) {
18730: mem_base = xmlMemBlocks();
18731: buf = gen_xmlBufferPtr(n_buf, 0);
18732: size = gen_unsigned_int(n_size, 1);
18733:
18734: ret_val = xmlBufferResize(buf, size);
18735: desret_int(ret_val);
18736: call_tests++;
18737: des_xmlBufferPtr(n_buf, buf, 0);
18738: des_unsigned_int(n_size, size, 1);
18739: xmlResetLastError();
18740: if (mem_base != xmlMemBlocks()) {
18741: printf("Leak of %d blocks found in xmlBufferResize",
18742: xmlMemBlocks() - mem_base);
18743: test_ret++;
18744: printf(" %d", n_buf);
18745: printf(" %d", n_size);
18746: printf("\n");
18747: }
18748: }
18749: }
18750: function_tests++;
18751:
18752: return(test_ret);
18753: }
18754:
18755:
18756: static int
18757: test_xmlBufferSetAllocationScheme(void) {
18758: int test_ret = 0;
18759:
18760: int mem_base;
18761: xmlBufferPtr buf; /* the buffer to tune */
18762: int n_buf;
18763: xmlBufferAllocationScheme scheme; /* allocation scheme to use */
18764: int n_scheme;
18765:
18766: for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18767: for (n_scheme = 0;n_scheme < gen_nb_xmlBufferAllocationScheme;n_scheme++) {
18768: mem_base = xmlMemBlocks();
18769: buf = gen_xmlBufferPtr(n_buf, 0);
18770: scheme = gen_xmlBufferAllocationScheme(n_scheme, 1);
18771:
18772: xmlBufferSetAllocationScheme(buf, scheme);
18773: if ((buf != NULL) && (scheme == XML_BUFFER_ALLOC_IMMUTABLE) && (buf->content != NULL) && (buf->content != static_buf_content)) { xmlFree(buf->content); buf->content = NULL;}
18774: call_tests++;
18775: des_xmlBufferPtr(n_buf, buf, 0);
18776: des_xmlBufferAllocationScheme(n_scheme, scheme, 1);
18777: xmlResetLastError();
18778: if (mem_base != xmlMemBlocks()) {
18779: printf("Leak of %d blocks found in xmlBufferSetAllocationScheme",
18780: xmlMemBlocks() - mem_base);
18781: test_ret++;
18782: printf(" %d", n_buf);
18783: printf(" %d", n_scheme);
18784: printf("\n");
18785: }
18786: }
18787: }
18788: function_tests++;
18789:
18790: return(test_ret);
18791: }
18792:
18793:
18794: static int
18795: test_xmlBufferShrink(void) {
18796: int test_ret = 0;
18797:
18798: int mem_base;
18799: int ret_val;
18800: xmlBufferPtr buf; /* the buffer to dump */
18801: int n_buf;
18802: unsigned int len; /* the number of xmlChar to remove */
18803: int n_len;
18804:
18805: for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18806: for (n_len = 0;n_len < gen_nb_unsigned_int;n_len++) {
18807: mem_base = xmlMemBlocks();
18808: buf = gen_xmlBufferPtr(n_buf, 0);
18809: len = gen_unsigned_int(n_len, 1);
18810:
18811: ret_val = xmlBufferShrink(buf, len);
18812: desret_int(ret_val);
18813: call_tests++;
18814: des_xmlBufferPtr(n_buf, buf, 0);
18815: des_unsigned_int(n_len, len, 1);
18816: xmlResetLastError();
18817: if (mem_base != xmlMemBlocks()) {
18818: printf("Leak of %d blocks found in xmlBufferShrink",
18819: xmlMemBlocks() - mem_base);
18820: test_ret++;
18821: printf(" %d", n_buf);
18822: printf(" %d", n_len);
18823: printf("\n");
18824: }
18825: }
18826: }
18827: function_tests++;
18828:
18829: return(test_ret);
18830: }
18831:
18832:
18833: static int
18834: test_xmlBufferWriteCHAR(void) {
18835: int test_ret = 0;
18836:
18837: int mem_base;
18838: xmlBufferPtr buf; /* the XML buffer */
18839: int n_buf;
18840: xmlChar * string; /* the string to add */
18841: int n_string;
18842:
18843: for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18844: for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
18845: mem_base = xmlMemBlocks();
18846: buf = gen_xmlBufferPtr(n_buf, 0);
18847: string = gen_const_xmlChar_ptr(n_string, 1);
18848:
18849: xmlBufferWriteCHAR(buf, (const xmlChar *)string);
18850: call_tests++;
18851: des_xmlBufferPtr(n_buf, buf, 0);
18852: des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 1);
18853: xmlResetLastError();
18854: if (mem_base != xmlMemBlocks()) {
18855: printf("Leak of %d blocks found in xmlBufferWriteCHAR",
18856: xmlMemBlocks() - mem_base);
18857: test_ret++;
18858: printf(" %d", n_buf);
18859: printf(" %d", n_string);
18860: printf("\n");
18861: }
18862: }
18863: }
18864: function_tests++;
18865:
18866: return(test_ret);
18867: }
18868:
18869:
18870: static int
18871: test_xmlBufferWriteChar(void) {
18872: int test_ret = 0;
18873:
18874: int mem_base;
18875: xmlBufferPtr buf; /* the XML buffer output */
18876: int n_buf;
18877: char * string; /* the string to add */
18878: int n_string;
18879:
18880: for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18881: for (n_string = 0;n_string < gen_nb_const_char_ptr;n_string++) {
18882: mem_base = xmlMemBlocks();
18883: buf = gen_xmlBufferPtr(n_buf, 0);
18884: string = gen_const_char_ptr(n_string, 1);
18885:
18886: xmlBufferWriteChar(buf, (const char *)string);
18887: call_tests++;
18888: des_xmlBufferPtr(n_buf, buf, 0);
18889: des_const_char_ptr(n_string, (const char *)string, 1);
18890: xmlResetLastError();
18891: if (mem_base != xmlMemBlocks()) {
18892: printf("Leak of %d blocks found in xmlBufferWriteChar",
18893: xmlMemBlocks() - mem_base);
18894: test_ret++;
18895: printf(" %d", n_buf);
18896: printf(" %d", n_string);
18897: printf("\n");
18898: }
18899: }
18900: }
18901: function_tests++;
18902:
18903: return(test_ret);
18904: }
18905:
18906:
18907: static int
18908: test_xmlBufferWriteQuotedString(void) {
18909: int test_ret = 0;
18910:
18911: int mem_base;
18912: xmlBufferPtr buf; /* the XML buffer output */
18913: int n_buf;
18914: xmlChar * string; /* the string to add */
18915: int n_string;
18916:
18917: for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18918: for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
18919: mem_base = xmlMemBlocks();
18920: buf = gen_xmlBufferPtr(n_buf, 0);
18921: string = gen_const_xmlChar_ptr(n_string, 1);
18922:
18923: xmlBufferWriteQuotedString(buf, (const xmlChar *)string);
18924: call_tests++;
18925: des_xmlBufferPtr(n_buf, buf, 0);
18926: des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 1);
18927: xmlResetLastError();
18928: if (mem_base != xmlMemBlocks()) {
18929: printf("Leak of %d blocks found in xmlBufferWriteQuotedString",
18930: xmlMemBlocks() - mem_base);
18931: test_ret++;
18932: printf(" %d", n_buf);
18933: printf(" %d", n_string);
18934: printf("\n");
18935: }
18936: }
18937: }
18938: function_tests++;
18939:
18940: return(test_ret);
18941: }
18942:
18943:
18944: static int
18945: test_xmlBuildQName(void) {
18946: int test_ret = 0;
18947:
18948: int mem_base;
18949: xmlChar * ret_val;
18950: xmlChar * ncname; /* the Name */
18951: int n_ncname;
18952: xmlChar * prefix; /* the prefix */
18953: int n_prefix;
18954: xmlChar * memory; /* preallocated memory */
18955: int n_memory;
18956: int len; /* preallocated memory length */
18957: int n_len;
18958:
18959: for (n_ncname = 0;n_ncname < gen_nb_const_xmlChar_ptr;n_ncname++) {
18960: for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
18961: for (n_memory = 0;n_memory < gen_nb_xmlChar_ptr;n_memory++) {
18962: for (n_len = 0;n_len < gen_nb_int;n_len++) {
18963: mem_base = xmlMemBlocks();
18964: ncname = gen_const_xmlChar_ptr(n_ncname, 0);
18965: prefix = gen_const_xmlChar_ptr(n_prefix, 1);
18966: memory = gen_xmlChar_ptr(n_memory, 2);
18967: len = gen_int(n_len, 3);
18968:
18969: ret_val = xmlBuildQName((const xmlChar *)ncname, (const xmlChar *)prefix, memory, len);
18970: if ((ret_val != NULL) && (ret_val != ncname) &&
18971: (ret_val != prefix) && (ret_val != memory))
18972: xmlFree(ret_val);
18973: ret_val = NULL;
18974: desret_xmlChar_ptr(ret_val);
18975: call_tests++;
18976: des_const_xmlChar_ptr(n_ncname, (const xmlChar *)ncname, 0);
18977: des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
18978: des_xmlChar_ptr(n_memory, memory, 2);
18979: des_int(n_len, len, 3);
18980: xmlResetLastError();
18981: if (mem_base != xmlMemBlocks()) {
18982: printf("Leak of %d blocks found in xmlBuildQName",
18983: xmlMemBlocks() - mem_base);
18984: test_ret++;
18985: printf(" %d", n_ncname);
18986: printf(" %d", n_prefix);
18987: printf(" %d", n_memory);
18988: printf(" %d", n_len);
18989: printf("\n");
18990: }
18991: }
18992: }
18993: }
18994: }
18995: function_tests++;
18996:
18997: return(test_ret);
18998: }
18999:
19000:
19001: static int
19002: test_xmlChildElementCount(void) {
19003: int test_ret = 0;
19004:
19005: #if defined(LIBXML_TREE_ENABLED)
19006: int mem_base;
19007: unsigned long ret_val;
19008: xmlNodePtr parent; /* the parent node */
19009: int n_parent;
19010:
19011: for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
19012: mem_base = xmlMemBlocks();
19013: parent = gen_xmlNodePtr(n_parent, 0);
19014:
19015: ret_val = xmlChildElementCount(parent);
19016: desret_unsigned_long(ret_val);
19017: call_tests++;
19018: des_xmlNodePtr(n_parent, parent, 0);
19019: xmlResetLastError();
19020: if (mem_base != xmlMemBlocks()) {
19021: printf("Leak of %d blocks found in xmlChildElementCount",
19022: xmlMemBlocks() - mem_base);
19023: test_ret++;
19024: printf(" %d", n_parent);
19025: printf("\n");
19026: }
19027: }
19028: function_tests++;
19029: #endif
19030:
19031: return(test_ret);
19032: }
19033:
19034:
19035: static int
19036: test_xmlCopyDoc(void) {
19037: int test_ret = 0;
19038:
19039: #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
19040: int mem_base;
19041: xmlDocPtr ret_val;
19042: xmlDocPtr doc; /* the document */
19043: int n_doc;
19044: int recursive; /* if not zero do a recursive copy. */
19045: int n_recursive;
19046:
19047: for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19048: for (n_recursive = 0;n_recursive < gen_nb_int;n_recursive++) {
19049: mem_base = xmlMemBlocks();
19050: doc = gen_xmlDocPtr(n_doc, 0);
19051: recursive = gen_int(n_recursive, 1);
19052:
19053: ret_val = xmlCopyDoc(doc, recursive);
19054: desret_xmlDocPtr(ret_val);
19055: call_tests++;
19056: des_xmlDocPtr(n_doc, doc, 0);
19057: des_int(n_recursive, recursive, 1);
19058: xmlResetLastError();
19059: if (mem_base != xmlMemBlocks()) {
19060: printf("Leak of %d blocks found in xmlCopyDoc",
19061: xmlMemBlocks() - mem_base);
19062: test_ret++;
19063: printf(" %d", n_doc);
19064: printf(" %d", n_recursive);
19065: printf("\n");
19066: }
19067: }
19068: }
19069: function_tests++;
19070: #endif
19071:
19072: return(test_ret);
19073: }
19074:
19075:
19076: static int
19077: test_xmlCopyDtd(void) {
19078: int test_ret = 0;
19079:
19080: #if defined(LIBXML_TREE_ENABLED)
19081: int mem_base;
19082: xmlDtdPtr ret_val;
19083: xmlDtdPtr dtd; /* the dtd */
19084: int n_dtd;
19085:
19086: for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
19087: mem_base = xmlMemBlocks();
19088: dtd = gen_xmlDtdPtr(n_dtd, 0);
19089:
19090: ret_val = xmlCopyDtd(dtd);
19091: desret_xmlDtdPtr(ret_val);
19092: call_tests++;
19093: des_xmlDtdPtr(n_dtd, dtd, 0);
19094: xmlResetLastError();
19095: if (mem_base != xmlMemBlocks()) {
19096: printf("Leak of %d blocks found in xmlCopyDtd",
19097: xmlMemBlocks() - mem_base);
19098: test_ret++;
19099: printf(" %d", n_dtd);
19100: printf("\n");
19101: }
19102: }
19103: function_tests++;
19104: #endif
19105:
19106: return(test_ret);
19107: }
19108:
19109:
19110: static int
19111: test_xmlCopyNamespace(void) {
19112: int test_ret = 0;
19113:
19114: int mem_base;
19115: xmlNsPtr ret_val;
19116: xmlNsPtr cur; /* the namespace */
19117: int n_cur;
19118:
19119: for (n_cur = 0;n_cur < gen_nb_xmlNsPtr;n_cur++) {
19120: mem_base = xmlMemBlocks();
19121: cur = gen_xmlNsPtr(n_cur, 0);
19122:
19123: ret_val = xmlCopyNamespace(cur);
19124: if (ret_val != NULL) xmlFreeNs(ret_val);
19125: desret_xmlNsPtr(ret_val);
19126: call_tests++;
19127: des_xmlNsPtr(n_cur, cur, 0);
19128: xmlResetLastError();
19129: if (mem_base != xmlMemBlocks()) {
19130: printf("Leak of %d blocks found in xmlCopyNamespace",
19131: xmlMemBlocks() - mem_base);
19132: test_ret++;
19133: printf(" %d", n_cur);
19134: printf("\n");
19135: }
19136: }
19137: function_tests++;
19138:
19139: return(test_ret);
19140: }
19141:
19142:
19143: static int
19144: test_xmlCopyNamespaceList(void) {
19145: int test_ret = 0;
19146:
19147: int mem_base;
19148: xmlNsPtr ret_val;
19149: xmlNsPtr cur; /* the first namespace */
19150: int n_cur;
19151:
19152: for (n_cur = 0;n_cur < gen_nb_xmlNsPtr;n_cur++) {
19153: mem_base = xmlMemBlocks();
19154: cur = gen_xmlNsPtr(n_cur, 0);
19155:
19156: ret_val = xmlCopyNamespaceList(cur);
19157: if (ret_val != NULL) xmlFreeNsList(ret_val);
19158: desret_xmlNsPtr(ret_val);
19159: call_tests++;
19160: des_xmlNsPtr(n_cur, cur, 0);
19161: xmlResetLastError();
19162: if (mem_base != xmlMemBlocks()) {
19163: printf("Leak of %d blocks found in xmlCopyNamespaceList",
19164: xmlMemBlocks() - mem_base);
19165: test_ret++;
19166: printf(" %d", n_cur);
19167: printf("\n");
19168: }
19169: }
19170: function_tests++;
19171:
19172: return(test_ret);
19173: }
19174:
19175:
19176: static int
19177: test_xmlCopyNode(void) {
19178: int test_ret = 0;
19179:
19180: int mem_base;
19181: xmlNodePtr ret_val;
19182: xmlNodePtr node; /* the node */
19183: int n_node;
19184: int extended; /* if 1 do a recursive copy (properties, namespaces and children when applicable) if 2 copy properties and namespaces (when applicable) */
19185: int n_extended;
19186:
19187: for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
19188: for (n_extended = 0;n_extended < gen_nb_int;n_extended++) {
19189: mem_base = xmlMemBlocks();
19190: node = gen_const_xmlNodePtr(n_node, 0);
19191: extended = gen_int(n_extended, 1);
19192:
19193: ret_val = xmlCopyNode((const xmlNodePtr)node, extended);
19194: desret_xmlNodePtr(ret_val);
19195: call_tests++;
19196: des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 0);
19197: des_int(n_extended, extended, 1);
19198: xmlResetLastError();
19199: if (mem_base != xmlMemBlocks()) {
19200: printf("Leak of %d blocks found in xmlCopyNode",
19201: xmlMemBlocks() - mem_base);
19202: test_ret++;
19203: printf(" %d", n_node);
19204: printf(" %d", n_extended);
19205: printf("\n");
19206: }
19207: }
19208: }
19209: function_tests++;
19210:
19211: return(test_ret);
19212: }
19213:
19214:
19215: static int
19216: test_xmlCopyNodeList(void) {
19217: int test_ret = 0;
19218:
19219: int mem_base;
19220: xmlNodePtr ret_val;
19221: xmlNodePtr node; /* the first node in the list. */
19222: int n_node;
19223:
19224: for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
19225: mem_base = xmlMemBlocks();
19226: node = gen_const_xmlNodePtr(n_node, 0);
19227:
19228: ret_val = xmlCopyNodeList((const xmlNodePtr)node);
19229: desret_xmlNodePtr(ret_val);
19230: call_tests++;
19231: des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 0);
19232: xmlResetLastError();
19233: if (mem_base != xmlMemBlocks()) {
19234: printf("Leak of %d blocks found in xmlCopyNodeList",
19235: xmlMemBlocks() - mem_base);
19236: test_ret++;
19237: printf(" %d", n_node);
19238: printf("\n");
19239: }
19240: }
19241: function_tests++;
19242:
19243: return(test_ret);
19244: }
19245:
19246:
19247: static int
19248: test_xmlCopyProp(void) {
19249: int test_ret = 0;
19250:
19251: int mem_base;
19252: xmlAttrPtr ret_val;
19253: xmlNodePtr target; /* the element where the attribute will be grafted */
19254: int n_target;
19255: xmlAttrPtr cur; /* the attribute */
19256: int n_cur;
19257:
19258: for (n_target = 0;n_target < gen_nb_xmlNodePtr;n_target++) {
19259: for (n_cur = 0;n_cur < gen_nb_xmlAttrPtr;n_cur++) {
19260: mem_base = xmlMemBlocks();
19261: target = gen_xmlNodePtr(n_target, 0);
19262: cur = gen_xmlAttrPtr(n_cur, 1);
19263:
19264: ret_val = xmlCopyProp(target, cur);
19265: desret_xmlAttrPtr(ret_val);
19266: call_tests++;
19267: des_xmlNodePtr(n_target, target, 0);
19268: des_xmlAttrPtr(n_cur, cur, 1);
19269: xmlResetLastError();
19270: if (mem_base != xmlMemBlocks()) {
19271: printf("Leak of %d blocks found in xmlCopyProp",
19272: xmlMemBlocks() - mem_base);
19273: test_ret++;
19274: printf(" %d", n_target);
19275: printf(" %d", n_cur);
19276: printf("\n");
19277: }
19278: }
19279: }
19280: function_tests++;
19281:
19282: return(test_ret);
19283: }
19284:
19285:
19286: static int
19287: test_xmlCopyPropList(void) {
19288: int test_ret = 0;
19289:
19290: int mem_base;
19291: xmlAttrPtr ret_val;
19292: xmlNodePtr target; /* the element where the attributes will be grafted */
19293: int n_target;
19294: xmlAttrPtr cur; /* the first attribute */
19295: int n_cur;
19296:
19297: for (n_target = 0;n_target < gen_nb_xmlNodePtr;n_target++) {
19298: for (n_cur = 0;n_cur < gen_nb_xmlAttrPtr;n_cur++) {
19299: mem_base = xmlMemBlocks();
19300: target = gen_xmlNodePtr(n_target, 0);
19301: cur = gen_xmlAttrPtr(n_cur, 1);
19302:
19303: ret_val = xmlCopyPropList(target, cur);
19304: desret_xmlAttrPtr(ret_val);
19305: call_tests++;
19306: des_xmlNodePtr(n_target, target, 0);
19307: des_xmlAttrPtr(n_cur, cur, 1);
19308: xmlResetLastError();
19309: if (mem_base != xmlMemBlocks()) {
19310: printf("Leak of %d blocks found in xmlCopyPropList",
19311: xmlMemBlocks() - mem_base);
19312: test_ret++;
19313: printf(" %d", n_target);
19314: printf(" %d", n_cur);
19315: printf("\n");
19316: }
19317: }
19318: }
19319: function_tests++;
19320:
19321: return(test_ret);
19322: }
19323:
19324:
19325: static int
19326: test_xmlCreateIntSubset(void) {
19327: int test_ret = 0;
19328:
19329: int mem_base;
19330: xmlDtdPtr ret_val;
19331: xmlDocPtr doc; /* the document pointer */
19332: int n_doc;
19333: xmlChar * name; /* the DTD name */
19334: int n_name;
19335: xmlChar * ExternalID; /* the external (PUBLIC) ID */
19336: int n_ExternalID;
19337: xmlChar * SystemID; /* the system ID */
19338: int n_SystemID;
19339:
19340: for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19341: for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
19342: for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
19343: for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
19344: mem_base = xmlMemBlocks();
19345: doc = gen_xmlDocPtr(n_doc, 0);
19346: name = gen_const_xmlChar_ptr(n_name, 1);
19347: ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 2);
19348: SystemID = gen_const_xmlChar_ptr(n_SystemID, 3);
19349:
19350: ret_val = xmlCreateIntSubset(doc, (const xmlChar *)name, (const xmlChar *)ExternalID, (const xmlChar *)SystemID);
19351: desret_xmlDtdPtr(ret_val);
19352: call_tests++;
19353: des_xmlDocPtr(n_doc, doc, 0);
19354: des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
19355: des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 2);
19356: des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 3);
19357: xmlResetLastError();
19358: if (mem_base != xmlMemBlocks()) {
19359: printf("Leak of %d blocks found in xmlCreateIntSubset",
19360: xmlMemBlocks() - mem_base);
19361: test_ret++;
19362: printf(" %d", n_doc);
19363: printf(" %d", n_name);
19364: printf(" %d", n_ExternalID);
19365: printf(" %d", n_SystemID);
19366: printf("\n");
19367: }
19368: }
19369: }
19370: }
19371: }
19372: function_tests++;
19373:
19374: return(test_ret);
19375: }
19376:
19377:
19378: #define gen_nb_xmlDOMWrapCtxtPtr 1
19379: static xmlDOMWrapCtxtPtr gen_xmlDOMWrapCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
19380: return(NULL);
19381: }
19382: static void des_xmlDOMWrapCtxtPtr(int no ATTRIBUTE_UNUSED, xmlDOMWrapCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
19383: }
19384:
19385: static int
19386: test_xmlDOMWrapAdoptNode(void) {
19387: int test_ret = 0;
19388:
19389: int mem_base;
19390: int ret_val;
19391: xmlDOMWrapCtxtPtr ctxt; /* the optional context for custom processing */
19392: int n_ctxt;
19393: xmlDocPtr sourceDoc; /* the optional sourceDoc */
19394: int n_sourceDoc;
19395: xmlNodePtr node; /* the node to start with */
19396: int n_node;
19397: xmlDocPtr destDoc; /* the destination doc */
19398: int n_destDoc;
19399: xmlNodePtr destParent; /* the optional new parent of @node in @destDoc */
19400: int n_destParent;
19401: int options; /* option flags */
19402: int n_options;
19403:
19404: for (n_ctxt = 0;n_ctxt < gen_nb_xmlDOMWrapCtxtPtr;n_ctxt++) {
19405: for (n_sourceDoc = 0;n_sourceDoc < gen_nb_xmlDocPtr;n_sourceDoc++) {
19406: for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
19407: for (n_destDoc = 0;n_destDoc < gen_nb_xmlDocPtr;n_destDoc++) {
19408: for (n_destParent = 0;n_destParent < gen_nb_xmlNodePtr;n_destParent++) {
19409: for (n_options = 0;n_options < gen_nb_int;n_options++) {
19410: mem_base = xmlMemBlocks();
19411: ctxt = gen_xmlDOMWrapCtxtPtr(n_ctxt, 0);
19412: sourceDoc = gen_xmlDocPtr(n_sourceDoc, 1);
19413: node = gen_xmlNodePtr(n_node, 2);
19414: destDoc = gen_xmlDocPtr(n_destDoc, 3);
19415: destParent = gen_xmlNodePtr(n_destParent, 4);
19416: options = gen_int(n_options, 5);
19417:
19418: ret_val = xmlDOMWrapAdoptNode(ctxt, sourceDoc, node, destDoc, destParent, options);
19419: if ((node != NULL) && (node->parent == NULL)) {xmlUnlinkNode(node);xmlFreeNode(node);node = NULL;}
19420: desret_int(ret_val);
19421: call_tests++;
19422: des_xmlDOMWrapCtxtPtr(n_ctxt, ctxt, 0);
19423: des_xmlDocPtr(n_sourceDoc, sourceDoc, 1);
19424: des_xmlNodePtr(n_node, node, 2);
19425: des_xmlDocPtr(n_destDoc, destDoc, 3);
19426: des_xmlNodePtr(n_destParent, destParent, 4);
19427: des_int(n_options, options, 5);
19428: xmlResetLastError();
19429: if (mem_base != xmlMemBlocks()) {
19430: printf("Leak of %d blocks found in xmlDOMWrapAdoptNode",
19431: xmlMemBlocks() - mem_base);
19432: test_ret++;
19433: printf(" %d", n_ctxt);
19434: printf(" %d", n_sourceDoc);
19435: printf(" %d", n_node);
19436: printf(" %d", n_destDoc);
19437: printf(" %d", n_destParent);
19438: printf(" %d", n_options);
19439: printf("\n");
19440: }
19441: }
19442: }
19443: }
19444: }
19445: }
19446: }
19447: function_tests++;
19448:
19449: return(test_ret);
19450: }
19451:
19452:
19453: static int
19454: test_xmlDOMWrapCloneNode(void) {
19455: int test_ret = 0;
19456:
19457: int mem_base;
19458: int ret_val;
19459: xmlDOMWrapCtxtPtr ctxt; /* the optional context for custom processing */
19460: int n_ctxt;
19461: xmlDocPtr sourceDoc; /* the optional sourceDoc */
19462: int n_sourceDoc;
19463: xmlNodePtr node; /* the node to start with */
19464: int n_node;
19465: xmlNodePtr * resNode; /* the clone of the given @node */
19466: int n_resNode;
19467: xmlDocPtr destDoc; /* the destination doc */
19468: int n_destDoc;
19469: xmlNodePtr destParent; /* the optional new parent of @node in @destDoc */
19470: int n_destParent;
19471: int deep; /* descend into child if set */
19472: int n_deep;
19473: int options; /* option flags */
19474: int n_options;
19475:
19476: for (n_ctxt = 0;n_ctxt < gen_nb_xmlDOMWrapCtxtPtr;n_ctxt++) {
19477: for (n_sourceDoc = 0;n_sourceDoc < gen_nb_xmlDocPtr;n_sourceDoc++) {
19478: for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
19479: for (n_resNode = 0;n_resNode < gen_nb_xmlNodePtr_ptr;n_resNode++) {
19480: for (n_destDoc = 0;n_destDoc < gen_nb_xmlDocPtr;n_destDoc++) {
19481: for (n_destParent = 0;n_destParent < gen_nb_xmlNodePtr;n_destParent++) {
19482: for (n_deep = 0;n_deep < gen_nb_int;n_deep++) {
19483: for (n_options = 0;n_options < gen_nb_int;n_options++) {
19484: mem_base = xmlMemBlocks();
19485: ctxt = gen_xmlDOMWrapCtxtPtr(n_ctxt, 0);
19486: sourceDoc = gen_xmlDocPtr(n_sourceDoc, 1);
19487: node = gen_xmlNodePtr(n_node, 2);
19488: resNode = gen_xmlNodePtr_ptr(n_resNode, 3);
19489: destDoc = gen_xmlDocPtr(n_destDoc, 4);
19490: destParent = gen_xmlNodePtr(n_destParent, 5);
19491: deep = gen_int(n_deep, 6);
19492: options = gen_int(n_options, 7);
19493:
19494: ret_val = xmlDOMWrapCloneNode(ctxt, sourceDoc, node, resNode, destDoc, destParent, deep, options);
19495: desret_int(ret_val);
19496: call_tests++;
19497: des_xmlDOMWrapCtxtPtr(n_ctxt, ctxt, 0);
19498: des_xmlDocPtr(n_sourceDoc, sourceDoc, 1);
19499: des_xmlNodePtr(n_node, node, 2);
19500: des_xmlNodePtr_ptr(n_resNode, resNode, 3);
19501: des_xmlDocPtr(n_destDoc, destDoc, 4);
19502: des_xmlNodePtr(n_destParent, destParent, 5);
19503: des_int(n_deep, deep, 6);
19504: des_int(n_options, options, 7);
19505: xmlResetLastError();
19506: if (mem_base != xmlMemBlocks()) {
19507: printf("Leak of %d blocks found in xmlDOMWrapCloneNode",
19508: xmlMemBlocks() - mem_base);
19509: test_ret++;
19510: printf(" %d", n_ctxt);
19511: printf(" %d", n_sourceDoc);
19512: printf(" %d", n_node);
19513: printf(" %d", n_resNode);
19514: printf(" %d", n_destDoc);
19515: printf(" %d", n_destParent);
19516: printf(" %d", n_deep);
19517: printf(" %d", n_options);
19518: printf("\n");
19519: }
19520: }
19521: }
19522: }
19523: }
19524: }
19525: }
19526: }
19527: }
19528: function_tests++;
19529:
19530: return(test_ret);
19531: }
19532:
19533:
19534: static int
19535: test_xmlDOMWrapNewCtxt(void) {
19536: int test_ret = 0;
19537:
19538:
19539: /* missing type support */
19540: return(test_ret);
19541: }
19542:
19543:
19544: static int
19545: test_xmlDOMWrapReconcileNamespaces(void) {
19546: int test_ret = 0;
19547:
19548: int mem_base;
19549: int ret_val;
19550: xmlDOMWrapCtxtPtr ctxt; /* DOM wrapper context, unused at the moment */
19551: int n_ctxt;
19552: xmlNodePtr elem; /* the element-node */
19553: int n_elem;
19554: int options; /* option flags */
19555: int n_options;
19556:
19557: for (n_ctxt = 0;n_ctxt < gen_nb_xmlDOMWrapCtxtPtr;n_ctxt++) {
19558: for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
19559: for (n_options = 0;n_options < gen_nb_int;n_options++) {
19560: mem_base = xmlMemBlocks();
19561: ctxt = gen_xmlDOMWrapCtxtPtr(n_ctxt, 0);
19562: elem = gen_xmlNodePtr(n_elem, 1);
19563: options = gen_int(n_options, 2);
19564:
19565: ret_val = xmlDOMWrapReconcileNamespaces(ctxt, elem, options);
19566: desret_int(ret_val);
19567: call_tests++;
19568: des_xmlDOMWrapCtxtPtr(n_ctxt, ctxt, 0);
19569: des_xmlNodePtr(n_elem, elem, 1);
19570: des_int(n_options, options, 2);
19571: xmlResetLastError();
19572: if (mem_base != xmlMemBlocks()) {
19573: printf("Leak of %d blocks found in xmlDOMWrapReconcileNamespaces",
19574: xmlMemBlocks() - mem_base);
19575: test_ret++;
19576: printf(" %d", n_ctxt);
19577: printf(" %d", n_elem);
19578: printf(" %d", n_options);
19579: printf("\n");
19580: }
19581: }
19582: }
19583: }
19584: function_tests++;
19585:
19586: return(test_ret);
19587: }
19588:
19589:
19590: static int
19591: test_xmlDOMWrapRemoveNode(void) {
19592: int test_ret = 0;
19593:
19594: int mem_base;
19595: int ret_val;
19596: xmlDOMWrapCtxtPtr ctxt; /* a DOM wrapper context */
19597: int n_ctxt;
19598: xmlDocPtr doc; /* the doc */
19599: int n_doc;
19600: xmlNodePtr node; /* the node to be removed. */
19601: int n_node;
19602: int options; /* set of options, unused at the moment */
19603: int n_options;
19604:
19605: for (n_ctxt = 0;n_ctxt < gen_nb_xmlDOMWrapCtxtPtr;n_ctxt++) {
19606: for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19607: for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
19608: for (n_options = 0;n_options < gen_nb_int;n_options++) {
19609: mem_base = xmlMemBlocks();
19610: ctxt = gen_xmlDOMWrapCtxtPtr(n_ctxt, 0);
19611: doc = gen_xmlDocPtr(n_doc, 1);
19612: node = gen_xmlNodePtr(n_node, 2);
19613: options = gen_int(n_options, 3);
19614:
19615: ret_val = xmlDOMWrapRemoveNode(ctxt, doc, node, options);
19616: desret_int(ret_val);
19617: call_tests++;
19618: des_xmlDOMWrapCtxtPtr(n_ctxt, ctxt, 0);
19619: des_xmlDocPtr(n_doc, doc, 1);
19620: des_xmlNodePtr(n_node, node, 2);
19621: des_int(n_options, options, 3);
19622: xmlResetLastError();
19623: if (mem_base != xmlMemBlocks()) {
19624: printf("Leak of %d blocks found in xmlDOMWrapRemoveNode",
19625: xmlMemBlocks() - mem_base);
19626: test_ret++;
19627: printf(" %d", n_ctxt);
19628: printf(" %d", n_doc);
19629: printf(" %d", n_node);
19630: printf(" %d", n_options);
19631: printf("\n");
19632: }
19633: }
19634: }
19635: }
19636: }
19637: function_tests++;
19638:
19639: return(test_ret);
19640: }
19641:
19642:
19643: static int
19644: test_xmlDocCopyNode(void) {
19645: int test_ret = 0;
19646:
19647: int mem_base;
19648: xmlNodePtr ret_val;
19649: xmlNodePtr node; /* the node */
19650: int n_node;
19651: xmlDocPtr doc; /* the document */
19652: int n_doc;
19653: int extended; /* if 1 do a recursive copy (properties, namespaces and children when applicable) if 2 copy properties and namespaces (when applicable) */
19654: int n_extended;
19655:
19656: for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
19657: for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19658: for (n_extended = 0;n_extended < gen_nb_int;n_extended++) {
19659: mem_base = xmlMemBlocks();
19660: node = gen_const_xmlNodePtr(n_node, 0);
19661: doc = gen_xmlDocPtr(n_doc, 1);
19662: extended = gen_int(n_extended, 2);
19663:
19664: ret_val = xmlDocCopyNode((const xmlNodePtr)node, doc, extended);
19665: desret_xmlNodePtr(ret_val);
19666: call_tests++;
19667: des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 0);
19668: des_xmlDocPtr(n_doc, doc, 1);
19669: des_int(n_extended, extended, 2);
19670: xmlResetLastError();
19671: if (mem_base != xmlMemBlocks()) {
19672: printf("Leak of %d blocks found in xmlDocCopyNode",
19673: xmlMemBlocks() - mem_base);
19674: test_ret++;
19675: printf(" %d", n_node);
19676: printf(" %d", n_doc);
19677: printf(" %d", n_extended);
19678: printf("\n");
19679: }
19680: }
19681: }
19682: }
19683: function_tests++;
19684:
19685: return(test_ret);
19686: }
19687:
19688:
19689: static int
19690: test_xmlDocCopyNodeList(void) {
19691: int test_ret = 0;
19692:
19693: int mem_base;
19694: xmlNodePtr ret_val;
19695: xmlDocPtr doc; /* the target document */
19696: int n_doc;
19697: xmlNodePtr node; /* the first node in the list. */
19698: int n_node;
19699:
19700: for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19701: for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
19702: mem_base = xmlMemBlocks();
19703: doc = gen_xmlDocPtr(n_doc, 0);
19704: node = gen_const_xmlNodePtr(n_node, 1);
19705:
19706: ret_val = xmlDocCopyNodeList(doc, (const xmlNodePtr)node);
19707: desret_xmlNodePtr(ret_val);
19708: call_tests++;
19709: des_xmlDocPtr(n_doc, doc, 0);
19710: des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 1);
19711: xmlResetLastError();
19712: if (mem_base != xmlMemBlocks()) {
19713: printf("Leak of %d blocks found in xmlDocCopyNodeList",
19714: xmlMemBlocks() - mem_base);
19715: test_ret++;
19716: printf(" %d", n_doc);
19717: printf(" %d", n_node);
19718: printf("\n");
19719: }
19720: }
19721: }
19722: function_tests++;
19723:
19724: return(test_ret);
19725: }
19726:
19727:
19728: static int
19729: test_xmlDocDump(void) {
19730: int test_ret = 0;
19731:
19732: #if defined(LIBXML_OUTPUT_ENABLED)
19733: int mem_base;
19734: int ret_val;
19735: FILE * f; /* the FILE* */
19736: int n_f;
19737: xmlDocPtr cur; /* the document */
19738: int n_cur;
19739:
19740: for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) {
19741: for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
19742: mem_base = xmlMemBlocks();
19743: f = gen_FILE_ptr(n_f, 0);
19744: cur = gen_xmlDocPtr(n_cur, 1);
19745:
19746: ret_val = xmlDocDump(f, cur);
19747: desret_int(ret_val);
19748: call_tests++;
19749: des_FILE_ptr(n_f, f, 0);
19750: des_xmlDocPtr(n_cur, cur, 1);
19751: xmlResetLastError();
19752: if (mem_base != xmlMemBlocks()) {
19753: printf("Leak of %d blocks found in xmlDocDump",
19754: xmlMemBlocks() - mem_base);
19755: test_ret++;
19756: printf(" %d", n_f);
19757: printf(" %d", n_cur);
19758: printf("\n");
19759: }
19760: }
19761: }
19762: function_tests++;
19763: #endif
19764:
19765: return(test_ret);
19766: }
19767:
19768:
19769: static int
19770: test_xmlDocDumpFormatMemory(void) {
19771: int test_ret = 0;
19772:
19773: #if defined(LIBXML_OUTPUT_ENABLED)
19774: int mem_base;
19775: xmlDocPtr cur; /* the document */
19776: int n_cur;
19777: xmlChar ** mem; /* OUT: the memory pointer */
19778: int n_mem;
19779: int * size; /* OUT: the memory length */
19780: int n_size;
19781: int format; /* should formatting spaces been added */
19782: int n_format;
19783:
19784: for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
19785: for (n_mem = 0;n_mem < gen_nb_xmlChar_ptr_ptr;n_mem++) {
19786: for (n_size = 0;n_size < gen_nb_int_ptr;n_size++) {
19787: for (n_format = 0;n_format < gen_nb_int;n_format++) {
19788: mem_base = xmlMemBlocks();
19789: cur = gen_xmlDocPtr(n_cur, 0);
19790: mem = gen_xmlChar_ptr_ptr(n_mem, 1);
19791: size = gen_int_ptr(n_size, 2);
19792: format = gen_int(n_format, 3);
19793:
19794: xmlDocDumpFormatMemory(cur, mem, size, format);
19795: call_tests++;
19796: des_xmlDocPtr(n_cur, cur, 0);
19797: des_xmlChar_ptr_ptr(n_mem, mem, 1);
19798: des_int_ptr(n_size, size, 2);
19799: des_int(n_format, format, 3);
19800: xmlResetLastError();
19801: if (mem_base != xmlMemBlocks()) {
19802: printf("Leak of %d blocks found in xmlDocDumpFormatMemory",
19803: xmlMemBlocks() - mem_base);
19804: test_ret++;
19805: printf(" %d", n_cur);
19806: printf(" %d", n_mem);
19807: printf(" %d", n_size);
19808: printf(" %d", n_format);
19809: printf("\n");
19810: }
19811: }
19812: }
19813: }
19814: }
19815: function_tests++;
19816: #endif
19817:
19818: return(test_ret);
19819: }
19820:
19821:
19822: static int
19823: test_xmlDocDumpFormatMemoryEnc(void) {
19824: int test_ret = 0;
19825:
19826: #if defined(LIBXML_OUTPUT_ENABLED)
19827: int mem_base;
19828: xmlDocPtr out_doc; /* Document to generate XML text from */
19829: int n_out_doc;
19830: xmlChar ** doc_txt_ptr; /* Memory pointer for allocated XML text */
19831: int n_doc_txt_ptr;
19832: int * doc_txt_len; /* Length of the generated XML text */
19833: int n_doc_txt_len;
19834: char * txt_encoding; /* Character encoding to use when generating XML text */
19835: int n_txt_encoding;
19836: int format; /* should formatting spaces been added */
19837: int n_format;
19838:
19839: for (n_out_doc = 0;n_out_doc < gen_nb_xmlDocPtr;n_out_doc++) {
19840: for (n_doc_txt_ptr = 0;n_doc_txt_ptr < gen_nb_xmlChar_ptr_ptr;n_doc_txt_ptr++) {
19841: for (n_doc_txt_len = 0;n_doc_txt_len < gen_nb_int_ptr;n_doc_txt_len++) {
19842: for (n_txt_encoding = 0;n_txt_encoding < gen_nb_const_char_ptr;n_txt_encoding++) {
19843: for (n_format = 0;n_format < gen_nb_int;n_format++) {
19844: mem_base = xmlMemBlocks();
19845: out_doc = gen_xmlDocPtr(n_out_doc, 0);
19846: doc_txt_ptr = gen_xmlChar_ptr_ptr(n_doc_txt_ptr, 1);
19847: doc_txt_len = gen_int_ptr(n_doc_txt_len, 2);
19848: txt_encoding = gen_const_char_ptr(n_txt_encoding, 3);
19849: format = gen_int(n_format, 4);
19850:
19851: xmlDocDumpFormatMemoryEnc(out_doc, doc_txt_ptr, doc_txt_len, (const char *)txt_encoding, format);
19852: call_tests++;
19853: des_xmlDocPtr(n_out_doc, out_doc, 0);
19854: des_xmlChar_ptr_ptr(n_doc_txt_ptr, doc_txt_ptr, 1);
19855: des_int_ptr(n_doc_txt_len, doc_txt_len, 2);
19856: des_const_char_ptr(n_txt_encoding, (const char *)txt_encoding, 3);
19857: des_int(n_format, format, 4);
19858: xmlResetLastError();
19859: if (mem_base != xmlMemBlocks()) {
19860: printf("Leak of %d blocks found in xmlDocDumpFormatMemoryEnc",
19861: xmlMemBlocks() - mem_base);
19862: test_ret++;
19863: printf(" %d", n_out_doc);
19864: printf(" %d", n_doc_txt_ptr);
19865: printf(" %d", n_doc_txt_len);
19866: printf(" %d", n_txt_encoding);
19867: printf(" %d", n_format);
19868: printf("\n");
19869: }
19870: }
19871: }
19872: }
19873: }
19874: }
19875: function_tests++;
19876: #endif
19877:
19878: return(test_ret);
19879: }
19880:
19881:
19882: static int
19883: test_xmlDocDumpMemory(void) {
19884: int test_ret = 0;
19885:
19886: #if defined(LIBXML_OUTPUT_ENABLED)
19887: int mem_base;
19888: xmlDocPtr cur; /* the document */
19889: int n_cur;
19890: xmlChar ** mem; /* OUT: the memory pointer */
19891: int n_mem;
19892: int * size; /* OUT: the memory length */
19893: int n_size;
19894:
19895: for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
19896: for (n_mem = 0;n_mem < gen_nb_xmlChar_ptr_ptr;n_mem++) {
19897: for (n_size = 0;n_size < gen_nb_int_ptr;n_size++) {
19898: mem_base = xmlMemBlocks();
19899: cur = gen_xmlDocPtr(n_cur, 0);
19900: mem = gen_xmlChar_ptr_ptr(n_mem, 1);
19901: size = gen_int_ptr(n_size, 2);
19902:
19903: xmlDocDumpMemory(cur, mem, size);
19904: call_tests++;
19905: des_xmlDocPtr(n_cur, cur, 0);
19906: des_xmlChar_ptr_ptr(n_mem, mem, 1);
19907: des_int_ptr(n_size, size, 2);
19908: xmlResetLastError();
19909: if (mem_base != xmlMemBlocks()) {
19910: printf("Leak of %d blocks found in xmlDocDumpMemory",
19911: xmlMemBlocks() - mem_base);
19912: test_ret++;
19913: printf(" %d", n_cur);
19914: printf(" %d", n_mem);
19915: printf(" %d", n_size);
19916: printf("\n");
19917: }
19918: }
19919: }
19920: }
19921: function_tests++;
19922: #endif
19923:
19924: return(test_ret);
19925: }
19926:
19927:
19928: static int
19929: test_xmlDocDumpMemoryEnc(void) {
19930: int test_ret = 0;
19931:
19932: #if defined(LIBXML_OUTPUT_ENABLED)
19933: int mem_base;
19934: xmlDocPtr out_doc; /* Document to generate XML text from */
19935: int n_out_doc;
19936: xmlChar ** doc_txt_ptr; /* Memory pointer for allocated XML text */
19937: int n_doc_txt_ptr;
19938: int * doc_txt_len; /* Length of the generated XML text */
19939: int n_doc_txt_len;
19940: char * txt_encoding; /* Character encoding to use when generating XML text */
19941: int n_txt_encoding;
19942:
19943: for (n_out_doc = 0;n_out_doc < gen_nb_xmlDocPtr;n_out_doc++) {
19944: for (n_doc_txt_ptr = 0;n_doc_txt_ptr < gen_nb_xmlChar_ptr_ptr;n_doc_txt_ptr++) {
19945: for (n_doc_txt_len = 0;n_doc_txt_len < gen_nb_int_ptr;n_doc_txt_len++) {
19946: for (n_txt_encoding = 0;n_txt_encoding < gen_nb_const_char_ptr;n_txt_encoding++) {
19947: mem_base = xmlMemBlocks();
19948: out_doc = gen_xmlDocPtr(n_out_doc, 0);
19949: doc_txt_ptr = gen_xmlChar_ptr_ptr(n_doc_txt_ptr, 1);
19950: doc_txt_len = gen_int_ptr(n_doc_txt_len, 2);
19951: txt_encoding = gen_const_char_ptr(n_txt_encoding, 3);
19952:
19953: xmlDocDumpMemoryEnc(out_doc, doc_txt_ptr, doc_txt_len, (const char *)txt_encoding);
19954: call_tests++;
19955: des_xmlDocPtr(n_out_doc, out_doc, 0);
19956: des_xmlChar_ptr_ptr(n_doc_txt_ptr, doc_txt_ptr, 1);
19957: des_int_ptr(n_doc_txt_len, doc_txt_len, 2);
19958: des_const_char_ptr(n_txt_encoding, (const char *)txt_encoding, 3);
19959: xmlResetLastError();
19960: if (mem_base != xmlMemBlocks()) {
19961: printf("Leak of %d blocks found in xmlDocDumpMemoryEnc",
19962: xmlMemBlocks() - mem_base);
19963: test_ret++;
19964: printf(" %d", n_out_doc);
19965: printf(" %d", n_doc_txt_ptr);
19966: printf(" %d", n_doc_txt_len);
19967: printf(" %d", n_txt_encoding);
19968: printf("\n");
19969: }
19970: }
19971: }
19972: }
19973: }
19974: function_tests++;
19975: #endif
19976:
19977: return(test_ret);
19978: }
19979:
19980:
19981: static int
19982: test_xmlDocFormatDump(void) {
19983: int test_ret = 0;
19984:
19985: #if defined(LIBXML_OUTPUT_ENABLED)
19986: int mem_base;
19987: int ret_val;
19988: FILE * f; /* the FILE* */
19989: int n_f;
19990: xmlDocPtr cur; /* the document */
19991: int n_cur;
19992: int format; /* should formatting spaces been added */
19993: int n_format;
19994:
19995: for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) {
19996: for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
19997: for (n_format = 0;n_format < gen_nb_int;n_format++) {
19998: mem_base = xmlMemBlocks();
19999: f = gen_FILE_ptr(n_f, 0);
20000: cur = gen_xmlDocPtr(n_cur, 1);
20001: format = gen_int(n_format, 2);
20002:
20003: ret_val = xmlDocFormatDump(f, cur, format);
20004: desret_int(ret_val);
20005: call_tests++;
20006: des_FILE_ptr(n_f, f, 0);
20007: des_xmlDocPtr(n_cur, cur, 1);
20008: des_int(n_format, format, 2);
20009: xmlResetLastError();
20010: if (mem_base != xmlMemBlocks()) {
20011: printf("Leak of %d blocks found in xmlDocFormatDump",
20012: xmlMemBlocks() - mem_base);
20013: test_ret++;
20014: printf(" %d", n_f);
20015: printf(" %d", n_cur);
20016: printf(" %d", n_format);
20017: printf("\n");
20018: }
20019: }
20020: }
20021: }
20022: function_tests++;
20023: #endif
20024:
20025: return(test_ret);
20026: }
20027:
20028:
20029: static int
20030: test_xmlDocGetRootElement(void) {
20031: int test_ret = 0;
20032:
20033: int mem_base;
20034: xmlNodePtr ret_val;
20035: xmlDocPtr doc; /* the document */
20036: int n_doc;
20037:
20038: for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20039: mem_base = xmlMemBlocks();
20040: doc = gen_xmlDocPtr(n_doc, 0);
20041:
20042: ret_val = xmlDocGetRootElement(doc);
20043: desret_xmlNodePtr(ret_val);
20044: call_tests++;
20045: des_xmlDocPtr(n_doc, doc, 0);
20046: xmlResetLastError();
20047: if (mem_base != xmlMemBlocks()) {
20048: printf("Leak of %d blocks found in xmlDocGetRootElement",
20049: xmlMemBlocks() - mem_base);
20050: test_ret++;
20051: printf(" %d", n_doc);
20052: printf("\n");
20053: }
20054: }
20055: function_tests++;
20056:
20057: return(test_ret);
20058: }
20059:
20060:
20061: static int
20062: test_xmlDocSetRootElement(void) {
20063: int test_ret = 0;
20064:
20065: #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED)
20066: int mem_base;
20067: xmlNodePtr ret_val;
20068: xmlDocPtr doc; /* the document */
20069: int n_doc;
20070: xmlNodePtr root; /* the new document root element, if root is NULL no action is taken, to remove a node from a document use xmlUnlinkNode(root) instead. */
20071: int n_root;
20072:
20073: for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20074: for (n_root = 0;n_root < gen_nb_xmlNodePtr_in;n_root++) {
20075: mem_base = xmlMemBlocks();
20076: doc = gen_xmlDocPtr(n_doc, 0);
20077: root = gen_xmlNodePtr_in(n_root, 1);
20078:
20079: ret_val = xmlDocSetRootElement(doc, root);
20080: if (doc == NULL) { xmlFreeNode(root) ; root = NULL ; }
20081: desret_xmlNodePtr(ret_val);
20082: call_tests++;
20083: des_xmlDocPtr(n_doc, doc, 0);
20084: des_xmlNodePtr_in(n_root, root, 1);
20085: xmlResetLastError();
20086: if (mem_base != xmlMemBlocks()) {
20087: printf("Leak of %d blocks found in xmlDocSetRootElement",
20088: xmlMemBlocks() - mem_base);
20089: test_ret++;
20090: printf(" %d", n_doc);
20091: printf(" %d", n_root);
20092: printf("\n");
20093: }
20094: }
20095: }
20096: function_tests++;
20097: #endif
20098:
20099: return(test_ret);
20100: }
20101:
20102:
20103: static int
20104: test_xmlElemDump(void) {
20105: int test_ret = 0;
20106:
20107: #if defined(LIBXML_OUTPUT_ENABLED)
20108: int mem_base;
20109: FILE * f; /* the FILE * for the output */
20110: int n_f;
20111: xmlDocPtr doc; /* the document */
20112: int n_doc;
20113: xmlNodePtr cur; /* the current node */
20114: int n_cur;
20115:
20116: for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) {
20117: for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20118: for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
20119: mem_base = xmlMemBlocks();
20120: f = gen_FILE_ptr(n_f, 0);
20121: doc = gen_xmlDocPtr(n_doc, 1);
20122: cur = gen_xmlNodePtr(n_cur, 2);
20123:
20124: xmlElemDump(f, doc, cur);
20125: call_tests++;
20126: des_FILE_ptr(n_f, f, 0);
20127: des_xmlDocPtr(n_doc, doc, 1);
20128: des_xmlNodePtr(n_cur, cur, 2);
20129: xmlResetLastError();
20130: if (mem_base != xmlMemBlocks()) {
20131: printf("Leak of %d blocks found in xmlElemDump",
20132: xmlMemBlocks() - mem_base);
20133: test_ret++;
20134: printf(" %d", n_f);
20135: printf(" %d", n_doc);
20136: printf(" %d", n_cur);
20137: printf("\n");
20138: }
20139: }
20140: }
20141: }
20142: function_tests++;
20143: #endif
20144:
20145: return(test_ret);
20146: }
20147:
20148:
20149: static int
20150: test_xmlFirstElementChild(void) {
20151: int test_ret = 0;
20152:
20153: #if defined(LIBXML_TREE_ENABLED)
20154: int mem_base;
20155: xmlNodePtr ret_val;
20156: xmlNodePtr parent; /* the parent node */
20157: int n_parent;
20158:
20159: for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
20160: mem_base = xmlMemBlocks();
20161: parent = gen_xmlNodePtr(n_parent, 0);
20162:
20163: ret_val = xmlFirstElementChild(parent);
20164: desret_xmlNodePtr(ret_val);
20165: call_tests++;
20166: des_xmlNodePtr(n_parent, parent, 0);
20167: xmlResetLastError();
20168: if (mem_base != xmlMemBlocks()) {
20169: printf("Leak of %d blocks found in xmlFirstElementChild",
20170: xmlMemBlocks() - mem_base);
20171: test_ret++;
20172: printf(" %d", n_parent);
20173: printf("\n");
20174: }
20175: }
20176: function_tests++;
20177: #endif
20178:
20179: return(test_ret);
20180: }
20181:
20182:
20183: static int
20184: test_xmlGetBufferAllocationScheme(void) {
20185: int test_ret = 0;
20186:
20187: int mem_base;
20188: xmlBufferAllocationScheme ret_val;
20189:
20190: mem_base = xmlMemBlocks();
20191:
20192: ret_val = xmlGetBufferAllocationScheme();
20193: desret_xmlBufferAllocationScheme(ret_val);
20194: call_tests++;
20195: xmlResetLastError();
20196: if (mem_base != xmlMemBlocks()) {
20197: printf("Leak of %d blocks found in xmlGetBufferAllocationScheme",
20198: xmlMemBlocks() - mem_base);
20199: test_ret++;
20200: printf("\n");
20201: }
20202: function_tests++;
20203:
20204: return(test_ret);
20205: }
20206:
20207:
20208: static int
20209: test_xmlGetCompressMode(void) {
20210: int test_ret = 0;
20211:
20212: int mem_base;
20213: int ret_val;
20214:
20215: mem_base = xmlMemBlocks();
20216:
20217: ret_val = xmlGetCompressMode();
20218: desret_int(ret_val);
20219: call_tests++;
20220: xmlResetLastError();
20221: if (mem_base != xmlMemBlocks()) {
20222: printf("Leak of %d blocks found in xmlGetCompressMode",
20223: xmlMemBlocks() - mem_base);
20224: test_ret++;
20225: printf("\n");
20226: }
20227: function_tests++;
20228:
20229: return(test_ret);
20230: }
20231:
20232:
20233: static int
20234: test_xmlGetDocCompressMode(void) {
20235: int test_ret = 0;
20236:
20237: int mem_base;
20238: int ret_val;
20239: xmlDocPtr doc; /* the document */
20240: int n_doc;
20241:
20242: for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20243: mem_base = xmlMemBlocks();
20244: doc = gen_xmlDocPtr(n_doc, 0);
20245:
20246: ret_val = xmlGetDocCompressMode(doc);
20247: desret_int(ret_val);
20248: call_tests++;
20249: des_xmlDocPtr(n_doc, doc, 0);
20250: xmlResetLastError();
20251: if (mem_base != xmlMemBlocks()) {
20252: printf("Leak of %d blocks found in xmlGetDocCompressMode",
20253: xmlMemBlocks() - mem_base);
20254: test_ret++;
20255: printf(" %d", n_doc);
20256: printf("\n");
20257: }
20258: }
20259: function_tests++;
20260:
20261: return(test_ret);
20262: }
20263:
20264:
20265: static int
20266: test_xmlGetIntSubset(void) {
20267: int test_ret = 0;
20268:
20269: int mem_base;
20270: xmlDtdPtr ret_val;
20271: xmlDocPtr doc; /* the document pointer */
20272: int n_doc;
20273:
20274: for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20275: mem_base = xmlMemBlocks();
20276: doc = gen_xmlDocPtr(n_doc, 0);
20277:
20278: ret_val = xmlGetIntSubset(doc);
20279: desret_xmlDtdPtr(ret_val);
20280: call_tests++;
20281: des_xmlDocPtr(n_doc, doc, 0);
20282: xmlResetLastError();
20283: if (mem_base != xmlMemBlocks()) {
20284: printf("Leak of %d blocks found in xmlGetIntSubset",
20285: xmlMemBlocks() - mem_base);
20286: test_ret++;
20287: printf(" %d", n_doc);
20288: printf("\n");
20289: }
20290: }
20291: function_tests++;
20292:
20293: return(test_ret);
20294: }
20295:
20296:
20297: static int
20298: test_xmlGetLastChild(void) {
20299: int test_ret = 0;
20300:
20301: int mem_base;
20302: xmlNodePtr ret_val;
20303: xmlNodePtr parent; /* the parent node */
20304: int n_parent;
20305:
20306: for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
20307: mem_base = xmlMemBlocks();
20308: parent = gen_xmlNodePtr(n_parent, 0);
20309:
20310: ret_val = xmlGetLastChild(parent);
20311: desret_xmlNodePtr(ret_val);
20312: call_tests++;
20313: des_xmlNodePtr(n_parent, parent, 0);
20314: xmlResetLastError();
20315: if (mem_base != xmlMemBlocks()) {
20316: printf("Leak of %d blocks found in xmlGetLastChild",
20317: xmlMemBlocks() - mem_base);
20318: test_ret++;
20319: printf(" %d", n_parent);
20320: printf("\n");
20321: }
20322: }
20323: function_tests++;
20324:
20325: return(test_ret);
20326: }
20327:
20328:
20329: static int
20330: test_xmlGetLineNo(void) {
20331: int test_ret = 0;
20332:
20333: int mem_base;
20334: long ret_val;
20335: xmlNodePtr node; /* valid node */
20336: int n_node;
20337:
20338: for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20339: mem_base = xmlMemBlocks();
20340: node = gen_xmlNodePtr(n_node, 0);
20341:
20342: ret_val = xmlGetLineNo(node);
20343: desret_long(ret_val);
20344: call_tests++;
20345: des_xmlNodePtr(n_node, node, 0);
20346: xmlResetLastError();
20347: if (mem_base != xmlMemBlocks()) {
20348: printf("Leak of %d blocks found in xmlGetLineNo",
20349: xmlMemBlocks() - mem_base);
20350: test_ret++;
20351: printf(" %d", n_node);
20352: printf("\n");
20353: }
20354: }
20355: function_tests++;
20356:
20357: return(test_ret);
20358: }
20359:
20360:
20361: static int
20362: test_xmlGetNoNsProp(void) {
20363: int test_ret = 0;
20364:
20365: int mem_base;
20366: xmlChar * ret_val;
20367: xmlNodePtr node; /* the node */
20368: int n_node;
20369: xmlChar * name; /* the attribute name */
20370: int n_name;
20371:
20372: for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20373: for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20374: mem_base = xmlMemBlocks();
20375: node = gen_xmlNodePtr(n_node, 0);
20376: name = gen_const_xmlChar_ptr(n_name, 1);
20377:
20378: ret_val = xmlGetNoNsProp(node, (const xmlChar *)name);
20379: desret_xmlChar_ptr(ret_val);
20380: call_tests++;
20381: des_xmlNodePtr(n_node, node, 0);
20382: des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20383: xmlResetLastError();
20384: if (mem_base != xmlMemBlocks()) {
20385: printf("Leak of %d blocks found in xmlGetNoNsProp",
20386: xmlMemBlocks() - mem_base);
20387: test_ret++;
20388: printf(" %d", n_node);
20389: printf(" %d", n_name);
20390: printf("\n");
20391: }
20392: }
20393: }
20394: function_tests++;
20395:
20396: return(test_ret);
20397: }
20398:
20399:
20400: static int
20401: test_xmlGetNodePath(void) {
20402: int test_ret = 0;
20403:
20404: #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_DEBUG_ENABLED)
20405: int mem_base;
20406: xmlChar * ret_val;
20407: xmlNodePtr node; /* a node */
20408: int n_node;
20409:
20410: for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20411: mem_base = xmlMemBlocks();
20412: node = gen_xmlNodePtr(n_node, 0);
20413:
20414: ret_val = xmlGetNodePath(node);
20415: desret_xmlChar_ptr(ret_val);
20416: call_tests++;
20417: des_xmlNodePtr(n_node, node, 0);
20418: xmlResetLastError();
20419: if (mem_base != xmlMemBlocks()) {
20420: printf("Leak of %d blocks found in xmlGetNodePath",
20421: xmlMemBlocks() - mem_base);
20422: test_ret++;
20423: printf(" %d", n_node);
20424: printf("\n");
20425: }
20426: }
20427: function_tests++;
20428: #endif
20429:
20430: return(test_ret);
20431: }
20432:
20433:
20434: static int
20435: test_xmlGetNsList(void) {
20436: int test_ret = 0;
20437:
20438:
20439: /* missing type support */
20440: return(test_ret);
20441: }
20442:
20443:
20444: static int
20445: test_xmlGetNsProp(void) {
20446: int test_ret = 0;
20447:
20448: int mem_base;
20449: xmlChar * ret_val;
20450: xmlNodePtr node; /* the node */
20451: int n_node;
20452: xmlChar * name; /* the attribute name */
20453: int n_name;
20454: xmlChar * nameSpace; /* the URI of the namespace */
20455: int n_nameSpace;
20456:
20457: for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20458: for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20459: for (n_nameSpace = 0;n_nameSpace < gen_nb_const_xmlChar_ptr;n_nameSpace++) {
20460: mem_base = xmlMemBlocks();
20461: node = gen_xmlNodePtr(n_node, 0);
20462: name = gen_const_xmlChar_ptr(n_name, 1);
20463: nameSpace = gen_const_xmlChar_ptr(n_nameSpace, 2);
20464:
20465: ret_val = xmlGetNsProp(node, (const xmlChar *)name, (const xmlChar *)nameSpace);
20466: desret_xmlChar_ptr(ret_val);
20467: call_tests++;
20468: des_xmlNodePtr(n_node, node, 0);
20469: des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20470: des_const_xmlChar_ptr(n_nameSpace, (const xmlChar *)nameSpace, 2);
20471: xmlResetLastError();
20472: if (mem_base != xmlMemBlocks()) {
20473: printf("Leak of %d blocks found in xmlGetNsProp",
20474: xmlMemBlocks() - mem_base);
20475: test_ret++;
20476: printf(" %d", n_node);
20477: printf(" %d", n_name);
20478: printf(" %d", n_nameSpace);
20479: printf("\n");
20480: }
20481: }
20482: }
20483: }
20484: function_tests++;
20485:
20486: return(test_ret);
20487: }
20488:
20489:
20490: static int
20491: test_xmlGetProp(void) {
20492: int test_ret = 0;
20493:
20494: int mem_base;
20495: xmlChar * ret_val;
20496: xmlNodePtr node; /* the node */
20497: int n_node;
20498: xmlChar * name; /* the attribute name */
20499: int n_name;
20500:
20501: for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20502: for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20503: mem_base = xmlMemBlocks();
20504: node = gen_xmlNodePtr(n_node, 0);
20505: name = gen_const_xmlChar_ptr(n_name, 1);
20506:
20507: ret_val = xmlGetProp(node, (const xmlChar *)name);
20508: desret_xmlChar_ptr(ret_val);
20509: call_tests++;
20510: des_xmlNodePtr(n_node, node, 0);
20511: des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20512: xmlResetLastError();
20513: if (mem_base != xmlMemBlocks()) {
20514: printf("Leak of %d blocks found in xmlGetProp",
20515: xmlMemBlocks() - mem_base);
20516: test_ret++;
20517: printf(" %d", n_node);
20518: printf(" %d", n_name);
20519: printf("\n");
20520: }
20521: }
20522: }
20523: function_tests++;
20524:
20525: return(test_ret);
20526: }
20527:
20528:
20529: static int
20530: test_xmlHasNsProp(void) {
20531: int test_ret = 0;
20532:
20533: int mem_base;
20534: xmlAttrPtr ret_val;
20535: xmlNodePtr node; /* the node */
20536: int n_node;
20537: xmlChar * name; /* the attribute name */
20538: int n_name;
20539: xmlChar * nameSpace; /* the URI of the namespace */
20540: int n_nameSpace;
20541:
20542: for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20543: for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20544: for (n_nameSpace = 0;n_nameSpace < gen_nb_const_xmlChar_ptr;n_nameSpace++) {
20545: mem_base = xmlMemBlocks();
20546: node = gen_xmlNodePtr(n_node, 0);
20547: name = gen_const_xmlChar_ptr(n_name, 1);
20548: nameSpace = gen_const_xmlChar_ptr(n_nameSpace, 2);
20549:
20550: ret_val = xmlHasNsProp(node, (const xmlChar *)name, (const xmlChar *)nameSpace);
20551: desret_xmlAttrPtr(ret_val);
20552: call_tests++;
20553: des_xmlNodePtr(n_node, node, 0);
20554: des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20555: des_const_xmlChar_ptr(n_nameSpace, (const xmlChar *)nameSpace, 2);
20556: xmlResetLastError();
20557: if (mem_base != xmlMemBlocks()) {
20558: printf("Leak of %d blocks found in xmlHasNsProp",
20559: xmlMemBlocks() - mem_base);
20560: test_ret++;
20561: printf(" %d", n_node);
20562: printf(" %d", n_name);
20563: printf(" %d", n_nameSpace);
20564: printf("\n");
20565: }
20566: }
20567: }
20568: }
20569: function_tests++;
20570:
20571: return(test_ret);
20572: }
20573:
20574:
20575: static int
20576: test_xmlHasProp(void) {
20577: int test_ret = 0;
20578:
20579: int mem_base;
20580: xmlAttrPtr ret_val;
20581: xmlNodePtr node; /* the node */
20582: int n_node;
20583: xmlChar * name; /* the attribute name */
20584: int n_name;
20585:
20586: for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20587: for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20588: mem_base = xmlMemBlocks();
20589: node = gen_xmlNodePtr(n_node, 0);
20590: name = gen_const_xmlChar_ptr(n_name, 1);
20591:
20592: ret_val = xmlHasProp(node, (const xmlChar *)name);
20593: desret_xmlAttrPtr(ret_val);
20594: call_tests++;
20595: des_xmlNodePtr(n_node, node, 0);
20596: des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20597: xmlResetLastError();
20598: if (mem_base != xmlMemBlocks()) {
20599: printf("Leak of %d blocks found in xmlHasProp",
20600: xmlMemBlocks() - mem_base);
20601: test_ret++;
20602: printf(" %d", n_node);
20603: printf(" %d", n_name);
20604: printf("\n");
20605: }
20606: }
20607: }
20608: function_tests++;
20609:
20610: return(test_ret);
20611: }
20612:
20613:
20614: static int
20615: test_xmlIsBlankNode(void) {
20616: int test_ret = 0;
20617:
20618: int mem_base;
20619: int ret_val;
20620: xmlNodePtr node; /* the node */
20621: int n_node;
20622:
20623: for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20624: mem_base = xmlMemBlocks();
20625: node = gen_xmlNodePtr(n_node, 0);
20626:
20627: ret_val = xmlIsBlankNode(node);
20628: desret_int(ret_val);
20629: call_tests++;
20630: des_xmlNodePtr(n_node, node, 0);
20631: xmlResetLastError();
20632: if (mem_base != xmlMemBlocks()) {
20633: printf("Leak of %d blocks found in xmlIsBlankNode",
20634: xmlMemBlocks() - mem_base);
20635: test_ret++;
20636: printf(" %d", n_node);
20637: printf("\n");
20638: }
20639: }
20640: function_tests++;
20641:
20642: return(test_ret);
20643: }
20644:
20645:
20646: static int
20647: test_xmlIsXHTML(void) {
20648: int test_ret = 0;
20649:
20650: int mem_base;
20651: int ret_val;
20652: xmlChar * systemID; /* the system identifier */
20653: int n_systemID;
20654: xmlChar * publicID; /* the public identifier */
20655: int n_publicID;
20656:
20657: for (n_systemID = 0;n_systemID < gen_nb_const_xmlChar_ptr;n_systemID++) {
20658: for (n_publicID = 0;n_publicID < gen_nb_const_xmlChar_ptr;n_publicID++) {
20659: mem_base = xmlMemBlocks();
20660: systemID = gen_const_xmlChar_ptr(n_systemID, 0);
20661: publicID = gen_const_xmlChar_ptr(n_publicID, 1);
20662:
20663: ret_val = xmlIsXHTML((const xmlChar *)systemID, (const xmlChar *)publicID);
20664: desret_int(ret_val);
20665: call_tests++;
20666: des_const_xmlChar_ptr(n_systemID, (const xmlChar *)systemID, 0);
20667: des_const_xmlChar_ptr(n_publicID, (const xmlChar *)publicID, 1);
20668: xmlResetLastError();
20669: if (mem_base != xmlMemBlocks()) {
20670: printf("Leak of %d blocks found in xmlIsXHTML",
20671: xmlMemBlocks() - mem_base);
20672: test_ret++;
20673: printf(" %d", n_systemID);
20674: printf(" %d", n_publicID);
20675: printf("\n");
20676: }
20677: }
20678: }
20679: function_tests++;
20680:
20681: return(test_ret);
20682: }
20683:
20684:
20685: static int
20686: test_xmlLastElementChild(void) {
20687: int test_ret = 0;
20688:
20689: #if defined(LIBXML_TREE_ENABLED)
20690: int mem_base;
20691: xmlNodePtr ret_val;
20692: xmlNodePtr parent; /* the parent node */
20693: int n_parent;
20694:
20695: for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
20696: mem_base = xmlMemBlocks();
20697: parent = gen_xmlNodePtr(n_parent, 0);
20698:
20699: ret_val = xmlLastElementChild(parent);
20700: desret_xmlNodePtr(ret_val);
20701: call_tests++;
20702: des_xmlNodePtr(n_parent, parent, 0);
20703: xmlResetLastError();
20704: if (mem_base != xmlMemBlocks()) {
20705: printf("Leak of %d blocks found in xmlLastElementChild",
20706: xmlMemBlocks() - mem_base);
20707: test_ret++;
20708: printf(" %d", n_parent);
20709: printf("\n");
20710: }
20711: }
20712: function_tests++;
20713: #endif
20714:
20715: return(test_ret);
20716: }
20717:
20718:
20719: static int
20720: test_xmlNewCDataBlock(void) {
20721: int test_ret = 0;
20722:
20723: int mem_base;
20724: xmlNodePtr ret_val;
20725: xmlDocPtr doc; /* the document */
20726: int n_doc;
20727: xmlChar * content; /* the CDATA block content content */
20728: int n_content;
20729: int len; /* the length of the block */
20730: int n_len;
20731:
20732: for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20733: for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20734: for (n_len = 0;n_len < gen_nb_int;n_len++) {
20735: mem_base = xmlMemBlocks();
20736: doc = gen_xmlDocPtr(n_doc, 0);
20737: content = gen_const_xmlChar_ptr(n_content, 1);
20738: len = gen_int(n_len, 2);
20739:
20740: ret_val = xmlNewCDataBlock(doc, (const xmlChar *)content, len);
20741: desret_xmlNodePtr(ret_val);
20742: call_tests++;
20743: des_xmlDocPtr(n_doc, doc, 0);
20744: des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
20745: des_int(n_len, len, 2);
20746: xmlResetLastError();
20747: if (mem_base != xmlMemBlocks()) {
20748: printf("Leak of %d blocks found in xmlNewCDataBlock",
20749: xmlMemBlocks() - mem_base);
20750: test_ret++;
20751: printf(" %d", n_doc);
20752: printf(" %d", n_content);
20753: printf(" %d", n_len);
20754: printf("\n");
20755: }
20756: }
20757: }
20758: }
20759: function_tests++;
20760:
20761: return(test_ret);
20762: }
20763:
20764:
20765: static int
20766: test_xmlNewCharRef(void) {
20767: int test_ret = 0;
20768:
20769: int mem_base;
20770: xmlNodePtr ret_val;
20771: xmlDocPtr doc; /* the document */
20772: int n_doc;
20773: xmlChar * name; /* the char ref string, starting with # or "&# ... ;" */
20774: int n_name;
20775:
20776: for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20777: for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20778: mem_base = xmlMemBlocks();
20779: doc = gen_xmlDocPtr(n_doc, 0);
20780: name = gen_const_xmlChar_ptr(n_name, 1);
20781:
20782: ret_val = xmlNewCharRef(doc, (const xmlChar *)name);
20783: desret_xmlNodePtr(ret_val);
20784: call_tests++;
20785: des_xmlDocPtr(n_doc, doc, 0);
20786: des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20787: xmlResetLastError();
20788: if (mem_base != xmlMemBlocks()) {
20789: printf("Leak of %d blocks found in xmlNewCharRef",
20790: xmlMemBlocks() - mem_base);
20791: test_ret++;
20792: printf(" %d", n_doc);
20793: printf(" %d", n_name);
20794: printf("\n");
20795: }
20796: }
20797: }
20798: function_tests++;
20799:
20800: return(test_ret);
20801: }
20802:
20803:
20804: static int
20805: test_xmlNewChild(void) {
20806: int test_ret = 0;
20807:
20808: #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
20809: #ifdef LIBXML_TREE_ENABLED
20810: int mem_base;
20811: xmlNodePtr ret_val;
20812: xmlNodePtr parent; /* the parent node */
20813: int n_parent;
20814: xmlNsPtr ns; /* a namespace if any */
20815: int n_ns;
20816: xmlChar * name; /* the name of the child */
20817: int n_name;
20818: xmlChar * content; /* the XML content of the child if any. */
20819: int n_content;
20820:
20821: for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
20822: for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
20823: for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20824: for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20825: mem_base = xmlMemBlocks();
20826: parent = gen_xmlNodePtr(n_parent, 0);
20827: ns = gen_xmlNsPtr(n_ns, 1);
20828: name = gen_const_xmlChar_ptr(n_name, 2);
20829: content = gen_const_xmlChar_ptr(n_content, 3);
20830:
20831: ret_val = xmlNewChild(parent, ns, (const xmlChar *)name, (const xmlChar *)content);
20832: desret_xmlNodePtr(ret_val);
20833: call_tests++;
20834: des_xmlNodePtr(n_parent, parent, 0);
20835: des_xmlNsPtr(n_ns, ns, 1);
20836: des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
20837: des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
20838: xmlResetLastError();
20839: if (mem_base != xmlMemBlocks()) {
20840: printf("Leak of %d blocks found in xmlNewChild",
20841: xmlMemBlocks() - mem_base);
20842: test_ret++;
20843: printf(" %d", n_parent);
20844: printf(" %d", n_ns);
20845: printf(" %d", n_name);
20846: printf(" %d", n_content);
20847: printf("\n");
20848: }
20849: }
20850: }
20851: }
20852: }
20853: function_tests++;
20854: #endif
20855: #endif
20856:
20857: return(test_ret);
20858: }
20859:
20860:
20861: static int
20862: test_xmlNewComment(void) {
20863: int test_ret = 0;
20864:
20865: int mem_base;
20866: xmlNodePtr ret_val;
20867: xmlChar * content; /* the comment content */
20868: int n_content;
20869:
20870: for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20871: mem_base = xmlMemBlocks();
20872: content = gen_const_xmlChar_ptr(n_content, 0);
20873:
20874: ret_val = xmlNewComment((const xmlChar *)content);
20875: desret_xmlNodePtr(ret_val);
20876: call_tests++;
20877: des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 0);
20878: xmlResetLastError();
20879: if (mem_base != xmlMemBlocks()) {
20880: printf("Leak of %d blocks found in xmlNewComment",
20881: xmlMemBlocks() - mem_base);
20882: test_ret++;
20883: printf(" %d", n_content);
20884: printf("\n");
20885: }
20886: }
20887: function_tests++;
20888:
20889: return(test_ret);
20890: }
20891:
20892:
20893: static int
20894: test_xmlNewDoc(void) {
20895: int test_ret = 0;
20896:
20897: int mem_base;
20898: xmlDocPtr ret_val;
20899: xmlChar * version; /* xmlChar string giving the version of XML "1.0" */
20900: int n_version;
20901:
20902: for (n_version = 0;n_version < gen_nb_const_xmlChar_ptr;n_version++) {
20903: mem_base = xmlMemBlocks();
20904: version = gen_const_xmlChar_ptr(n_version, 0);
20905:
20906: ret_val = xmlNewDoc((const xmlChar *)version);
20907: desret_xmlDocPtr(ret_val);
20908: call_tests++;
20909: des_const_xmlChar_ptr(n_version, (const xmlChar *)version, 0);
20910: xmlResetLastError();
20911: if (mem_base != xmlMemBlocks()) {
20912: printf("Leak of %d blocks found in xmlNewDoc",
20913: xmlMemBlocks() - mem_base);
20914: test_ret++;
20915: printf(" %d", n_version);
20916: printf("\n");
20917: }
20918: }
20919: function_tests++;
20920:
20921: return(test_ret);
20922: }
20923:
20924:
20925: static int
20926: test_xmlNewDocComment(void) {
20927: int test_ret = 0;
20928:
20929: int mem_base;
20930: xmlNodePtr ret_val;
20931: xmlDocPtr doc; /* the document */
20932: int n_doc;
20933: xmlChar * content; /* the comment content */
20934: int n_content;
20935:
20936: for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20937: for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20938: mem_base = xmlMemBlocks();
20939: doc = gen_xmlDocPtr(n_doc, 0);
20940: content = gen_const_xmlChar_ptr(n_content, 1);
20941:
20942: ret_val = xmlNewDocComment(doc, (const xmlChar *)content);
20943: desret_xmlNodePtr(ret_val);
20944: call_tests++;
20945: des_xmlDocPtr(n_doc, doc, 0);
20946: des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
20947: xmlResetLastError();
20948: if (mem_base != xmlMemBlocks()) {
20949: printf("Leak of %d blocks found in xmlNewDocComment",
20950: xmlMemBlocks() - mem_base);
20951: test_ret++;
20952: printf(" %d", n_doc);
20953: printf(" %d", n_content);
20954: printf("\n");
20955: }
20956: }
20957: }
20958: function_tests++;
20959:
20960: return(test_ret);
20961: }
20962:
20963:
20964: static int
20965: test_xmlNewDocFragment(void) {
20966: int test_ret = 0;
20967:
20968: #if defined(LIBXML_TREE_ENABLED)
20969: int mem_base;
20970: xmlNodePtr ret_val;
20971: xmlDocPtr doc; /* the document owning the fragment */
20972: int n_doc;
20973:
20974: for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20975: mem_base = xmlMemBlocks();
20976: doc = gen_xmlDocPtr(n_doc, 0);
20977:
20978: ret_val = xmlNewDocFragment(doc);
20979: desret_xmlNodePtr(ret_val);
20980: call_tests++;
20981: des_xmlDocPtr(n_doc, doc, 0);
20982: xmlResetLastError();
20983: if (mem_base != xmlMemBlocks()) {
20984: printf("Leak of %d blocks found in xmlNewDocFragment",
20985: xmlMemBlocks() - mem_base);
20986: test_ret++;
20987: printf(" %d", n_doc);
20988: printf("\n");
20989: }
20990: }
20991: function_tests++;
20992: #endif
20993:
20994: return(test_ret);
20995: }
20996:
20997:
20998: static int
20999: test_xmlNewDocNode(void) {
21000: int test_ret = 0;
21001:
21002: int mem_base;
21003: xmlNodePtr ret_val;
21004: xmlDocPtr doc; /* the document */
21005: int n_doc;
21006: xmlNsPtr ns; /* namespace if any */
21007: int n_ns;
21008: xmlChar * name; /* the node name */
21009: int n_name;
21010: xmlChar * content; /* the XML text content if any */
21011: int n_content;
21012:
21013: for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21014: for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21015: for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21016: for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21017: mem_base = xmlMemBlocks();
21018: doc = gen_xmlDocPtr(n_doc, 0);
21019: ns = gen_xmlNsPtr(n_ns, 1);
21020: name = gen_const_xmlChar_ptr(n_name, 2);
21021: content = gen_const_xmlChar_ptr(n_content, 3);
21022:
21023: ret_val = xmlNewDocNode(doc, ns, (const xmlChar *)name, (const xmlChar *)content);
21024: desret_xmlNodePtr(ret_val);
21025: call_tests++;
21026: des_xmlDocPtr(n_doc, doc, 0);
21027: des_xmlNsPtr(n_ns, ns, 1);
21028: des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
21029: des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
21030: xmlResetLastError();
21031: if (mem_base != xmlMemBlocks()) {
21032: printf("Leak of %d blocks found in xmlNewDocNode",
21033: xmlMemBlocks() - mem_base);
21034: test_ret++;
21035: printf(" %d", n_doc);
21036: printf(" %d", n_ns);
21037: printf(" %d", n_name);
21038: printf(" %d", n_content);
21039: printf("\n");
21040: }
21041: }
21042: }
21043: }
21044: }
21045: function_tests++;
21046:
21047: return(test_ret);
21048: }
21049:
21050:
21051: static int
21052: test_xmlNewDocNodeEatName(void) {
21053: int test_ret = 0;
21054:
21055: int mem_base;
21056: xmlNodePtr ret_val;
21057: xmlDocPtr doc; /* the document */
21058: int n_doc;
21059: xmlNsPtr ns; /* namespace if any */
21060: int n_ns;
21061: xmlChar * name; /* the node name */
21062: int n_name;
21063: xmlChar * content; /* the XML text content if any */
21064: int n_content;
21065:
21066: for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21067: for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21068: for (n_name = 0;n_name < gen_nb_eaten_name;n_name++) {
21069: for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21070: mem_base = xmlMemBlocks();
21071: doc = gen_xmlDocPtr(n_doc, 0);
21072: ns = gen_xmlNsPtr(n_ns, 1);
21073: name = gen_eaten_name(n_name, 2);
21074: content = gen_const_xmlChar_ptr(n_content, 3);
21075:
21076: ret_val = xmlNewDocNodeEatName(doc, ns, name, (const xmlChar *)content);
21077: desret_xmlNodePtr(ret_val);
21078: call_tests++;
21079: des_xmlDocPtr(n_doc, doc, 0);
21080: des_xmlNsPtr(n_ns, ns, 1);
21081: des_eaten_name(n_name, name, 2);
21082: des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
21083: xmlResetLastError();
21084: if (mem_base != xmlMemBlocks()) {
21085: printf("Leak of %d blocks found in xmlNewDocNodeEatName",
21086: xmlMemBlocks() - mem_base);
21087: test_ret++;
21088: printf(" %d", n_doc);
21089: printf(" %d", n_ns);
21090: printf(" %d", n_name);
21091: printf(" %d", n_content);
21092: printf("\n");
21093: }
21094: }
21095: }
21096: }
21097: }
21098: function_tests++;
21099:
21100: return(test_ret);
21101: }
21102:
21103:
21104: static int
21105: test_xmlNewDocPI(void) {
21106: int test_ret = 0;
21107:
21108: int mem_base;
21109: xmlNodePtr ret_val;
21110: xmlDocPtr doc; /* the target document */
21111: int n_doc;
21112: xmlChar * name; /* the processing instruction name */
21113: int n_name;
21114: xmlChar * content; /* the PI content */
21115: int n_content;
21116:
21117: for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21118: for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21119: for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21120: mem_base = xmlMemBlocks();
21121: doc = gen_xmlDocPtr(n_doc, 0);
21122: name = gen_const_xmlChar_ptr(n_name, 1);
21123: content = gen_const_xmlChar_ptr(n_content, 2);
21124:
21125: ret_val = xmlNewDocPI(doc, (const xmlChar *)name, (const xmlChar *)content);
21126: desret_xmlNodePtr(ret_val);
21127: call_tests++;
21128: des_xmlDocPtr(n_doc, doc, 0);
21129: des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21130: des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
21131: xmlResetLastError();
21132: if (mem_base != xmlMemBlocks()) {
21133: printf("Leak of %d blocks found in xmlNewDocPI",
21134: xmlMemBlocks() - mem_base);
21135: test_ret++;
21136: printf(" %d", n_doc);
21137: printf(" %d", n_name);
21138: printf(" %d", n_content);
21139: printf("\n");
21140: }
21141: }
21142: }
21143: }
21144: function_tests++;
21145:
21146: return(test_ret);
21147: }
21148:
21149:
21150: static int
21151: test_xmlNewDocProp(void) {
21152: int test_ret = 0;
21153:
21154: int mem_base;
21155: xmlAttrPtr ret_val;
21156: xmlDocPtr doc; /* the document */
21157: int n_doc;
21158: xmlChar * name; /* the name of the attribute */
21159: int n_name;
21160: xmlChar * value; /* the value of the attribute */
21161: int n_value;
21162:
21163: for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21164: for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21165: for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
21166: mem_base = xmlMemBlocks();
21167: doc = gen_xmlDocPtr(n_doc, 0);
21168: name = gen_const_xmlChar_ptr(n_name, 1);
21169: value = gen_const_xmlChar_ptr(n_value, 2);
21170:
21171: ret_val = xmlNewDocProp(doc, (const xmlChar *)name, (const xmlChar *)value);
21172: desret_xmlAttrPtr(ret_val);
21173: call_tests++;
21174: des_xmlDocPtr(n_doc, doc, 0);
21175: des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21176: des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
21177: xmlResetLastError();
21178: if (mem_base != xmlMemBlocks()) {
21179: printf("Leak of %d blocks found in xmlNewDocProp",
21180: xmlMemBlocks() - mem_base);
21181: test_ret++;
21182: printf(" %d", n_doc);
21183: printf(" %d", n_name);
21184: printf(" %d", n_value);
21185: printf("\n");
21186: }
21187: }
21188: }
21189: }
21190: function_tests++;
21191:
21192: return(test_ret);
21193: }
21194:
21195:
21196: static int
21197: test_xmlNewDocRawNode(void) {
21198: int test_ret = 0;
21199:
21200: #if defined(LIBXML_TREE_ENABLED)
21201: #ifdef LIBXML_TREE_ENABLED
21202: int mem_base;
21203: xmlNodePtr ret_val;
21204: xmlDocPtr doc; /* the document */
21205: int n_doc;
21206: xmlNsPtr ns; /* namespace if any */
21207: int n_ns;
21208: xmlChar * name; /* the node name */
21209: int n_name;
21210: xmlChar * content; /* the text content if any */
21211: int n_content;
21212:
21213: for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21214: for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21215: for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21216: for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21217: mem_base = xmlMemBlocks();
21218: doc = gen_xmlDocPtr(n_doc, 0);
21219: ns = gen_xmlNsPtr(n_ns, 1);
21220: name = gen_const_xmlChar_ptr(n_name, 2);
21221: content = gen_const_xmlChar_ptr(n_content, 3);
21222:
21223: ret_val = xmlNewDocRawNode(doc, ns, (const xmlChar *)name, (const xmlChar *)content);
21224: desret_xmlNodePtr(ret_val);
21225: call_tests++;
21226: des_xmlDocPtr(n_doc, doc, 0);
21227: des_xmlNsPtr(n_ns, ns, 1);
21228: des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
21229: des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
21230: xmlResetLastError();
21231: if (mem_base != xmlMemBlocks()) {
21232: printf("Leak of %d blocks found in xmlNewDocRawNode",
21233: xmlMemBlocks() - mem_base);
21234: test_ret++;
21235: printf(" %d", n_doc);
21236: printf(" %d", n_ns);
21237: printf(" %d", n_name);
21238: printf(" %d", n_content);
21239: printf("\n");
21240: }
21241: }
21242: }
21243: }
21244: }
21245: function_tests++;
21246: #endif
21247: #endif
21248:
21249: return(test_ret);
21250: }
21251:
21252:
21253: static int
21254: test_xmlNewDocText(void) {
21255: int test_ret = 0;
21256:
21257: int mem_base;
21258: xmlNodePtr ret_val;
21259: xmlDocPtr doc; /* the document */
21260: int n_doc;
21261: xmlChar * content; /* the text content */
21262: int n_content;
21263:
21264: for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21265: for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21266: mem_base = xmlMemBlocks();
21267: doc = gen_xmlDocPtr(n_doc, 0);
21268: content = gen_const_xmlChar_ptr(n_content, 1);
21269:
21270: ret_val = xmlNewDocText(doc, (const xmlChar *)content);
21271: desret_xmlNodePtr(ret_val);
21272: call_tests++;
21273: des_xmlDocPtr(n_doc, doc, 0);
21274: des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
21275: xmlResetLastError();
21276: if (mem_base != xmlMemBlocks()) {
21277: printf("Leak of %d blocks found in xmlNewDocText",
21278: xmlMemBlocks() - mem_base);
21279: test_ret++;
21280: printf(" %d", n_doc);
21281: printf(" %d", n_content);
21282: printf("\n");
21283: }
21284: }
21285: }
21286: function_tests++;
21287:
21288: return(test_ret);
21289: }
21290:
21291:
21292: static int
21293: test_xmlNewDocTextLen(void) {
21294: int test_ret = 0;
21295:
21296: int mem_base;
21297: xmlNodePtr ret_val;
21298: xmlDocPtr doc; /* the document */
21299: int n_doc;
21300: xmlChar * content; /* the text content */
21301: int n_content;
21302: int len; /* the text len. */
21303: int n_len;
21304:
21305: for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21306: for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21307: for (n_len = 0;n_len < gen_nb_int;n_len++) {
21308: mem_base = xmlMemBlocks();
21309: doc = gen_xmlDocPtr(n_doc, 0);
21310: content = gen_const_xmlChar_ptr(n_content, 1);
21311: len = gen_int(n_len, 2);
21312:
21313: ret_val = xmlNewDocTextLen(doc, (const xmlChar *)content, len);
21314: desret_xmlNodePtr(ret_val);
21315: call_tests++;
21316: des_xmlDocPtr(n_doc, doc, 0);
21317: des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
21318: des_int(n_len, len, 2);
21319: xmlResetLastError();
21320: if (mem_base != xmlMemBlocks()) {
21321: printf("Leak of %d blocks found in xmlNewDocTextLen",
21322: xmlMemBlocks() - mem_base);
21323: test_ret++;
21324: printf(" %d", n_doc);
21325: printf(" %d", n_content);
21326: printf(" %d", n_len);
21327: printf("\n");
21328: }
21329: }
21330: }
21331: }
21332: function_tests++;
21333:
21334: return(test_ret);
21335: }
21336:
21337:
21338: static int
21339: test_xmlNewDtd(void) {
21340: int test_ret = 0;
21341:
21342: int mem_base;
21343: xmlDtdPtr ret_val;
21344: xmlDocPtr doc; /* the document pointer */
21345: int n_doc;
21346: xmlChar * name; /* the DTD name */
21347: int n_name;
21348: xmlChar * ExternalID; /* the external ID */
21349: int n_ExternalID;
21350: xmlChar * SystemID; /* the system ID */
21351: int n_SystemID;
21352:
21353: for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21354: for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21355: for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
21356: for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
21357: mem_base = xmlMemBlocks();
21358: doc = gen_xmlDocPtr(n_doc, 0);
21359: name = gen_const_xmlChar_ptr(n_name, 1);
21360: ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 2);
21361: SystemID = gen_const_xmlChar_ptr(n_SystemID, 3);
21362:
21363: ret_val = xmlNewDtd(doc, (const xmlChar *)name, (const xmlChar *)ExternalID, (const xmlChar *)SystemID);
21364: desret_xmlDtdPtr(ret_val);
21365: call_tests++;
21366: des_xmlDocPtr(n_doc, doc, 0);
21367: des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21368: des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 2);
21369: des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 3);
21370: xmlResetLastError();
21371: if (mem_base != xmlMemBlocks()) {
21372: printf("Leak of %d blocks found in xmlNewDtd",
21373: xmlMemBlocks() - mem_base);
21374: test_ret++;
21375: printf(" %d", n_doc);
21376: printf(" %d", n_name);
21377: printf(" %d", n_ExternalID);
21378: printf(" %d", n_SystemID);
21379: printf("\n");
21380: }
21381: }
21382: }
21383: }
21384: }
21385: function_tests++;
21386:
21387: return(test_ret);
21388: }
21389:
21390:
21391: static int
21392: test_xmlNewNode(void) {
21393: int test_ret = 0;
21394:
21395: int mem_base;
21396: xmlNodePtr ret_val;
21397: xmlNsPtr ns; /* namespace if any */
21398: int n_ns;
21399: xmlChar * name; /* the node name */
21400: int n_name;
21401:
21402: for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21403: for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21404: mem_base = xmlMemBlocks();
21405: ns = gen_xmlNsPtr(n_ns, 0);
21406: name = gen_const_xmlChar_ptr(n_name, 1);
21407:
21408: ret_val = xmlNewNode(ns, (const xmlChar *)name);
21409: desret_xmlNodePtr(ret_val);
21410: call_tests++;
21411: des_xmlNsPtr(n_ns, ns, 0);
21412: des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21413: xmlResetLastError();
21414: if (mem_base != xmlMemBlocks()) {
21415: printf("Leak of %d blocks found in xmlNewNode",
21416: xmlMemBlocks() - mem_base);
21417: test_ret++;
21418: printf(" %d", n_ns);
21419: printf(" %d", n_name);
21420: printf("\n");
21421: }
21422: }
21423: }
21424: function_tests++;
21425:
21426: return(test_ret);
21427: }
21428:
21429:
21430: static int
21431: test_xmlNewNodeEatName(void) {
21432: int test_ret = 0;
21433:
21434: int mem_base;
21435: xmlNodePtr ret_val;
21436: xmlNsPtr ns; /* namespace if any */
21437: int n_ns;
21438: xmlChar * name; /* the node name */
21439: int n_name;
21440:
21441: for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21442: for (n_name = 0;n_name < gen_nb_eaten_name;n_name++) {
21443: mem_base = xmlMemBlocks();
21444: ns = gen_xmlNsPtr(n_ns, 0);
21445: name = gen_eaten_name(n_name, 1);
21446:
21447: ret_val = xmlNewNodeEatName(ns, name);
21448: desret_xmlNodePtr(ret_val);
21449: call_tests++;
21450: des_xmlNsPtr(n_ns, ns, 0);
21451: des_eaten_name(n_name, name, 1);
21452: xmlResetLastError();
21453: if (mem_base != xmlMemBlocks()) {
21454: printf("Leak of %d blocks found in xmlNewNodeEatName",
21455: xmlMemBlocks() - mem_base);
21456: test_ret++;
21457: printf(" %d", n_ns);
21458: printf(" %d", n_name);
21459: printf("\n");
21460: }
21461: }
21462: }
21463: function_tests++;
21464:
21465: return(test_ret);
21466: }
21467:
21468:
21469: static int
21470: test_xmlNewNs(void) {
21471: int test_ret = 0;
21472:
21473: int mem_base;
21474: xmlNsPtr ret_val;
21475: xmlNodePtr node; /* the element carrying the namespace */
21476: int n_node;
21477: xmlChar * href; /* the URI associated */
21478: int n_href;
21479: xmlChar * prefix; /* the prefix for the namespace */
21480: int n_prefix;
21481:
21482: for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
21483: for (n_href = 0;n_href < gen_nb_const_xmlChar_ptr;n_href++) {
21484: for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
21485: mem_base = xmlMemBlocks();
21486: node = gen_xmlNodePtr(n_node, 0);
21487: href = gen_const_xmlChar_ptr(n_href, 1);
21488: prefix = gen_const_xmlChar_ptr(n_prefix, 2);
21489:
21490: ret_val = xmlNewNs(node, (const xmlChar *)href, (const xmlChar *)prefix);
21491: if ((node == NULL) && (ret_val != NULL)) xmlFreeNs(ret_val);
21492: desret_xmlNsPtr(ret_val);
21493: call_tests++;
21494: des_xmlNodePtr(n_node, node, 0);
21495: des_const_xmlChar_ptr(n_href, (const xmlChar *)href, 1);
21496: des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 2);
21497: xmlResetLastError();
21498: if (mem_base != xmlMemBlocks()) {
21499: printf("Leak of %d blocks found in xmlNewNs",
21500: xmlMemBlocks() - mem_base);
21501: test_ret++;
21502: printf(" %d", n_node);
21503: printf(" %d", n_href);
21504: printf(" %d", n_prefix);
21505: printf("\n");
21506: }
21507: }
21508: }
21509: }
21510: function_tests++;
21511:
21512: return(test_ret);
21513: }
21514:
21515:
21516: static int
21517: test_xmlNewNsProp(void) {
21518: int test_ret = 0;
21519:
21520: int mem_base;
21521: xmlAttrPtr ret_val;
21522: xmlNodePtr node; /* the holding node */
21523: int n_node;
21524: xmlNsPtr ns; /* the namespace */
21525: int n_ns;
21526: xmlChar * name; /* the name of the attribute */
21527: int n_name;
21528: xmlChar * value; /* the value of the attribute */
21529: int n_value;
21530:
21531: for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
21532: for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21533: for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21534: for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
21535: mem_base = xmlMemBlocks();
21536: node = gen_xmlNodePtr(n_node, 0);
21537: ns = gen_xmlNsPtr(n_ns, 1);
21538: name = gen_const_xmlChar_ptr(n_name, 2);
21539: value = gen_const_xmlChar_ptr(n_value, 3);
21540:
21541: ret_val = xmlNewNsProp(node, ns, (const xmlChar *)name, (const xmlChar *)value);
21542: desret_xmlAttrPtr(ret_val);
21543: call_tests++;
21544: des_xmlNodePtr(n_node, node, 0);
21545: des_xmlNsPtr(n_ns, ns, 1);
21546: des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
21547: des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
21548: xmlResetLastError();
21549: if (mem_base != xmlMemBlocks()) {
21550: printf("Leak of %d blocks found in xmlNewNsProp",
21551: xmlMemBlocks() - mem_base);
21552: test_ret++;
21553: printf(" %d", n_node);
21554: printf(" %d", n_ns);
21555: printf(" %d", n_name);
21556: printf(" %d", n_value);
21557: printf("\n");
21558: }
21559: }
21560: }
21561: }
21562: }
21563: function_tests++;
21564:
21565: return(test_ret);
21566: }
21567:
21568:
21569: static int
21570: test_xmlNewNsPropEatName(void) {
21571: int test_ret = 0;
21572:
21573: int mem_base;
21574: xmlAttrPtr ret_val;
21575: xmlNodePtr node; /* the holding node */
21576: int n_node;
21577: xmlNsPtr ns; /* the namespace */
21578: int n_ns;
21579: xmlChar * name; /* the name of the attribute */
21580: int n_name;
21581: xmlChar * value; /* the value of the attribute */
21582: int n_value;
21583:
21584: for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
21585: for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21586: for (n_name = 0;n_name < gen_nb_eaten_name;n_name++) {
21587: for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
21588: mem_base = xmlMemBlocks();
21589: node = gen_xmlNodePtr(n_node, 0);
21590: ns = gen_xmlNsPtr(n_ns, 1);
21591: name = gen_eaten_name(n_name, 2);
21592: value = gen_const_xmlChar_ptr(n_value, 3);
21593:
21594: ret_val = xmlNewNsPropEatName(node, ns, name, (const xmlChar *)value);
21595: desret_xmlAttrPtr(ret_val);
21596: call_tests++;
21597: des_xmlNodePtr(n_node, node, 0);
21598: des_xmlNsPtr(n_ns, ns, 1);
21599: des_eaten_name(n_name, name, 2);
21600: des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
21601: xmlResetLastError();
21602: if (mem_base != xmlMemBlocks()) {
21603: printf("Leak of %d blocks found in xmlNewNsPropEatName",
21604: xmlMemBlocks() - mem_base);
21605: test_ret++;
21606: printf(" %d", n_node);
21607: printf(" %d", n_ns);
21608: printf(" %d", n_name);
21609: printf(" %d", n_value);
21610: printf("\n");
21611: }
21612: }
21613: }
21614: }
21615: }
21616: function_tests++;
21617:
21618: return(test_ret);
21619: }
21620:
21621:
21622: static int
21623: test_xmlNewPI(void) {
21624: int test_ret = 0;
21625:
21626: int mem_base;
21627: xmlNodePtr ret_val;
21628: xmlChar * name; /* the processing instruction name */
21629: int n_name;
21630: xmlChar * content; /* the PI content */
21631: int n_content;
21632:
21633: for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21634: for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21635: mem_base = xmlMemBlocks();
21636: name = gen_const_xmlChar_ptr(n_name, 0);
21637: content = gen_const_xmlChar_ptr(n_content, 1);
21638:
21639: ret_val = xmlNewPI((const xmlChar *)name, (const xmlChar *)content);
21640: desret_xmlNodePtr(ret_val);
21641: call_tests++;
21642: des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
21643: des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
21644: xmlResetLastError();
21645: if (mem_base != xmlMemBlocks()) {
21646: printf("Leak of %d blocks found in xmlNewPI",
21647: xmlMemBlocks() - mem_base);
21648: test_ret++;
21649: printf(" %d", n_name);
21650: printf(" %d", n_content);
21651: printf("\n");
21652: }
21653: }
21654: }
21655: function_tests++;
21656:
21657: return(test_ret);
21658: }
21659:
21660:
21661: static int
21662: test_xmlNewProp(void) {
21663: int test_ret = 0;
21664:
21665: #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
21666: #ifdef LIBXML_TREE_ENABLED
21667: int mem_base;
21668: xmlAttrPtr ret_val;
21669: xmlNodePtr node; /* the holding node */
21670: int n_node;
21671: xmlChar * name; /* the name of the attribute */
21672: int n_name;
21673: xmlChar * value; /* the value of the attribute */
21674: int n_value;
21675:
21676: for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
21677: for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21678: for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
21679: mem_base = xmlMemBlocks();
21680: node = gen_xmlNodePtr(n_node, 0);
21681: name = gen_const_xmlChar_ptr(n_name, 1);
21682: value = gen_const_xmlChar_ptr(n_value, 2);
21683:
21684: ret_val = xmlNewProp(node, (const xmlChar *)name, (const xmlChar *)value);
21685: desret_xmlAttrPtr(ret_val);
21686: call_tests++;
21687: des_xmlNodePtr(n_node, node, 0);
21688: des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21689: des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
21690: xmlResetLastError();
21691: if (mem_base != xmlMemBlocks()) {
21692: printf("Leak of %d blocks found in xmlNewProp",
21693: xmlMemBlocks() - mem_base);
21694: test_ret++;
21695: printf(" %d", n_node);
21696: printf(" %d", n_name);
21697: printf(" %d", n_value);
21698: printf("\n");
21699: }
21700: }
21701: }
21702: }
21703: function_tests++;
21704: #endif
21705: #endif
21706:
21707: return(test_ret);
21708: }
21709:
21710:
21711: static int
21712: test_xmlNewReference(void) {
21713: int test_ret = 0;
21714:
21715: int mem_base;
21716: xmlNodePtr ret_val;
21717: xmlDocPtr doc; /* the document */
21718: int n_doc;
21719: xmlChar * name; /* the reference name, or the reference string with & and ; */
21720: int n_name;
21721:
21722: for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21723: for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21724: mem_base = xmlMemBlocks();
21725: doc = gen_xmlDocPtr(n_doc, 0);
21726: name = gen_const_xmlChar_ptr(n_name, 1);
21727:
21728: ret_val = xmlNewReference(doc, (const xmlChar *)name);
21729: desret_xmlNodePtr(ret_val);
21730: call_tests++;
21731: des_xmlDocPtr(n_doc, doc, 0);
21732: des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21733: xmlResetLastError();
21734: if (mem_base != xmlMemBlocks()) {
21735: printf("Leak of %d blocks found in xmlNewReference",
21736: xmlMemBlocks() - mem_base);
21737: test_ret++;
21738: printf(" %d", n_doc);
21739: printf(" %d", n_name);
21740: printf("\n");
21741: }
21742: }
21743: }
21744: function_tests++;
21745:
21746: return(test_ret);
21747: }
21748:
21749:
21750: static int
21751: test_xmlNewText(void) {
21752: int test_ret = 0;
21753:
21754: int mem_base;
21755: xmlNodePtr ret_val;
21756: xmlChar * content; /* the text content */
21757: int n_content;
21758:
21759: for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21760: mem_base = xmlMemBlocks();
21761: content = gen_const_xmlChar_ptr(n_content, 0);
21762:
21763: ret_val = xmlNewText((const xmlChar *)content);
21764: desret_xmlNodePtr(ret_val);
21765: call_tests++;
21766: des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 0);
21767: xmlResetLastError();
21768: if (mem_base != xmlMemBlocks()) {
21769: printf("Leak of %d blocks found in xmlNewText",
21770: xmlMemBlocks() - mem_base);
21771: test_ret++;
21772: printf(" %d", n_content);
21773: printf("\n");
21774: }
21775: }
21776: function_tests++;
21777:
21778: return(test_ret);
21779: }
21780:
21781:
21782: static int
21783: test_xmlNewTextChild(void) {
21784: int test_ret = 0;
21785:
21786: #if defined(LIBXML_TREE_ENABLED)
21787: #ifdef LIBXML_TREE_ENABLED
21788: int mem_base;
21789: xmlNodePtr ret_val;
21790: xmlNodePtr parent; /* the parent node */
21791: int n_parent;
21792: xmlNsPtr ns; /* a namespace if any */
21793: int n_ns;
21794: xmlChar * name; /* the name of the child */
21795: int n_name;
21796: xmlChar * content; /* the text content of the child if any. */
21797: int n_content;
21798:
21799: for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
21800: for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21801: for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21802: for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21803: mem_base = xmlMemBlocks();
21804: parent = gen_xmlNodePtr(n_parent, 0);
21805: ns = gen_xmlNsPtr(n_ns, 1);
21806: name = gen_const_xmlChar_ptr(n_name, 2);
21807: content = gen_const_xmlChar_ptr(n_content, 3);
21808:
21809: ret_val = xmlNewTextChild(parent, ns, (const xmlChar *)name, (const xmlChar *)content);
21810: desret_xmlNodePtr(ret_val);
21811: call_tests++;
21812: des_xmlNodePtr(n_parent, parent, 0);
21813: des_xmlNsPtr(n_ns, ns, 1);
21814: des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
21815: des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
21816: xmlResetLastError();
21817: if (mem_base != xmlMemBlocks()) {
21818: printf("Leak of %d blocks found in xmlNewTextChild",
21819: xmlMemBlocks() - mem_base);
21820: test_ret++;
21821: printf(" %d", n_parent);
21822: printf(" %d", n_ns);
21823: printf(" %d", n_name);
21824: printf(" %d", n_content);
21825: printf("\n");
21826: }
21827: }
21828: }
21829: }
21830: }
21831: function_tests++;
21832: #endif
21833: #endif
21834:
21835: return(test_ret);
21836: }
21837:
21838:
21839: static int
21840: test_xmlNewTextLen(void) {
21841: int test_ret = 0;
21842:
21843: int mem_base;
21844: xmlNodePtr ret_val;
21845: xmlChar * content; /* the text content */
21846: int n_content;
21847: int len; /* the text len. */
21848: int n_len;
21849:
21850: for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21851: for (n_len = 0;n_len < gen_nb_int;n_len++) {
21852: mem_base = xmlMemBlocks();
21853: content = gen_const_xmlChar_ptr(n_content, 0);
21854: len = gen_int(n_len, 1);
21855:
21856: ret_val = xmlNewTextLen((const xmlChar *)content, len);
21857: desret_xmlNodePtr(ret_val);
21858: call_tests++;
21859: des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 0);
21860: des_int(n_len, len, 1);
21861: xmlResetLastError();
21862: if (mem_base != xmlMemBlocks()) {
21863: printf("Leak of %d blocks found in xmlNewTextLen",
21864: xmlMemBlocks() - mem_base);
21865: test_ret++;
21866: printf(" %d", n_content);
21867: printf(" %d", n_len);
21868: printf("\n");
21869: }
21870: }
21871: }
21872: function_tests++;
21873:
21874: return(test_ret);
21875: }
21876:
21877:
21878: static int
21879: test_xmlNextElementSibling(void) {
21880: int test_ret = 0;
21881:
21882: #if defined(LIBXML_TREE_ENABLED)
21883: int mem_base;
21884: xmlNodePtr ret_val;
21885: xmlNodePtr node; /* the current node */
21886: int n_node;
21887:
21888: for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
21889: mem_base = xmlMemBlocks();
21890: node = gen_xmlNodePtr(n_node, 0);
21891:
21892: ret_val = xmlNextElementSibling(node);
21893: desret_xmlNodePtr(ret_val);
21894: call_tests++;
21895: des_xmlNodePtr(n_node, node, 0);
21896: xmlResetLastError();
21897: if (mem_base != xmlMemBlocks()) {
21898: printf("Leak of %d blocks found in xmlNextElementSibling",
21899: xmlMemBlocks() - mem_base);
21900: test_ret++;
21901: printf(" %d", n_node);
21902: printf("\n");
21903: }
21904: }
21905: function_tests++;
21906: #endif
21907:
21908: return(test_ret);
21909: }
21910:
21911:
21912: static int
21913: test_xmlNodeAddContent(void) {
21914: int test_ret = 0;
21915:
21916: int mem_base;
21917: xmlNodePtr cur; /* the node being modified */
21918: int n_cur;
21919: xmlChar * content; /* extra content */
21920: int n_content;
21921:
21922: for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
21923: for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21924: mem_base = xmlMemBlocks();
21925: cur = gen_xmlNodePtr(n_cur, 0);
21926: content = gen_const_xmlChar_ptr(n_content, 1);
21927:
21928: xmlNodeAddContent(cur, (const xmlChar *)content);
21929: call_tests++;
21930: des_xmlNodePtr(n_cur, cur, 0);
21931: des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
21932: xmlResetLastError();
21933: if (mem_base != xmlMemBlocks()) {
21934: printf("Leak of %d blocks found in xmlNodeAddContent",
21935: xmlMemBlocks() - mem_base);
21936: test_ret++;
21937: printf(" %d", n_cur);
21938: printf(" %d", n_content);
21939: printf("\n");
21940: }
21941: }
21942: }
21943: function_tests++;
21944:
21945: return(test_ret);
21946: }
21947:
21948:
21949: static int
21950: test_xmlNodeAddContentLen(void) {
21951: int test_ret = 0;
21952:
21953: int mem_base;
21954: xmlNodePtr cur; /* the node being modified */
21955: int n_cur;
21956: xmlChar * content; /* extra content */
21957: int n_content;
21958: int len; /* the size of @content */
21959: int n_len;
21960:
21961: for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
21962: for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21963: for (n_len = 0;n_len < gen_nb_int;n_len++) {
21964: mem_base = xmlMemBlocks();
21965: cur = gen_xmlNodePtr(n_cur, 0);
21966: content = gen_const_xmlChar_ptr(n_content, 1);
21967: len = gen_int(n_len, 2);
21968:
21969: xmlNodeAddContentLen(cur, (const xmlChar *)content, len);
21970: call_tests++;
21971: des_xmlNodePtr(n_cur, cur, 0);
21972: des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
21973: des_int(n_len, len, 2);
21974: xmlResetLastError();
21975: if (mem_base != xmlMemBlocks()) {
21976: printf("Leak of %d blocks found in xmlNodeAddContentLen",
21977: xmlMemBlocks() - mem_base);
21978: test_ret++;
21979: printf(" %d", n_cur);
21980: printf(" %d", n_content);
21981: printf(" %d", n_len);
21982: printf("\n");
21983: }
21984: }
21985: }
21986: }
21987: function_tests++;
21988:
21989: return(test_ret);
21990: }
21991:
21992:
21993: static int
21994: test_xmlNodeBufGetContent(void) {
21995: int test_ret = 0;
21996:
21997: int mem_base;
21998: int ret_val;
21999: xmlBufferPtr buffer; /* a buffer */
22000: int n_buffer;
22001: xmlNodePtr cur; /* the node being read */
22002: int n_cur;
22003:
22004: for (n_buffer = 0;n_buffer < gen_nb_xmlBufferPtr;n_buffer++) {
22005: for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22006: mem_base = xmlMemBlocks();
22007: buffer = gen_xmlBufferPtr(n_buffer, 0);
22008: cur = gen_xmlNodePtr(n_cur, 1);
22009:
22010: ret_val = xmlNodeBufGetContent(buffer, cur);
22011: desret_int(ret_val);
22012: call_tests++;
22013: des_xmlBufferPtr(n_buffer, buffer, 0);
22014: des_xmlNodePtr(n_cur, cur, 1);
22015: xmlResetLastError();
22016: if (mem_base != xmlMemBlocks()) {
22017: printf("Leak of %d blocks found in xmlNodeBufGetContent",
22018: xmlMemBlocks() - mem_base);
22019: test_ret++;
22020: printf(" %d", n_buffer);
22021: printf(" %d", n_cur);
22022: printf("\n");
22023: }
22024: }
22025: }
22026: function_tests++;
22027:
22028: return(test_ret);
22029: }
22030:
22031:
22032: static int
22033: test_xmlNodeDump(void) {
22034: int test_ret = 0;
22035:
22036: #if defined(LIBXML_OUTPUT_ENABLED)
22037: int mem_base;
22038: int ret_val;
22039: xmlBufferPtr buf; /* the XML buffer output */
22040: int n_buf;
22041: xmlDocPtr doc; /* the document */
22042: int n_doc;
22043: xmlNodePtr cur; /* the current node */
22044: int n_cur;
22045: int level; /* the imbrication level for indenting */
22046: int n_level;
22047: int format; /* is formatting allowed */
22048: int n_format;
22049:
22050: for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
22051: for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22052: for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22053: for (n_level = 0;n_level < gen_nb_int;n_level++) {
22054: for (n_format = 0;n_format < gen_nb_int;n_format++) {
22055: mem_base = xmlMemBlocks();
22056: buf = gen_xmlBufferPtr(n_buf, 0);
22057: doc = gen_xmlDocPtr(n_doc, 1);
22058: cur = gen_xmlNodePtr(n_cur, 2);
22059: level = gen_int(n_level, 3);
22060: format = gen_int(n_format, 4);
22061:
22062: ret_val = xmlNodeDump(buf, doc, cur, level, format);
22063: desret_int(ret_val);
22064: call_tests++;
22065: des_xmlBufferPtr(n_buf, buf, 0);
22066: des_xmlDocPtr(n_doc, doc, 1);
22067: des_xmlNodePtr(n_cur, cur, 2);
22068: des_int(n_level, level, 3);
22069: des_int(n_format, format, 4);
22070: xmlResetLastError();
22071: if (mem_base != xmlMemBlocks()) {
22072: printf("Leak of %d blocks found in xmlNodeDump",
22073: xmlMemBlocks() - mem_base);
22074: test_ret++;
22075: printf(" %d", n_buf);
22076: printf(" %d", n_doc);
22077: printf(" %d", n_cur);
22078: printf(" %d", n_level);
22079: printf(" %d", n_format);
22080: printf("\n");
22081: }
22082: }
22083: }
22084: }
22085: }
22086: }
22087: function_tests++;
22088: #endif
22089:
22090: return(test_ret);
22091: }
22092:
22093:
22094: static int
22095: test_xmlNodeDumpOutput(void) {
22096: int test_ret = 0;
22097:
22098: #if defined(LIBXML_OUTPUT_ENABLED)
22099: int mem_base;
22100: xmlOutputBufferPtr buf; /* the XML buffer output */
22101: int n_buf;
22102: xmlDocPtr doc; /* the document */
22103: int n_doc;
22104: xmlNodePtr cur; /* the current node */
22105: int n_cur;
22106: int level; /* the imbrication level for indenting */
22107: int n_level;
22108: int format; /* is formatting allowed */
22109: int n_format;
22110: char * encoding; /* an optional encoding string */
22111: int n_encoding;
22112:
22113: for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
22114: for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22115: for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22116: for (n_level = 0;n_level < gen_nb_int;n_level++) {
22117: for (n_format = 0;n_format < gen_nb_int;n_format++) {
22118: for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
22119: mem_base = xmlMemBlocks();
22120: buf = gen_xmlOutputBufferPtr(n_buf, 0);
22121: doc = gen_xmlDocPtr(n_doc, 1);
22122: cur = gen_xmlNodePtr(n_cur, 2);
22123: level = gen_int(n_level, 3);
22124: format = gen_int(n_format, 4);
22125: encoding = gen_const_char_ptr(n_encoding, 5);
22126:
22127: xmlNodeDumpOutput(buf, doc, cur, level, format, (const char *)encoding);
22128: call_tests++;
22129: des_xmlOutputBufferPtr(n_buf, buf, 0);
22130: des_xmlDocPtr(n_doc, doc, 1);
22131: des_xmlNodePtr(n_cur, cur, 2);
22132: des_int(n_level, level, 3);
22133: des_int(n_format, format, 4);
22134: des_const_char_ptr(n_encoding, (const char *)encoding, 5);
22135: xmlResetLastError();
22136: if (mem_base != xmlMemBlocks()) {
22137: printf("Leak of %d blocks found in xmlNodeDumpOutput",
22138: xmlMemBlocks() - mem_base);
22139: test_ret++;
22140: printf(" %d", n_buf);
22141: printf(" %d", n_doc);
22142: printf(" %d", n_cur);
22143: printf(" %d", n_level);
22144: printf(" %d", n_format);
22145: printf(" %d", n_encoding);
22146: printf("\n");
22147: }
22148: }
22149: }
22150: }
22151: }
22152: }
22153: }
22154: function_tests++;
22155: #endif
22156:
22157: return(test_ret);
22158: }
22159:
22160:
22161: static int
22162: test_xmlNodeGetBase(void) {
22163: int test_ret = 0;
22164:
22165: int mem_base;
22166: xmlChar * ret_val;
22167: xmlDocPtr doc; /* the document the node pertains to */
22168: int n_doc;
22169: xmlNodePtr cur; /* the node being checked */
22170: int n_cur;
22171:
22172: for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22173: for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22174: mem_base = xmlMemBlocks();
22175: doc = gen_xmlDocPtr(n_doc, 0);
22176: cur = gen_xmlNodePtr(n_cur, 1);
22177:
22178: ret_val = xmlNodeGetBase(doc, cur);
22179: desret_xmlChar_ptr(ret_val);
22180: call_tests++;
22181: des_xmlDocPtr(n_doc, doc, 0);
22182: des_xmlNodePtr(n_cur, cur, 1);
22183: xmlResetLastError();
22184: if (mem_base != xmlMemBlocks()) {
22185: printf("Leak of %d blocks found in xmlNodeGetBase",
22186: xmlMemBlocks() - mem_base);
22187: test_ret++;
22188: printf(" %d", n_doc);
22189: printf(" %d", n_cur);
22190: printf("\n");
22191: }
22192: }
22193: }
22194: function_tests++;
22195:
22196: return(test_ret);
22197: }
22198:
22199:
22200: static int
22201: test_xmlNodeGetContent(void) {
22202: int test_ret = 0;
22203:
22204: int mem_base;
22205: xmlChar * ret_val;
22206: xmlNodePtr cur; /* the node being read */
22207: int n_cur;
22208:
22209: for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22210: mem_base = xmlMemBlocks();
22211: cur = gen_xmlNodePtr(n_cur, 0);
22212:
22213: ret_val = xmlNodeGetContent(cur);
22214: desret_xmlChar_ptr(ret_val);
22215: call_tests++;
22216: des_xmlNodePtr(n_cur, cur, 0);
22217: xmlResetLastError();
22218: if (mem_base != xmlMemBlocks()) {
22219: printf("Leak of %d blocks found in xmlNodeGetContent",
22220: xmlMemBlocks() - mem_base);
22221: test_ret++;
22222: printf(" %d", n_cur);
22223: printf("\n");
22224: }
22225: }
22226: function_tests++;
22227:
22228: return(test_ret);
22229: }
22230:
22231:
22232: static int
22233: test_xmlNodeGetLang(void) {
22234: int test_ret = 0;
22235:
22236: int mem_base;
22237: xmlChar * ret_val;
22238: xmlNodePtr cur; /* the node being checked */
22239: int n_cur;
22240:
22241: for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22242: mem_base = xmlMemBlocks();
22243: cur = gen_xmlNodePtr(n_cur, 0);
22244:
22245: ret_val = xmlNodeGetLang(cur);
22246: desret_xmlChar_ptr(ret_val);
22247: call_tests++;
22248: des_xmlNodePtr(n_cur, cur, 0);
22249: xmlResetLastError();
22250: if (mem_base != xmlMemBlocks()) {
22251: printf("Leak of %d blocks found in xmlNodeGetLang",
22252: xmlMemBlocks() - mem_base);
22253: test_ret++;
22254: printf(" %d", n_cur);
22255: printf("\n");
22256: }
22257: }
22258: function_tests++;
22259:
22260: return(test_ret);
22261: }
22262:
22263:
22264: static int
22265: test_xmlNodeGetSpacePreserve(void) {
22266: int test_ret = 0;
22267:
22268: int mem_base;
22269: int ret_val;
22270: xmlNodePtr cur; /* the node being checked */
22271: int n_cur;
22272:
22273: for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22274: mem_base = xmlMemBlocks();
22275: cur = gen_xmlNodePtr(n_cur, 0);
22276:
22277: ret_val = xmlNodeGetSpacePreserve(cur);
22278: desret_int(ret_val);
22279: call_tests++;
22280: des_xmlNodePtr(n_cur, cur, 0);
22281: xmlResetLastError();
22282: if (mem_base != xmlMemBlocks()) {
22283: printf("Leak of %d blocks found in xmlNodeGetSpacePreserve",
22284: xmlMemBlocks() - mem_base);
22285: test_ret++;
22286: printf(" %d", n_cur);
22287: printf("\n");
22288: }
22289: }
22290: function_tests++;
22291:
22292: return(test_ret);
22293: }
22294:
22295:
22296: static int
22297: test_xmlNodeIsText(void) {
22298: int test_ret = 0;
22299:
22300: int mem_base;
22301: int ret_val;
22302: xmlNodePtr node; /* the node */
22303: int n_node;
22304:
22305: for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
22306: mem_base = xmlMemBlocks();
22307: node = gen_xmlNodePtr(n_node, 0);
22308:
22309: ret_val = xmlNodeIsText(node);
22310: desret_int(ret_val);
22311: call_tests++;
22312: des_xmlNodePtr(n_node, node, 0);
22313: xmlResetLastError();
22314: if (mem_base != xmlMemBlocks()) {
22315: printf("Leak of %d blocks found in xmlNodeIsText",
22316: xmlMemBlocks() - mem_base);
22317: test_ret++;
22318: printf(" %d", n_node);
22319: printf("\n");
22320: }
22321: }
22322: function_tests++;
22323:
22324: return(test_ret);
22325: }
22326:
22327:
22328: static int
22329: test_xmlNodeListGetRawString(void) {
22330: int test_ret = 0;
22331:
22332: #if defined(LIBXML_TREE_ENABLED)
22333: int mem_base;
22334: xmlChar * ret_val;
22335: xmlDocPtr doc; /* the document */
22336: int n_doc;
22337: xmlNodePtr list; /* a Node list */
22338: int n_list;
22339: int inLine; /* should we replace entity contents or show their external form */
22340: int n_inLine;
22341:
22342: for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22343: for (n_list = 0;n_list < gen_nb_xmlNodePtr;n_list++) {
22344: for (n_inLine = 0;n_inLine < gen_nb_int;n_inLine++) {
22345: mem_base = xmlMemBlocks();
22346: doc = gen_xmlDocPtr(n_doc, 0);
22347: list = gen_xmlNodePtr(n_list, 1);
22348: inLine = gen_int(n_inLine, 2);
22349:
22350: ret_val = xmlNodeListGetRawString(doc, list, inLine);
22351: desret_xmlChar_ptr(ret_val);
22352: call_tests++;
22353: des_xmlDocPtr(n_doc, doc, 0);
22354: des_xmlNodePtr(n_list, list, 1);
22355: des_int(n_inLine, inLine, 2);
22356: xmlResetLastError();
22357: if (mem_base != xmlMemBlocks()) {
22358: printf("Leak of %d blocks found in xmlNodeListGetRawString",
22359: xmlMemBlocks() - mem_base);
22360: test_ret++;
22361: printf(" %d", n_doc);
22362: printf(" %d", n_list);
22363: printf(" %d", n_inLine);
22364: printf("\n");
22365: }
22366: }
22367: }
22368: }
22369: function_tests++;
22370: #endif
22371:
22372: return(test_ret);
22373: }
22374:
22375:
22376: static int
22377: test_xmlNodeListGetString(void) {
22378: int test_ret = 0;
22379:
22380: int mem_base;
22381: xmlChar * ret_val;
22382: xmlDocPtr doc; /* the document */
22383: int n_doc;
22384: xmlNodePtr list; /* a Node list */
22385: int n_list;
22386: int inLine; /* should we replace entity contents or show their external form */
22387: int n_inLine;
22388:
22389: for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22390: for (n_list = 0;n_list < gen_nb_xmlNodePtr;n_list++) {
22391: for (n_inLine = 0;n_inLine < gen_nb_int;n_inLine++) {
22392: mem_base = xmlMemBlocks();
22393: doc = gen_xmlDocPtr(n_doc, 0);
22394: list = gen_xmlNodePtr(n_list, 1);
22395: inLine = gen_int(n_inLine, 2);
22396:
22397: ret_val = xmlNodeListGetString(doc, list, inLine);
22398: desret_xmlChar_ptr(ret_val);
22399: call_tests++;
22400: des_xmlDocPtr(n_doc, doc, 0);
22401: des_xmlNodePtr(n_list, list, 1);
22402: des_int(n_inLine, inLine, 2);
22403: xmlResetLastError();
22404: if (mem_base != xmlMemBlocks()) {
22405: printf("Leak of %d blocks found in xmlNodeListGetString",
22406: xmlMemBlocks() - mem_base);
22407: test_ret++;
22408: printf(" %d", n_doc);
22409: printf(" %d", n_list);
22410: printf(" %d", n_inLine);
22411: printf("\n");
22412: }
22413: }
22414: }
22415: }
22416: function_tests++;
22417:
22418: return(test_ret);
22419: }
22420:
22421:
22422: static int
22423: test_xmlNodeSetBase(void) {
22424: int test_ret = 0;
22425:
22426: #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED)
22427: int mem_base;
22428: xmlNodePtr cur; /* the node being changed */
22429: int n_cur;
22430: xmlChar * uri; /* the new base URI */
22431: int n_uri;
22432:
22433: for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22434: for (n_uri = 0;n_uri < gen_nb_const_xmlChar_ptr;n_uri++) {
22435: mem_base = xmlMemBlocks();
22436: cur = gen_xmlNodePtr(n_cur, 0);
22437: uri = gen_const_xmlChar_ptr(n_uri, 1);
22438:
22439: xmlNodeSetBase(cur, (const xmlChar *)uri);
22440: call_tests++;
22441: des_xmlNodePtr(n_cur, cur, 0);
22442: des_const_xmlChar_ptr(n_uri, (const xmlChar *)uri, 1);
22443: xmlResetLastError();
22444: if (mem_base != xmlMemBlocks()) {
22445: printf("Leak of %d blocks found in xmlNodeSetBase",
22446: xmlMemBlocks() - mem_base);
22447: test_ret++;
22448: printf(" %d", n_cur);
22449: printf(" %d", n_uri);
22450: printf("\n");
22451: }
22452: }
22453: }
22454: function_tests++;
22455: #endif
22456:
22457: return(test_ret);
22458: }
22459:
22460:
22461: static int
22462: test_xmlNodeSetContent(void) {
22463: int test_ret = 0;
22464:
22465: int mem_base;
22466: xmlNodePtr cur; /* the node being modified */
22467: int n_cur;
22468: xmlChar * content; /* the new value of the content */
22469: int n_content;
22470:
22471: for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22472: for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
22473: mem_base = xmlMemBlocks();
22474: cur = gen_xmlNodePtr(n_cur, 0);
22475: content = gen_const_xmlChar_ptr(n_content, 1);
22476:
22477: xmlNodeSetContent(cur, (const xmlChar *)content);
22478: call_tests++;
22479: des_xmlNodePtr(n_cur, cur, 0);
22480: des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
22481: xmlResetLastError();
22482: if (mem_base != xmlMemBlocks()) {
22483: printf("Leak of %d blocks found in xmlNodeSetContent",
22484: xmlMemBlocks() - mem_base);
22485: test_ret++;
22486: printf(" %d", n_cur);
22487: printf(" %d", n_content);
22488: printf("\n");
22489: }
22490: }
22491: }
22492: function_tests++;
22493:
22494: return(test_ret);
22495: }
22496:
22497:
22498: static int
22499: test_xmlNodeSetContentLen(void) {
22500: int test_ret = 0;
22501:
22502: #if defined(LIBXML_TREE_ENABLED)
22503: int mem_base;
22504: xmlNodePtr cur; /* the node being modified */
22505: int n_cur;
22506: xmlChar * content; /* the new value of the content */
22507: int n_content;
22508: int len; /* the size of @content */
22509: int n_len;
22510:
22511: for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22512: for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
22513: for (n_len = 0;n_len < gen_nb_int;n_len++) {
22514: mem_base = xmlMemBlocks();
22515: cur = gen_xmlNodePtr(n_cur, 0);
22516: content = gen_const_xmlChar_ptr(n_content, 1);
22517: len = gen_int(n_len, 2);
22518:
22519: xmlNodeSetContentLen(cur, (const xmlChar *)content, len);
22520: call_tests++;
22521: des_xmlNodePtr(n_cur, cur, 0);
22522: des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
22523: des_int(n_len, len, 2);
22524: xmlResetLastError();
22525: if (mem_base != xmlMemBlocks()) {
22526: printf("Leak of %d blocks found in xmlNodeSetContentLen",
22527: xmlMemBlocks() - mem_base);
22528: test_ret++;
22529: printf(" %d", n_cur);
22530: printf(" %d", n_content);
22531: printf(" %d", n_len);
22532: printf("\n");
22533: }
22534: }
22535: }
22536: }
22537: function_tests++;
22538: #endif
22539:
22540: return(test_ret);
22541: }
22542:
22543:
22544: static int
22545: test_xmlNodeSetLang(void) {
22546: int test_ret = 0;
22547:
22548: #if defined(LIBXML_TREE_ENABLED)
22549: int mem_base;
22550: xmlNodePtr cur; /* the node being changed */
22551: int n_cur;
22552: xmlChar * lang; /* the language description */
22553: int n_lang;
22554:
22555: for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22556: for (n_lang = 0;n_lang < gen_nb_const_xmlChar_ptr;n_lang++) {
22557: mem_base = xmlMemBlocks();
22558: cur = gen_xmlNodePtr(n_cur, 0);
22559: lang = gen_const_xmlChar_ptr(n_lang, 1);
22560:
22561: xmlNodeSetLang(cur, (const xmlChar *)lang);
22562: call_tests++;
22563: des_xmlNodePtr(n_cur, cur, 0);
22564: des_const_xmlChar_ptr(n_lang, (const xmlChar *)lang, 1);
22565: xmlResetLastError();
22566: if (mem_base != xmlMemBlocks()) {
22567: printf("Leak of %d blocks found in xmlNodeSetLang",
22568: xmlMemBlocks() - mem_base);
22569: test_ret++;
22570: printf(" %d", n_cur);
22571: printf(" %d", n_lang);
22572: printf("\n");
22573: }
22574: }
22575: }
22576: function_tests++;
22577: #endif
22578:
22579: return(test_ret);
22580: }
22581:
22582:
22583: static int
22584: test_xmlNodeSetName(void) {
22585: int test_ret = 0;
22586:
22587: #if defined(LIBXML_TREE_ENABLED)
22588: int mem_base;
22589: xmlNodePtr cur; /* the node being changed */
22590: int n_cur;
22591: xmlChar * name; /* the new tag name */
22592: int n_name;
22593:
22594: for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22595: for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
22596: mem_base = xmlMemBlocks();
22597: cur = gen_xmlNodePtr(n_cur, 0);
22598: name = gen_const_xmlChar_ptr(n_name, 1);
22599:
22600: xmlNodeSetName(cur, (const xmlChar *)name);
22601: call_tests++;
22602: des_xmlNodePtr(n_cur, cur, 0);
22603: des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
22604: xmlResetLastError();
22605: if (mem_base != xmlMemBlocks()) {
22606: printf("Leak of %d blocks found in xmlNodeSetName",
22607: xmlMemBlocks() - mem_base);
22608: test_ret++;
22609: printf(" %d", n_cur);
22610: printf(" %d", n_name);
22611: printf("\n");
22612: }
22613: }
22614: }
22615: function_tests++;
22616: #endif
22617:
22618: return(test_ret);
22619: }
22620:
22621:
22622: static int
22623: test_xmlNodeSetSpacePreserve(void) {
22624: int test_ret = 0;
22625:
22626: #if defined(LIBXML_TREE_ENABLED)
22627: int mem_base;
22628: xmlNodePtr cur; /* the node being changed */
22629: int n_cur;
22630: int val; /* the xml:space value ("0": default, 1: "preserve") */
22631: int n_val;
22632:
22633: for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22634: for (n_val = 0;n_val < gen_nb_int;n_val++) {
22635: mem_base = xmlMemBlocks();
22636: cur = gen_xmlNodePtr(n_cur, 0);
22637: val = gen_int(n_val, 1);
22638:
22639: xmlNodeSetSpacePreserve(cur, val);
22640: call_tests++;
22641: des_xmlNodePtr(n_cur, cur, 0);
22642: des_int(n_val, val, 1);
22643: xmlResetLastError();
22644: if (mem_base != xmlMemBlocks()) {
22645: printf("Leak of %d blocks found in xmlNodeSetSpacePreserve",
22646: xmlMemBlocks() - mem_base);
22647: test_ret++;
22648: printf(" %d", n_cur);
22649: printf(" %d", n_val);
22650: printf("\n");
22651: }
22652: }
22653: }
22654: function_tests++;
22655: #endif
22656:
22657: return(test_ret);
22658: }
22659:
22660:
22661: static int
22662: test_xmlPreviousElementSibling(void) {
22663: int test_ret = 0;
22664:
22665: #if defined(LIBXML_TREE_ENABLED)
22666: int mem_base;
22667: xmlNodePtr ret_val;
22668: xmlNodePtr node; /* the current node */
22669: int n_node;
22670:
22671: for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
22672: mem_base = xmlMemBlocks();
22673: node = gen_xmlNodePtr(n_node, 0);
22674:
22675: ret_val = xmlPreviousElementSibling(node);
22676: desret_xmlNodePtr(ret_val);
22677: call_tests++;
22678: des_xmlNodePtr(n_node, node, 0);
22679: xmlResetLastError();
22680: if (mem_base != xmlMemBlocks()) {
22681: printf("Leak of %d blocks found in xmlPreviousElementSibling",
22682: xmlMemBlocks() - mem_base);
22683: test_ret++;
22684: printf(" %d", n_node);
22685: printf("\n");
22686: }
22687: }
22688: function_tests++;
22689: #endif
22690:
22691: return(test_ret);
22692: }
22693:
22694:
22695: static int
22696: test_xmlReconciliateNs(void) {
22697: int test_ret = 0;
22698:
22699: #if defined(LIBXML_TREE_ENABLED)
22700: #ifdef LIBXML_TREE_ENABLED
22701: int mem_base;
22702: int ret_val;
22703: xmlDocPtr doc; /* the document */
22704: int n_doc;
22705: xmlNodePtr tree; /* a node defining the subtree to reconciliate */
22706: int n_tree;
22707:
22708: for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22709: for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
22710: mem_base = xmlMemBlocks();
22711: doc = gen_xmlDocPtr(n_doc, 0);
22712: tree = gen_xmlNodePtr(n_tree, 1);
22713:
22714: ret_val = xmlReconciliateNs(doc, tree);
22715: desret_int(ret_val);
22716: call_tests++;
22717: des_xmlDocPtr(n_doc, doc, 0);
22718: des_xmlNodePtr(n_tree, tree, 1);
22719: xmlResetLastError();
22720: if (mem_base != xmlMemBlocks()) {
22721: printf("Leak of %d blocks found in xmlReconciliateNs",
22722: xmlMemBlocks() - mem_base);
22723: test_ret++;
22724: printf(" %d", n_doc);
22725: printf(" %d", n_tree);
22726: printf("\n");
22727: }
22728: }
22729: }
22730: function_tests++;
22731: #endif
22732: #endif
22733:
22734: return(test_ret);
22735: }
22736:
22737:
22738: static int
22739: test_xmlRemoveProp(void) {
22740: int test_ret = 0;
22741:
22742: int mem_base;
22743: int ret_val;
22744: xmlAttrPtr cur; /* an attribute */
22745: int n_cur;
22746:
22747: for (n_cur = 0;n_cur < gen_nb_xmlAttrPtr;n_cur++) {
22748: mem_base = xmlMemBlocks();
22749: cur = gen_xmlAttrPtr(n_cur, 0);
22750:
22751: ret_val = xmlRemoveProp(cur);
22752: cur = NULL;
22753: desret_int(ret_val);
22754: call_tests++;
22755: des_xmlAttrPtr(n_cur, cur, 0);
22756: xmlResetLastError();
22757: if (mem_base != xmlMemBlocks()) {
22758: printf("Leak of %d blocks found in xmlRemoveProp",
22759: xmlMemBlocks() - mem_base);
22760: test_ret++;
22761: printf(" %d", n_cur);
22762: printf("\n");
22763: }
22764: }
22765: function_tests++;
22766:
22767: return(test_ret);
22768: }
22769:
22770:
22771: static int
22772: test_xmlReplaceNode(void) {
22773: int test_ret = 0;
22774:
22775: #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED)
22776: int mem_base;
22777: xmlNodePtr ret_val;
22778: xmlNodePtr old; /* the old node */
22779: int n_old;
22780: xmlNodePtr cur; /* the node */
22781: int n_cur;
22782:
22783: for (n_old = 0;n_old < gen_nb_xmlNodePtr;n_old++) {
22784: for (n_cur = 0;n_cur < gen_nb_xmlNodePtr_in;n_cur++) {
22785: mem_base = xmlMemBlocks();
22786: old = gen_xmlNodePtr(n_old, 0);
22787: cur = gen_xmlNodePtr_in(n_cur, 1);
22788:
22789: ret_val = xmlReplaceNode(old, cur);
22790: if (cur != NULL) {
22791: xmlUnlinkNode(cur);
22792: xmlFreeNode(cur) ; cur = NULL ; }
22793: if (old != NULL) {
22794: xmlUnlinkNode(old);
22795: xmlFreeNode(old) ; old = NULL ; }
22796: ret_val = NULL;
22797: desret_xmlNodePtr(ret_val);
22798: call_tests++;
22799: des_xmlNodePtr(n_old, old, 0);
22800: des_xmlNodePtr_in(n_cur, cur, 1);
22801: xmlResetLastError();
22802: if (mem_base != xmlMemBlocks()) {
22803: printf("Leak of %d blocks found in xmlReplaceNode",
22804: xmlMemBlocks() - mem_base);
22805: test_ret++;
22806: printf(" %d", n_old);
22807: printf(" %d", n_cur);
22808: printf("\n");
22809: }
22810: }
22811: }
22812: function_tests++;
22813: #endif
22814:
22815: return(test_ret);
22816: }
22817:
22818:
22819: static int
22820: test_xmlSaveFile(void) {
22821: int test_ret = 0;
22822:
22823: #if defined(LIBXML_OUTPUT_ENABLED)
22824: int mem_base;
22825: int ret_val;
22826: const char * filename; /* the filename (or URL) */
22827: int n_filename;
22828: xmlDocPtr cur; /* the document */
22829: int n_cur;
22830:
22831: for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
22832: for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
22833: mem_base = xmlMemBlocks();
22834: filename = gen_fileoutput(n_filename, 0);
22835: cur = gen_xmlDocPtr(n_cur, 1);
22836:
22837: ret_val = xmlSaveFile(filename, cur);
22838: desret_int(ret_val);
22839: call_tests++;
22840: des_fileoutput(n_filename, filename, 0);
22841: des_xmlDocPtr(n_cur, cur, 1);
22842: xmlResetLastError();
22843: if (mem_base != xmlMemBlocks()) {
22844: printf("Leak of %d blocks found in xmlSaveFile",
22845: xmlMemBlocks() - mem_base);
22846: test_ret++;
22847: printf(" %d", n_filename);
22848: printf(" %d", n_cur);
22849: printf("\n");
22850: }
22851: }
22852: }
22853: function_tests++;
22854: #endif
22855:
22856: return(test_ret);
22857: }
22858:
22859:
22860: static int
22861: test_xmlSaveFileEnc(void) {
22862: int test_ret = 0;
22863:
22864: #if defined(LIBXML_OUTPUT_ENABLED)
22865: int mem_base;
22866: int ret_val;
22867: const char * filename; /* the filename (or URL) */
22868: int n_filename;
22869: xmlDocPtr cur; /* the document */
22870: int n_cur;
22871: char * encoding; /* the name of an encoding (or NULL) */
22872: int n_encoding;
22873:
22874: for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
22875: for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
22876: for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
22877: mem_base = xmlMemBlocks();
22878: filename = gen_fileoutput(n_filename, 0);
22879: cur = gen_xmlDocPtr(n_cur, 1);
22880: encoding = gen_const_char_ptr(n_encoding, 2);
22881:
22882: ret_val = xmlSaveFileEnc(filename, cur, (const char *)encoding);
22883: desret_int(ret_val);
22884: call_tests++;
22885: des_fileoutput(n_filename, filename, 0);
22886: des_xmlDocPtr(n_cur, cur, 1);
22887: des_const_char_ptr(n_encoding, (const char *)encoding, 2);
22888: xmlResetLastError();
22889: if (mem_base != xmlMemBlocks()) {
22890: printf("Leak of %d blocks found in xmlSaveFileEnc",
22891: xmlMemBlocks() - mem_base);
22892: test_ret++;
22893: printf(" %d", n_filename);
22894: printf(" %d", n_cur);
22895: printf(" %d", n_encoding);
22896: printf("\n");
22897: }
22898: }
22899: }
22900: }
22901: function_tests++;
22902: #endif
22903:
22904: return(test_ret);
22905: }
22906:
22907:
22908: static int
22909: test_xmlSaveFileTo(void) {
22910: int test_ret = 0;
22911:
22912: #if defined(LIBXML_OUTPUT_ENABLED)
22913: int mem_base;
22914: int ret_val;
22915: xmlOutputBufferPtr buf; /* an output I/O buffer */
22916: int n_buf;
22917: xmlDocPtr cur; /* the document */
22918: int n_cur;
22919: char * encoding; /* the encoding if any assuming the I/O layer handles the trancoding */
22920: int n_encoding;
22921:
22922: for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
22923: for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
22924: for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
22925: mem_base = xmlMemBlocks();
22926: buf = gen_xmlOutputBufferPtr(n_buf, 0);
22927: cur = gen_xmlDocPtr(n_cur, 1);
22928: encoding = gen_const_char_ptr(n_encoding, 2);
22929:
22930: ret_val = xmlSaveFileTo(buf, cur, (const char *)encoding);
22931: buf = NULL;
22932: desret_int(ret_val);
22933: call_tests++;
22934: des_xmlOutputBufferPtr(n_buf, buf, 0);
22935: des_xmlDocPtr(n_cur, cur, 1);
22936: des_const_char_ptr(n_encoding, (const char *)encoding, 2);
22937: xmlResetLastError();
22938: if (mem_base != xmlMemBlocks()) {
22939: printf("Leak of %d blocks found in xmlSaveFileTo",
22940: xmlMemBlocks() - mem_base);
22941: test_ret++;
22942: printf(" %d", n_buf);
22943: printf(" %d", n_cur);
22944: printf(" %d", n_encoding);
22945: printf("\n");
22946: }
22947: }
22948: }
22949: }
22950: function_tests++;
22951: #endif
22952:
22953: return(test_ret);
22954: }
22955:
22956:
22957: static int
22958: test_xmlSaveFormatFile(void) {
22959: int test_ret = 0;
22960:
22961: #if defined(LIBXML_OUTPUT_ENABLED)
22962: int mem_base;
22963: int ret_val;
22964: const char * filename; /* the filename (or URL) */
22965: int n_filename;
22966: xmlDocPtr cur; /* the document */
22967: int n_cur;
22968: int format; /* should formatting spaces been added */
22969: int n_format;
22970:
22971: for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
22972: for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
22973: for (n_format = 0;n_format < gen_nb_int;n_format++) {
22974: mem_base = xmlMemBlocks();
22975: filename = gen_fileoutput(n_filename, 0);
22976: cur = gen_xmlDocPtr(n_cur, 1);
22977: format = gen_int(n_format, 2);
22978:
22979: ret_val = xmlSaveFormatFile(filename, cur, format);
22980: desret_int(ret_val);
22981: call_tests++;
22982: des_fileoutput(n_filename, filename, 0);
22983: des_xmlDocPtr(n_cur, cur, 1);
22984: des_int(n_format, format, 2);
22985: xmlResetLastError();
22986: if (mem_base != xmlMemBlocks()) {
22987: printf("Leak of %d blocks found in xmlSaveFormatFile",
22988: xmlMemBlocks() - mem_base);
22989: test_ret++;
22990: printf(" %d", n_filename);
22991: printf(" %d", n_cur);
22992: printf(" %d", n_format);
22993: printf("\n");
22994: }
22995: }
22996: }
22997: }
22998: function_tests++;
22999: #endif
23000:
23001: return(test_ret);
23002: }
23003:
23004:
23005: static int
23006: test_xmlSaveFormatFileEnc(void) {
23007: int test_ret = 0;
23008:
23009: #if defined(LIBXML_OUTPUT_ENABLED)
23010: int mem_base;
23011: int ret_val;
23012: const char * filename; /* the filename or URL to output */
23013: int n_filename;
23014: xmlDocPtr cur; /* the document being saved */
23015: int n_cur;
23016: char * encoding; /* the name of the encoding to use or NULL. */
23017: int n_encoding;
23018: int format; /* should formatting spaces be added. */
23019: int n_format;
23020:
23021: for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
23022: for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
23023: for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
23024: for (n_format = 0;n_format < gen_nb_int;n_format++) {
23025: mem_base = xmlMemBlocks();
23026: filename = gen_fileoutput(n_filename, 0);
23027: cur = gen_xmlDocPtr(n_cur, 1);
23028: encoding = gen_const_char_ptr(n_encoding, 2);
23029: format = gen_int(n_format, 3);
23030:
23031: ret_val = xmlSaveFormatFileEnc(filename, cur, (const char *)encoding, format);
23032: desret_int(ret_val);
23033: call_tests++;
23034: des_fileoutput(n_filename, filename, 0);
23035: des_xmlDocPtr(n_cur, cur, 1);
23036: des_const_char_ptr(n_encoding, (const char *)encoding, 2);
23037: des_int(n_format, format, 3);
23038: xmlResetLastError();
23039: if (mem_base != xmlMemBlocks()) {
23040: printf("Leak of %d blocks found in xmlSaveFormatFileEnc",
23041: xmlMemBlocks() - mem_base);
23042: test_ret++;
23043: printf(" %d", n_filename);
23044: printf(" %d", n_cur);
23045: printf(" %d", n_encoding);
23046: printf(" %d", n_format);
23047: printf("\n");
23048: }
23049: }
23050: }
23051: }
23052: }
23053: function_tests++;
23054: #endif
23055:
23056: return(test_ret);
23057: }
23058:
23059:
23060: static int
23061: test_xmlSaveFormatFileTo(void) {
23062: int test_ret = 0;
23063:
23064: #if defined(LIBXML_OUTPUT_ENABLED)
23065: int mem_base;
23066: int ret_val;
23067: xmlOutputBufferPtr buf; /* an output I/O buffer */
23068: int n_buf;
23069: xmlDocPtr cur; /* the document */
23070: int n_cur;
23071: char * encoding; /* the encoding if any assuming the I/O layer handles the trancoding */
23072: int n_encoding;
23073: int format; /* should formatting spaces been added */
23074: int n_format;
23075:
23076: for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
23077: for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
23078: for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
23079: for (n_format = 0;n_format < gen_nb_int;n_format++) {
23080: mem_base = xmlMemBlocks();
23081: buf = gen_xmlOutputBufferPtr(n_buf, 0);
23082: cur = gen_xmlDocPtr(n_cur, 1);
23083: encoding = gen_const_char_ptr(n_encoding, 2);
23084: format = gen_int(n_format, 3);
23085:
23086: ret_val = xmlSaveFormatFileTo(buf, cur, (const char *)encoding, format);
23087: buf = NULL;
23088: desret_int(ret_val);
23089: call_tests++;
23090: des_xmlOutputBufferPtr(n_buf, buf, 0);
23091: des_xmlDocPtr(n_cur, cur, 1);
23092: des_const_char_ptr(n_encoding, (const char *)encoding, 2);
23093: des_int(n_format, format, 3);
23094: xmlResetLastError();
23095: if (mem_base != xmlMemBlocks()) {
23096: printf("Leak of %d blocks found in xmlSaveFormatFileTo",
23097: xmlMemBlocks() - mem_base);
23098: test_ret++;
23099: printf(" %d", n_buf);
23100: printf(" %d", n_cur);
23101: printf(" %d", n_encoding);
23102: printf(" %d", n_format);
23103: printf("\n");
23104: }
23105: }
23106: }
23107: }
23108: }
23109: function_tests++;
23110: #endif
23111:
23112: return(test_ret);
23113: }
23114:
23115:
23116: static int
23117: test_xmlSearchNs(void) {
23118: int test_ret = 0;
23119:
23120: int mem_base;
23121: xmlNsPtr ret_val;
23122: xmlDocPtr doc; /* the document */
23123: int n_doc;
23124: xmlNodePtr node; /* the current node */
23125: int n_node;
23126: xmlChar * nameSpace; /* the namespace prefix */
23127: int n_nameSpace;
23128:
23129: for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
23130: for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23131: for (n_nameSpace = 0;n_nameSpace < gen_nb_const_xmlChar_ptr;n_nameSpace++) {
23132: mem_base = xmlMemBlocks();
23133: doc = gen_xmlDocPtr(n_doc, 0);
23134: node = gen_xmlNodePtr(n_node, 1);
23135: nameSpace = gen_const_xmlChar_ptr(n_nameSpace, 2);
23136:
23137: ret_val = xmlSearchNs(doc, node, (const xmlChar *)nameSpace);
23138: desret_xmlNsPtr(ret_val);
23139: call_tests++;
23140: des_xmlDocPtr(n_doc, doc, 0);
23141: des_xmlNodePtr(n_node, node, 1);
23142: des_const_xmlChar_ptr(n_nameSpace, (const xmlChar *)nameSpace, 2);
23143: xmlResetLastError();
23144: if (mem_base != xmlMemBlocks()) {
23145: printf("Leak of %d blocks found in xmlSearchNs",
23146: xmlMemBlocks() - mem_base);
23147: test_ret++;
23148: printf(" %d", n_doc);
23149: printf(" %d", n_node);
23150: printf(" %d", n_nameSpace);
23151: printf("\n");
23152: }
23153: }
23154: }
23155: }
23156: function_tests++;
23157:
23158: return(test_ret);
23159: }
23160:
23161:
23162: static int
23163: test_xmlSearchNsByHref(void) {
23164: int test_ret = 0;
23165:
23166: int mem_base;
23167: xmlNsPtr ret_val;
23168: xmlDocPtr doc; /* the document */
23169: int n_doc;
23170: xmlNodePtr node; /* the current node */
23171: int n_node;
23172: xmlChar * href; /* the namespace value */
23173: int n_href;
23174:
23175: for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
23176: for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23177: for (n_href = 0;n_href < gen_nb_const_xmlChar_ptr;n_href++) {
23178: mem_base = xmlMemBlocks();
23179: doc = gen_xmlDocPtr(n_doc, 0);
23180: node = gen_xmlNodePtr(n_node, 1);
23181: href = gen_const_xmlChar_ptr(n_href, 2);
23182:
23183: ret_val = xmlSearchNsByHref(doc, node, (const xmlChar *)href);
23184: desret_xmlNsPtr(ret_val);
23185: call_tests++;
23186: des_xmlDocPtr(n_doc, doc, 0);
23187: des_xmlNodePtr(n_node, node, 1);
23188: des_const_xmlChar_ptr(n_href, (const xmlChar *)href, 2);
23189: xmlResetLastError();
23190: if (mem_base != xmlMemBlocks()) {
23191: printf("Leak of %d blocks found in xmlSearchNsByHref",
23192: xmlMemBlocks() - mem_base);
23193: test_ret++;
23194: printf(" %d", n_doc);
23195: printf(" %d", n_node);
23196: printf(" %d", n_href);
23197: printf("\n");
23198: }
23199: }
23200: }
23201: }
23202: function_tests++;
23203:
23204: return(test_ret);
23205: }
23206:
23207:
23208: static int
23209: test_xmlSetBufferAllocationScheme(void) {
23210: int test_ret = 0;
23211:
23212: int mem_base;
23213: xmlBufferAllocationScheme scheme; /* allocation method to use */
23214: int n_scheme;
23215:
23216: for (n_scheme = 0;n_scheme < gen_nb_xmlBufferAllocationScheme;n_scheme++) {
23217: mem_base = xmlMemBlocks();
23218: scheme = gen_xmlBufferAllocationScheme(n_scheme, 0);
23219:
23220: xmlSetBufferAllocationScheme(scheme);
23221: call_tests++;
23222: des_xmlBufferAllocationScheme(n_scheme, scheme, 0);
23223: xmlResetLastError();
23224: if (mem_base != xmlMemBlocks()) {
23225: printf("Leak of %d blocks found in xmlSetBufferAllocationScheme",
23226: xmlMemBlocks() - mem_base);
23227: test_ret++;
23228: printf(" %d", n_scheme);
23229: printf("\n");
23230: }
23231: }
23232: function_tests++;
23233:
23234: return(test_ret);
23235: }
23236:
23237:
23238: static int
23239: test_xmlSetCompressMode(void) {
23240: int test_ret = 0;
23241:
23242: int mem_base;
23243: int mode; /* the compression ratio */
23244: int n_mode;
23245:
23246: for (n_mode = 0;n_mode < gen_nb_int;n_mode++) {
23247: mem_base = xmlMemBlocks();
23248: mode = gen_int(n_mode, 0);
23249:
23250: xmlSetCompressMode(mode);
23251: call_tests++;
23252: des_int(n_mode, mode, 0);
23253: xmlResetLastError();
23254: if (mem_base != xmlMemBlocks()) {
23255: printf("Leak of %d blocks found in xmlSetCompressMode",
23256: xmlMemBlocks() - mem_base);
23257: test_ret++;
23258: printf(" %d", n_mode);
23259: printf("\n");
23260: }
23261: }
23262: function_tests++;
23263:
23264: return(test_ret);
23265: }
23266:
23267:
23268: static int
23269: test_xmlSetDocCompressMode(void) {
23270: int test_ret = 0;
23271:
23272: int mem_base;
23273: xmlDocPtr doc; /* the document */
23274: int n_doc;
23275: int mode; /* the compression ratio */
23276: int n_mode;
23277:
23278: for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
23279: for (n_mode = 0;n_mode < gen_nb_int;n_mode++) {
23280: mem_base = xmlMemBlocks();
23281: doc = gen_xmlDocPtr(n_doc, 0);
23282: mode = gen_int(n_mode, 1);
23283:
23284: xmlSetDocCompressMode(doc, mode);
23285: call_tests++;
23286: des_xmlDocPtr(n_doc, doc, 0);
23287: des_int(n_mode, mode, 1);
23288: xmlResetLastError();
23289: if (mem_base != xmlMemBlocks()) {
23290: printf("Leak of %d blocks found in xmlSetDocCompressMode",
23291: xmlMemBlocks() - mem_base);
23292: test_ret++;
23293: printf(" %d", n_doc);
23294: printf(" %d", n_mode);
23295: printf("\n");
23296: }
23297: }
23298: }
23299: function_tests++;
23300:
23301: return(test_ret);
23302: }
23303:
23304:
23305: static int
23306: test_xmlSetNs(void) {
23307: int test_ret = 0;
23308:
23309: int mem_base;
23310: xmlNodePtr node; /* a node in the document */
23311: int n_node;
23312: xmlNsPtr ns; /* a namespace pointer */
23313: int n_ns;
23314:
23315: for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23316: for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
23317: mem_base = xmlMemBlocks();
23318: node = gen_xmlNodePtr(n_node, 0);
23319: ns = gen_xmlNsPtr(n_ns, 1);
23320:
23321: xmlSetNs(node, ns);
23322: call_tests++;
23323: des_xmlNodePtr(n_node, node, 0);
23324: des_xmlNsPtr(n_ns, ns, 1);
23325: xmlResetLastError();
23326: if (mem_base != xmlMemBlocks()) {
23327: printf("Leak of %d blocks found in xmlSetNs",
23328: xmlMemBlocks() - mem_base);
23329: test_ret++;
23330: printf(" %d", n_node);
23331: printf(" %d", n_ns);
23332: printf("\n");
23333: }
23334: }
23335: }
23336: function_tests++;
23337:
23338: return(test_ret);
23339: }
23340:
23341:
23342: static int
23343: test_xmlSetNsProp(void) {
23344: int test_ret = 0;
23345:
23346: #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED)
23347: int mem_base;
23348: xmlAttrPtr ret_val;
23349: xmlNodePtr node; /* the node */
23350: int n_node;
23351: xmlNsPtr ns; /* the namespace definition */
23352: int n_ns;
23353: xmlChar * name; /* the attribute name */
23354: int n_name;
23355: xmlChar * value; /* the attribute value */
23356: int n_value;
23357:
23358: for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23359: for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
23360: for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23361: for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23362: mem_base = xmlMemBlocks();
23363: node = gen_xmlNodePtr(n_node, 0);
23364: ns = gen_xmlNsPtr(n_ns, 1);
23365: name = gen_const_xmlChar_ptr(n_name, 2);
23366: value = gen_const_xmlChar_ptr(n_value, 3);
23367:
23368: ret_val = xmlSetNsProp(node, ns, (const xmlChar *)name, (const xmlChar *)value);
23369: desret_xmlAttrPtr(ret_val);
23370: call_tests++;
23371: des_xmlNodePtr(n_node, node, 0);
23372: des_xmlNsPtr(n_ns, ns, 1);
23373: des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
23374: des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
23375: xmlResetLastError();
23376: if (mem_base != xmlMemBlocks()) {
23377: printf("Leak of %d blocks found in xmlSetNsProp",
23378: xmlMemBlocks() - mem_base);
23379: test_ret++;
23380: printf(" %d", n_node);
23381: printf(" %d", n_ns);
23382: printf(" %d", n_name);
23383: printf(" %d", n_value);
23384: printf("\n");
23385: }
23386: }
23387: }
23388: }
23389: }
23390: function_tests++;
23391: #endif
23392:
23393: return(test_ret);
23394: }
23395:
23396:
23397: static int
23398: test_xmlSetProp(void) {
23399: int test_ret = 0;
23400:
23401: #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED)
23402: int mem_base;
23403: xmlAttrPtr ret_val;
23404: xmlNodePtr node; /* the node */
23405: int n_node;
23406: xmlChar * name; /* the attribute name (a QName) */
23407: int n_name;
23408: xmlChar * value; /* the attribute value */
23409: int n_value;
23410:
23411: for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23412: for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23413: for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23414: mem_base = xmlMemBlocks();
23415: node = gen_xmlNodePtr(n_node, 0);
23416: name = gen_const_xmlChar_ptr(n_name, 1);
23417: value = gen_const_xmlChar_ptr(n_value, 2);
23418:
23419: ret_val = xmlSetProp(node, (const xmlChar *)name, (const xmlChar *)value);
23420: desret_xmlAttrPtr(ret_val);
23421: call_tests++;
23422: des_xmlNodePtr(n_node, node, 0);
23423: des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
23424: des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
23425: xmlResetLastError();
23426: if (mem_base != xmlMemBlocks()) {
23427: printf("Leak of %d blocks found in xmlSetProp",
23428: xmlMemBlocks() - mem_base);
23429: test_ret++;
23430: printf(" %d", n_node);
23431: printf(" %d", n_name);
23432: printf(" %d", n_value);
23433: printf("\n");
23434: }
23435: }
23436: }
23437: }
23438: function_tests++;
23439: #endif
23440:
23441: return(test_ret);
23442: }
23443:
23444:
23445: static int
23446: test_xmlSplitQName2(void) {
23447: int test_ret = 0;
23448:
23449: int mem_base;
23450: xmlChar * ret_val;
23451: xmlChar * name; /* the full QName */
23452: int n_name;
23453: xmlChar ** prefix; /* a xmlChar ** */
23454: int n_prefix;
23455:
23456: for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23457: for (n_prefix = 0;n_prefix < gen_nb_xmlChar_ptr_ptr;n_prefix++) {
23458: mem_base = xmlMemBlocks();
23459: name = gen_const_xmlChar_ptr(n_name, 0);
23460: prefix = gen_xmlChar_ptr_ptr(n_prefix, 1);
23461:
23462: ret_val = xmlSplitQName2((const xmlChar *)name, prefix);
23463: desret_xmlChar_ptr(ret_val);
23464: call_tests++;
23465: des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
23466: des_xmlChar_ptr_ptr(n_prefix, prefix, 1);
23467: xmlResetLastError();
23468: if (mem_base != xmlMemBlocks()) {
23469: printf("Leak of %d blocks found in xmlSplitQName2",
23470: xmlMemBlocks() - mem_base);
23471: test_ret++;
23472: printf(" %d", n_name);
23473: printf(" %d", n_prefix);
23474: printf("\n");
23475: }
23476: }
23477: }
23478: function_tests++;
23479:
23480: return(test_ret);
23481: }
23482:
23483:
23484: static int
23485: test_xmlSplitQName3(void) {
23486: int test_ret = 0;
23487:
23488: int mem_base;
23489: const xmlChar * ret_val;
23490: xmlChar * name; /* the full QName */
23491: int n_name;
23492: int * len; /* an int * */
23493: int n_len;
23494:
23495: for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23496: for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
23497: mem_base = xmlMemBlocks();
23498: name = gen_const_xmlChar_ptr(n_name, 0);
23499: len = gen_int_ptr(n_len, 1);
23500:
23501: ret_val = xmlSplitQName3((const xmlChar *)name, len);
23502: desret_const_xmlChar_ptr(ret_val);
23503: call_tests++;
23504: des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
23505: des_int_ptr(n_len, len, 1);
23506: xmlResetLastError();
23507: if (mem_base != xmlMemBlocks()) {
23508: printf("Leak of %d blocks found in xmlSplitQName3",
23509: xmlMemBlocks() - mem_base);
23510: test_ret++;
23511: printf(" %d", n_name);
23512: printf(" %d", n_len);
23513: printf("\n");
23514: }
23515: }
23516: }
23517: function_tests++;
23518:
23519: return(test_ret);
23520: }
23521:
23522:
23523: static int
23524: test_xmlStringGetNodeList(void) {
23525: int test_ret = 0;
23526:
23527: int mem_base;
23528: xmlNodePtr ret_val;
23529: xmlDocPtr doc; /* the document */
23530: int n_doc;
23531: xmlChar * value; /* the value of the attribute */
23532: int n_value;
23533:
23534: for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
23535: for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23536: mem_base = xmlMemBlocks();
23537: doc = gen_xmlDocPtr(n_doc, 0);
23538: value = gen_const_xmlChar_ptr(n_value, 1);
23539:
23540: ret_val = xmlStringGetNodeList(doc, (const xmlChar *)value);
23541: desret_xmlNodePtr(ret_val);
23542: call_tests++;
23543: des_xmlDocPtr(n_doc, doc, 0);
23544: des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
23545: xmlResetLastError();
23546: if (mem_base != xmlMemBlocks()) {
23547: printf("Leak of %d blocks found in xmlStringGetNodeList",
23548: xmlMemBlocks() - mem_base);
23549: test_ret++;
23550: printf(" %d", n_doc);
23551: printf(" %d", n_value);
23552: printf("\n");
23553: }
23554: }
23555: }
23556: function_tests++;
23557:
23558: return(test_ret);
23559: }
23560:
23561:
23562: static int
23563: test_xmlStringLenGetNodeList(void) {
23564: int test_ret = 0;
23565:
23566: int mem_base;
23567: xmlNodePtr ret_val;
23568: xmlDocPtr doc; /* the document */
23569: int n_doc;
23570: xmlChar * value; /* the value of the text */
23571: int n_value;
23572: int len; /* the length of the string value */
23573: int n_len;
23574:
23575: for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
23576: for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23577: for (n_len = 0;n_len < gen_nb_int;n_len++) {
23578: mem_base = xmlMemBlocks();
23579: doc = gen_xmlDocPtr(n_doc, 0);
23580: value = gen_const_xmlChar_ptr(n_value, 1);
23581: len = gen_int(n_len, 2);
23582:
23583: ret_val = xmlStringLenGetNodeList(doc, (const xmlChar *)value, len);
23584: desret_xmlNodePtr(ret_val);
23585: call_tests++;
23586: des_xmlDocPtr(n_doc, doc, 0);
23587: des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
23588: des_int(n_len, len, 2);
23589: xmlResetLastError();
23590: if (mem_base != xmlMemBlocks()) {
23591: printf("Leak of %d blocks found in xmlStringLenGetNodeList",
23592: xmlMemBlocks() - mem_base);
23593: test_ret++;
23594: printf(" %d", n_doc);
23595: printf(" %d", n_value);
23596: printf(" %d", n_len);
23597: printf("\n");
23598: }
23599: }
23600: }
23601: }
23602: function_tests++;
23603:
23604: return(test_ret);
23605: }
23606:
23607:
23608: static int
23609: test_xmlTextConcat(void) {
23610: int test_ret = 0;
23611:
23612: int mem_base;
23613: int ret_val;
23614: xmlNodePtr node; /* the node */
23615: int n_node;
23616: xmlChar * content; /* the content */
23617: int n_content;
23618: int len; /* @content length */
23619: int n_len;
23620:
23621: for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23622: for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
23623: for (n_len = 0;n_len < gen_nb_int;n_len++) {
23624: mem_base = xmlMemBlocks();
23625: node = gen_xmlNodePtr(n_node, 0);
23626: content = gen_const_xmlChar_ptr(n_content, 1);
23627: len = gen_int(n_len, 2);
23628:
23629: ret_val = xmlTextConcat(node, (const xmlChar *)content, len);
23630: desret_int(ret_val);
23631: call_tests++;
23632: des_xmlNodePtr(n_node, node, 0);
23633: des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
23634: des_int(n_len, len, 2);
23635: xmlResetLastError();
23636: if (mem_base != xmlMemBlocks()) {
23637: printf("Leak of %d blocks found in xmlTextConcat",
23638: xmlMemBlocks() - mem_base);
23639: test_ret++;
23640: printf(" %d", n_node);
23641: printf(" %d", n_content);
23642: printf(" %d", n_len);
23643: printf("\n");
23644: }
23645: }
23646: }
23647: }
23648: function_tests++;
23649:
23650: return(test_ret);
23651: }
23652:
23653:
23654: static int
23655: test_xmlTextMerge(void) {
23656: int test_ret = 0;
23657:
23658: int mem_base;
23659: xmlNodePtr ret_val;
23660: xmlNodePtr first; /* the first text node */
23661: int n_first;
23662: xmlNodePtr second; /* the second text node being merged */
23663: int n_second;
23664:
23665: for (n_first = 0;n_first < gen_nb_xmlNodePtr_in;n_first++) {
23666: for (n_second = 0;n_second < gen_nb_xmlNodePtr_in;n_second++) {
23667: mem_base = xmlMemBlocks();
23668: first = gen_xmlNodePtr_in(n_first, 0);
23669: second = gen_xmlNodePtr_in(n_second, 1);
23670:
23671: ret_val = xmlTextMerge(first, second);
23672: if ((first != NULL) && (first->type != XML_TEXT_NODE)) {
23673: xmlUnlinkNode(second);
23674: xmlFreeNode(second) ; second = NULL ; }
23675: desret_xmlNodePtr(ret_val);
23676: call_tests++;
23677: des_xmlNodePtr_in(n_first, first, 0);
23678: des_xmlNodePtr_in(n_second, second, 1);
23679: xmlResetLastError();
23680: if (mem_base != xmlMemBlocks()) {
23681: printf("Leak of %d blocks found in xmlTextMerge",
23682: xmlMemBlocks() - mem_base);
23683: test_ret++;
23684: printf(" %d", n_first);
23685: printf(" %d", n_second);
23686: printf("\n");
23687: }
23688: }
23689: }
23690: function_tests++;
23691:
23692: return(test_ret);
23693: }
23694:
23695:
23696: static int
23697: test_xmlUnsetNsProp(void) {
23698: int test_ret = 0;
23699:
23700: #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
23701: int mem_base;
23702: int ret_val;
23703: xmlNodePtr node; /* the node */
23704: int n_node;
23705: xmlNsPtr ns; /* the namespace definition */
23706: int n_ns;
23707: xmlChar * name; /* the attribute name */
23708: int n_name;
23709:
23710: for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23711: for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
23712: for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23713: mem_base = xmlMemBlocks();
23714: node = gen_xmlNodePtr(n_node, 0);
23715: ns = gen_xmlNsPtr(n_ns, 1);
23716: name = gen_const_xmlChar_ptr(n_name, 2);
23717:
23718: ret_val = xmlUnsetNsProp(node, ns, (const xmlChar *)name);
23719: desret_int(ret_val);
23720: call_tests++;
23721: des_xmlNodePtr(n_node, node, 0);
23722: des_xmlNsPtr(n_ns, ns, 1);
23723: des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
23724: xmlResetLastError();
23725: if (mem_base != xmlMemBlocks()) {
23726: printf("Leak of %d blocks found in xmlUnsetNsProp",
23727: xmlMemBlocks() - mem_base);
23728: test_ret++;
23729: printf(" %d", n_node);
23730: printf(" %d", n_ns);
23731: printf(" %d", n_name);
23732: printf("\n");
23733: }
23734: }
23735: }
23736: }
23737: function_tests++;
23738: #endif
23739:
23740: return(test_ret);
23741: }
23742:
23743:
23744: static int
23745: test_xmlUnsetProp(void) {
23746: int test_ret = 0;
23747:
23748: #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
23749: int mem_base;
23750: int ret_val;
23751: xmlNodePtr node; /* the node */
23752: int n_node;
23753: xmlChar * name; /* the attribute name */
23754: int n_name;
23755:
23756: for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23757: for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23758: mem_base = xmlMemBlocks();
23759: node = gen_xmlNodePtr(n_node, 0);
23760: name = gen_const_xmlChar_ptr(n_name, 1);
23761:
23762: ret_val = xmlUnsetProp(node, (const xmlChar *)name);
23763: desret_int(ret_val);
23764: call_tests++;
23765: des_xmlNodePtr(n_node, node, 0);
23766: des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
23767: xmlResetLastError();
23768: if (mem_base != xmlMemBlocks()) {
23769: printf("Leak of %d blocks found in xmlUnsetProp",
23770: xmlMemBlocks() - mem_base);
23771: test_ret++;
23772: printf(" %d", n_node);
23773: printf(" %d", n_name);
23774: printf("\n");
23775: }
23776: }
23777: }
23778: function_tests++;
23779: #endif
23780:
23781: return(test_ret);
23782: }
23783:
23784:
23785: static int
23786: test_xmlValidateNCName(void) {
23787: int test_ret = 0;
23788:
23789: #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_DEBUG_ENABLED) || defined (LIBXML_HTML_ENABLED) || defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_DOCB_ENABLED)
23790: #ifdef LIBXML_TREE_ENABLED
23791: int mem_base;
23792: int ret_val;
23793: xmlChar * value; /* the value to check */
23794: int n_value;
23795: int space; /* allow spaces in front and end of the string */
23796: int n_space;
23797:
23798: for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23799: for (n_space = 0;n_space < gen_nb_int;n_space++) {
23800: mem_base = xmlMemBlocks();
23801: value = gen_const_xmlChar_ptr(n_value, 0);
23802: space = gen_int(n_space, 1);
23803:
23804: ret_val = xmlValidateNCName((const xmlChar *)value, space);
23805: desret_int(ret_val);
23806: call_tests++;
23807: des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
23808: des_int(n_space, space, 1);
23809: xmlResetLastError();
23810: if (mem_base != xmlMemBlocks()) {
23811: printf("Leak of %d blocks found in xmlValidateNCName",
23812: xmlMemBlocks() - mem_base);
23813: test_ret++;
23814: printf(" %d", n_value);
23815: printf(" %d", n_space);
23816: printf("\n");
23817: }
23818: }
23819: }
23820: function_tests++;
23821: #endif
23822: #endif
23823:
23824: return(test_ret);
23825: }
23826:
23827:
23828: static int
23829: test_xmlValidateNMToken(void) {
23830: int test_ret = 0;
23831:
23832: #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
23833: #ifdef LIBXML_TREE_ENABLED
23834: int mem_base;
23835: int ret_val;
23836: xmlChar * value; /* the value to check */
23837: int n_value;
23838: int space; /* allow spaces in front and end of the string */
23839: int n_space;
23840:
23841: for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23842: for (n_space = 0;n_space < gen_nb_int;n_space++) {
23843: mem_base = xmlMemBlocks();
23844: value = gen_const_xmlChar_ptr(n_value, 0);
23845: space = gen_int(n_space, 1);
23846:
23847: ret_val = xmlValidateNMToken((const xmlChar *)value, space);
23848: desret_int(ret_val);
23849: call_tests++;
23850: des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
23851: des_int(n_space, space, 1);
23852: xmlResetLastError();
23853: if (mem_base != xmlMemBlocks()) {
23854: printf("Leak of %d blocks found in xmlValidateNMToken",
23855: xmlMemBlocks() - mem_base);
23856: test_ret++;
23857: printf(" %d", n_value);
23858: printf(" %d", n_space);
23859: printf("\n");
23860: }
23861: }
23862: }
23863: function_tests++;
23864: #endif
23865: #endif
23866:
23867: return(test_ret);
23868: }
23869:
23870:
23871: static int
23872: test_xmlValidateName(void) {
23873: int test_ret = 0;
23874:
23875: #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
23876: #ifdef LIBXML_TREE_ENABLED
23877: int mem_base;
23878: int ret_val;
23879: xmlChar * value; /* the value to check */
23880: int n_value;
23881: int space; /* allow spaces in front and end of the string */
23882: int n_space;
23883:
23884: for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23885: for (n_space = 0;n_space < gen_nb_int;n_space++) {
23886: mem_base = xmlMemBlocks();
23887: value = gen_const_xmlChar_ptr(n_value, 0);
23888: space = gen_int(n_space, 1);
23889:
23890: ret_val = xmlValidateName((const xmlChar *)value, space);
23891: desret_int(ret_val);
23892: call_tests++;
23893: des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
23894: des_int(n_space, space, 1);
23895: xmlResetLastError();
23896: if (mem_base != xmlMemBlocks()) {
23897: printf("Leak of %d blocks found in xmlValidateName",
23898: xmlMemBlocks() - mem_base);
23899: test_ret++;
23900: printf(" %d", n_value);
23901: printf(" %d", n_space);
23902: printf("\n");
23903: }
23904: }
23905: }
23906: function_tests++;
23907: #endif
23908: #endif
23909:
23910: return(test_ret);
23911: }
23912:
23913:
23914: static int
23915: test_xmlValidateQName(void) {
23916: int test_ret = 0;
23917:
23918: #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
23919: #ifdef LIBXML_TREE_ENABLED
23920: int mem_base;
23921: int ret_val;
23922: xmlChar * value; /* the value to check */
23923: int n_value;
23924: int space; /* allow spaces in front and end of the string */
23925: int n_space;
23926:
23927: for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23928: for (n_space = 0;n_space < gen_nb_int;n_space++) {
23929: mem_base = xmlMemBlocks();
23930: value = gen_const_xmlChar_ptr(n_value, 0);
23931: space = gen_int(n_space, 1);
23932:
23933: ret_val = xmlValidateQName((const xmlChar *)value, space);
23934: desret_int(ret_val);
23935: call_tests++;
23936: des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
23937: des_int(n_space, space, 1);
23938: xmlResetLastError();
23939: if (mem_base != xmlMemBlocks()) {
23940: printf("Leak of %d blocks found in xmlValidateQName",
23941: xmlMemBlocks() - mem_base);
23942: test_ret++;
23943: printf(" %d", n_value);
23944: printf(" %d", n_space);
23945: printf("\n");
23946: }
23947: }
23948: }
23949: function_tests++;
23950: #endif
23951: #endif
23952:
23953: return(test_ret);
23954: }
23955:
23956: static int
23957: test_tree(void) {
23958: int test_ret = 0;
23959:
23960: if (quiet == 0) printf("Testing tree : 138 of 157 functions ...\n");
23961: test_ret += test_xmlAddChild();
23962: test_ret += test_xmlAddChildList();
23963: test_ret += test_xmlAddNextSibling();
23964: test_ret += test_xmlAddPrevSibling();
23965: test_ret += test_xmlAddSibling();
23966: test_ret += test_xmlAttrSerializeTxtContent();
23967: test_ret += test_xmlBufferAdd();
23968: test_ret += test_xmlBufferAddHead();
23969: test_ret += test_xmlBufferCCat();
23970: test_ret += test_xmlBufferCat();
23971: test_ret += test_xmlBufferContent();
23972: test_ret += test_xmlBufferCreate();
23973: test_ret += test_xmlBufferCreateSize();
23974: test_ret += test_xmlBufferCreateStatic();
23975: test_ret += test_xmlBufferEmpty();
23976: test_ret += test_xmlBufferGrow();
23977: test_ret += test_xmlBufferLength();
23978: test_ret += test_xmlBufferResize();
23979: test_ret += test_xmlBufferSetAllocationScheme();
23980: test_ret += test_xmlBufferShrink();
23981: test_ret += test_xmlBufferWriteCHAR();
23982: test_ret += test_xmlBufferWriteChar();
23983: test_ret += test_xmlBufferWriteQuotedString();
23984: test_ret += test_xmlBuildQName();
23985: test_ret += test_xmlChildElementCount();
23986: test_ret += test_xmlCopyDoc();
23987: test_ret += test_xmlCopyDtd();
23988: test_ret += test_xmlCopyNamespace();
23989: test_ret += test_xmlCopyNamespaceList();
23990: test_ret += test_xmlCopyNode();
23991: test_ret += test_xmlCopyNodeList();
23992: test_ret += test_xmlCopyProp();
23993: test_ret += test_xmlCopyPropList();
23994: test_ret += test_xmlCreateIntSubset();
23995: test_ret += test_xmlDOMWrapAdoptNode();
23996: test_ret += test_xmlDOMWrapCloneNode();
23997: test_ret += test_xmlDOMWrapNewCtxt();
23998: test_ret += test_xmlDOMWrapReconcileNamespaces();
23999: test_ret += test_xmlDOMWrapRemoveNode();
24000: test_ret += test_xmlDocCopyNode();
24001: test_ret += test_xmlDocCopyNodeList();
24002: test_ret += test_xmlDocDump();
24003: test_ret += test_xmlDocDumpFormatMemory();
24004: test_ret += test_xmlDocDumpFormatMemoryEnc();
24005: test_ret += test_xmlDocDumpMemory();
24006: test_ret += test_xmlDocDumpMemoryEnc();
24007: test_ret += test_xmlDocFormatDump();
24008: test_ret += test_xmlDocGetRootElement();
24009: test_ret += test_xmlDocSetRootElement();
24010: test_ret += test_xmlElemDump();
24011: test_ret += test_xmlFirstElementChild();
24012: test_ret += test_xmlGetBufferAllocationScheme();
24013: test_ret += test_xmlGetCompressMode();
24014: test_ret += test_xmlGetDocCompressMode();
24015: test_ret += test_xmlGetIntSubset();
24016: test_ret += test_xmlGetLastChild();
24017: test_ret += test_xmlGetLineNo();
24018: test_ret += test_xmlGetNoNsProp();
24019: test_ret += test_xmlGetNodePath();
24020: test_ret += test_xmlGetNsList();
24021: test_ret += test_xmlGetNsProp();
24022: test_ret += test_xmlGetProp();
24023: test_ret += test_xmlHasNsProp();
24024: test_ret += test_xmlHasProp();
24025: test_ret += test_xmlIsBlankNode();
24026: test_ret += test_xmlIsXHTML();
24027: test_ret += test_xmlLastElementChild();
24028: test_ret += test_xmlNewCDataBlock();
24029: test_ret += test_xmlNewCharRef();
24030: test_ret += test_xmlNewChild();
24031: test_ret += test_xmlNewComment();
24032: test_ret += test_xmlNewDoc();
24033: test_ret += test_xmlNewDocComment();
24034: test_ret += test_xmlNewDocFragment();
24035: test_ret += test_xmlNewDocNode();
24036: test_ret += test_xmlNewDocNodeEatName();
24037: test_ret += test_xmlNewDocPI();
24038: test_ret += test_xmlNewDocProp();
24039: test_ret += test_xmlNewDocRawNode();
24040: test_ret += test_xmlNewDocText();
24041: test_ret += test_xmlNewDocTextLen();
24042: test_ret += test_xmlNewDtd();
24043: test_ret += test_xmlNewNode();
24044: test_ret += test_xmlNewNodeEatName();
24045: test_ret += test_xmlNewNs();
24046: test_ret += test_xmlNewNsProp();
24047: test_ret += test_xmlNewNsPropEatName();
24048: test_ret += test_xmlNewPI();
24049: test_ret += test_xmlNewProp();
24050: test_ret += test_xmlNewReference();
24051: test_ret += test_xmlNewText();
24052: test_ret += test_xmlNewTextChild();
24053: test_ret += test_xmlNewTextLen();
24054: test_ret += test_xmlNextElementSibling();
24055: test_ret += test_xmlNodeAddContent();
24056: test_ret += test_xmlNodeAddContentLen();
24057: test_ret += test_xmlNodeBufGetContent();
24058: test_ret += test_xmlNodeDump();
24059: test_ret += test_xmlNodeDumpOutput();
24060: test_ret += test_xmlNodeGetBase();
24061: test_ret += test_xmlNodeGetContent();
24062: test_ret += test_xmlNodeGetLang();
24063: test_ret += test_xmlNodeGetSpacePreserve();
24064: test_ret += test_xmlNodeIsText();
24065: test_ret += test_xmlNodeListGetRawString();
24066: test_ret += test_xmlNodeListGetString();
24067: test_ret += test_xmlNodeSetBase();
24068: test_ret += test_xmlNodeSetContent();
24069: test_ret += test_xmlNodeSetContentLen();
24070: test_ret += test_xmlNodeSetLang();
24071: test_ret += test_xmlNodeSetName();
24072: test_ret += test_xmlNodeSetSpacePreserve();
24073: test_ret += test_xmlPreviousElementSibling();
24074: test_ret += test_xmlReconciliateNs();
24075: test_ret += test_xmlRemoveProp();
24076: test_ret += test_xmlReplaceNode();
24077: test_ret += test_xmlSaveFile();
24078: test_ret += test_xmlSaveFileEnc();
24079: test_ret += test_xmlSaveFileTo();
24080: test_ret += test_xmlSaveFormatFile();
24081: test_ret += test_xmlSaveFormatFileEnc();
24082: test_ret += test_xmlSaveFormatFileTo();
24083: test_ret += test_xmlSearchNs();
24084: test_ret += test_xmlSearchNsByHref();
24085: test_ret += test_xmlSetBufferAllocationScheme();
24086: test_ret += test_xmlSetCompressMode();
24087: test_ret += test_xmlSetDocCompressMode();
24088: test_ret += test_xmlSetNs();
24089: test_ret += test_xmlSetNsProp();
24090: test_ret += test_xmlSetProp();
24091: test_ret += test_xmlSplitQName2();
24092: test_ret += test_xmlSplitQName3();
24093: test_ret += test_xmlStringGetNodeList();
24094: test_ret += test_xmlStringLenGetNodeList();
24095: test_ret += test_xmlTextConcat();
24096: test_ret += test_xmlTextMerge();
24097: test_ret += test_xmlUnsetNsProp();
24098: test_ret += test_xmlUnsetProp();
24099: test_ret += test_xmlValidateNCName();
24100: test_ret += test_xmlValidateNMToken();
24101: test_ret += test_xmlValidateName();
24102: test_ret += test_xmlValidateQName();
24103:
24104: if (test_ret != 0)
24105: printf("Module tree: %d errors\n", test_ret);
24106: return(test_ret);
24107: }
24108:
24109: static int
24110: test_xmlBuildRelativeURI(void) {
24111: int test_ret = 0;
24112:
24113: int mem_base;
24114: xmlChar * ret_val;
24115: xmlChar * URI; /* the URI reference under consideration */
24116: int n_URI;
24117: xmlChar * base; /* the base value */
24118: int n_base;
24119:
24120: for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
24121: for (n_base = 0;n_base < gen_nb_const_xmlChar_ptr;n_base++) {
24122: mem_base = xmlMemBlocks();
24123: URI = gen_const_xmlChar_ptr(n_URI, 0);
24124: base = gen_const_xmlChar_ptr(n_base, 1);
24125:
24126: ret_val = xmlBuildRelativeURI((const xmlChar *)URI, (const xmlChar *)base);
24127: desret_xmlChar_ptr(ret_val);
24128: call_tests++;
24129: des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0);
24130: des_const_xmlChar_ptr(n_base, (const xmlChar *)base, 1);
24131: xmlResetLastError();
24132: if (mem_base != xmlMemBlocks()) {
24133: printf("Leak of %d blocks found in xmlBuildRelativeURI",
24134: xmlMemBlocks() - mem_base);
24135: test_ret++;
24136: printf(" %d", n_URI);
24137: printf(" %d", n_base);
24138: printf("\n");
24139: }
24140: }
24141: }
24142: function_tests++;
24143:
24144: return(test_ret);
24145: }
24146:
24147:
24148: static int
24149: test_xmlBuildURI(void) {
24150: int test_ret = 0;
24151:
24152: int mem_base;
24153: xmlChar * ret_val;
24154: xmlChar * URI; /* the URI instance found in the document */
24155: int n_URI;
24156: xmlChar * base; /* the base value */
24157: int n_base;
24158:
24159: for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
24160: for (n_base = 0;n_base < gen_nb_const_xmlChar_ptr;n_base++) {
24161: mem_base = xmlMemBlocks();
24162: URI = gen_const_xmlChar_ptr(n_URI, 0);
24163: base = gen_const_xmlChar_ptr(n_base, 1);
24164:
24165: ret_val = xmlBuildURI((const xmlChar *)URI, (const xmlChar *)base);
24166: desret_xmlChar_ptr(ret_val);
24167: call_tests++;
24168: des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0);
24169: des_const_xmlChar_ptr(n_base, (const xmlChar *)base, 1);
24170: xmlResetLastError();
24171: if (mem_base != xmlMemBlocks()) {
24172: printf("Leak of %d blocks found in xmlBuildURI",
24173: xmlMemBlocks() - mem_base);
24174: test_ret++;
24175: printf(" %d", n_URI);
24176: printf(" %d", n_base);
24177: printf("\n");
24178: }
24179: }
24180: }
24181: function_tests++;
24182:
24183: return(test_ret);
24184: }
24185:
24186:
24187: static int
24188: test_xmlCanonicPath(void) {
24189: int test_ret = 0;
24190:
24191: int mem_base;
24192: xmlChar * ret_val;
24193: xmlChar * path; /* the resource locator in a filesystem notation */
24194: int n_path;
24195:
24196: for (n_path = 0;n_path < gen_nb_const_xmlChar_ptr;n_path++) {
24197: mem_base = xmlMemBlocks();
24198: path = gen_const_xmlChar_ptr(n_path, 0);
24199:
24200: ret_val = xmlCanonicPath((const xmlChar *)path);
24201: desret_xmlChar_ptr(ret_val);
24202: call_tests++;
24203: des_const_xmlChar_ptr(n_path, (const xmlChar *)path, 0);
24204: xmlResetLastError();
24205: if (mem_base != xmlMemBlocks()) {
24206: printf("Leak of %d blocks found in xmlCanonicPath",
24207: xmlMemBlocks() - mem_base);
24208: test_ret++;
24209: printf(" %d", n_path);
24210: printf("\n");
24211: }
24212: }
24213: function_tests++;
24214:
24215: return(test_ret);
24216: }
24217:
24218:
24219: static int
24220: test_xmlCreateURI(void) {
24221: int test_ret = 0;
24222:
24223:
24224: /* missing type support */
24225: return(test_ret);
24226: }
24227:
24228:
24229: static int
24230: test_xmlNormalizeURIPath(void) {
24231: int test_ret = 0;
24232:
24233: int mem_base;
24234: int ret_val;
24235: char * path; /* pointer to the path string */
24236: int n_path;
24237:
24238: for (n_path = 0;n_path < gen_nb_char_ptr;n_path++) {
24239: mem_base = xmlMemBlocks();
24240: path = gen_char_ptr(n_path, 0);
24241:
24242: ret_val = xmlNormalizeURIPath(path);
24243: desret_int(ret_val);
24244: call_tests++;
24245: des_char_ptr(n_path, path, 0);
24246: xmlResetLastError();
24247: if (mem_base != xmlMemBlocks()) {
24248: printf("Leak of %d blocks found in xmlNormalizeURIPath",
24249: xmlMemBlocks() - mem_base);
24250: test_ret++;
24251: printf(" %d", n_path);
24252: printf("\n");
24253: }
24254: }
24255: function_tests++;
24256:
24257: return(test_ret);
24258: }
24259:
24260:
24261: static int
24262: test_xmlParseURI(void) {
24263: int test_ret = 0;
24264:
24265:
24266: /* missing type support */
24267: return(test_ret);
24268: }
24269:
24270:
24271: static int
24272: test_xmlParseURIRaw(void) {
24273: int test_ret = 0;
24274:
24275:
24276: /* missing type support */
24277: return(test_ret);
24278: }
24279:
24280:
24281: #define gen_nb_xmlURIPtr 1
24282: static xmlURIPtr gen_xmlURIPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24283: return(NULL);
24284: }
24285: static void des_xmlURIPtr(int no ATTRIBUTE_UNUSED, xmlURIPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24286: }
24287:
24288: static int
24289: test_xmlParseURIReference(void) {
24290: int test_ret = 0;
24291:
24292: int mem_base;
24293: int ret_val;
24294: xmlURIPtr uri; /* pointer to an URI structure */
24295: int n_uri;
24296: char * str; /* the string to analyze */
24297: int n_str;
24298:
24299: for (n_uri = 0;n_uri < gen_nb_xmlURIPtr;n_uri++) {
24300: for (n_str = 0;n_str < gen_nb_const_char_ptr;n_str++) {
24301: mem_base = xmlMemBlocks();
24302: uri = gen_xmlURIPtr(n_uri, 0);
24303: str = gen_const_char_ptr(n_str, 1);
24304:
24305: ret_val = xmlParseURIReference(uri, (const char *)str);
24306: desret_int(ret_val);
24307: call_tests++;
24308: des_xmlURIPtr(n_uri, uri, 0);
24309: des_const_char_ptr(n_str, (const char *)str, 1);
24310: xmlResetLastError();
24311: if (mem_base != xmlMemBlocks()) {
24312: printf("Leak of %d blocks found in xmlParseURIReference",
24313: xmlMemBlocks() - mem_base);
24314: test_ret++;
24315: printf(" %d", n_uri);
24316: printf(" %d", n_str);
24317: printf("\n");
24318: }
24319: }
24320: }
24321: function_tests++;
24322:
24323: return(test_ret);
24324: }
24325:
24326:
24327: static int
24328: test_xmlPathToURI(void) {
24329: int test_ret = 0;
24330:
24331: int mem_base;
24332: xmlChar * ret_val;
24333: xmlChar * path; /* the resource locator in a filesystem notation */
24334: int n_path;
24335:
24336: for (n_path = 0;n_path < gen_nb_const_xmlChar_ptr;n_path++) {
24337: mem_base = xmlMemBlocks();
24338: path = gen_const_xmlChar_ptr(n_path, 0);
24339:
24340: ret_val = xmlPathToURI((const xmlChar *)path);
24341: desret_xmlChar_ptr(ret_val);
24342: call_tests++;
24343: des_const_xmlChar_ptr(n_path, (const xmlChar *)path, 0);
24344: xmlResetLastError();
24345: if (mem_base != xmlMemBlocks()) {
24346: printf("Leak of %d blocks found in xmlPathToURI",
24347: xmlMemBlocks() - mem_base);
24348: test_ret++;
24349: printf(" %d", n_path);
24350: printf("\n");
24351: }
24352: }
24353: function_tests++;
24354:
24355: return(test_ret);
24356: }
24357:
24358:
24359: static int
24360: test_xmlPrintURI(void) {
24361: int test_ret = 0;
24362:
24363: int mem_base;
24364: FILE * stream; /* a FILE* for the output */
24365: int n_stream;
24366: xmlURIPtr uri; /* pointer to an xmlURI */
24367: int n_uri;
24368:
24369: for (n_stream = 0;n_stream < gen_nb_FILE_ptr;n_stream++) {
24370: for (n_uri = 0;n_uri < gen_nb_xmlURIPtr;n_uri++) {
24371: mem_base = xmlMemBlocks();
24372: stream = gen_FILE_ptr(n_stream, 0);
24373: uri = gen_xmlURIPtr(n_uri, 1);
24374:
24375: xmlPrintURI(stream, uri);
24376: call_tests++;
24377: des_FILE_ptr(n_stream, stream, 0);
24378: des_xmlURIPtr(n_uri, uri, 1);
24379: xmlResetLastError();
24380: if (mem_base != xmlMemBlocks()) {
24381: printf("Leak of %d blocks found in xmlPrintURI",
24382: xmlMemBlocks() - mem_base);
24383: test_ret++;
24384: printf(" %d", n_stream);
24385: printf(" %d", n_uri);
24386: printf("\n");
24387: }
24388: }
24389: }
24390: function_tests++;
24391:
24392: return(test_ret);
24393: }
24394:
24395:
24396: static int
24397: test_xmlSaveUri(void) {
24398: int test_ret = 0;
24399:
24400: int mem_base;
24401: xmlChar * ret_val;
24402: xmlURIPtr uri; /* pointer to an xmlURI */
24403: int n_uri;
24404:
24405: for (n_uri = 0;n_uri < gen_nb_xmlURIPtr;n_uri++) {
24406: mem_base = xmlMemBlocks();
24407: uri = gen_xmlURIPtr(n_uri, 0);
24408:
24409: ret_val = xmlSaveUri(uri);
24410: desret_xmlChar_ptr(ret_val);
24411: call_tests++;
24412: des_xmlURIPtr(n_uri, uri, 0);
24413: xmlResetLastError();
24414: if (mem_base != xmlMemBlocks()) {
24415: printf("Leak of %d blocks found in xmlSaveUri",
24416: xmlMemBlocks() - mem_base);
24417: test_ret++;
24418: printf(" %d", n_uri);
24419: printf("\n");
24420: }
24421: }
24422: function_tests++;
24423:
24424: return(test_ret);
24425: }
24426:
24427:
24428: static int
24429: test_xmlURIEscape(void) {
24430: int test_ret = 0;
24431:
24432: int mem_base;
24433: xmlChar * ret_val;
24434: xmlChar * str; /* the string of the URI to escape */
24435: int n_str;
24436:
24437: for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
24438: mem_base = xmlMemBlocks();
24439: str = gen_const_xmlChar_ptr(n_str, 0);
24440:
24441: ret_val = xmlURIEscape((const xmlChar *)str);
24442: desret_xmlChar_ptr(ret_val);
24443: call_tests++;
24444: des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
24445: xmlResetLastError();
24446: if (mem_base != xmlMemBlocks()) {
24447: printf("Leak of %d blocks found in xmlURIEscape",
24448: xmlMemBlocks() - mem_base);
24449: test_ret++;
24450: printf(" %d", n_str);
24451: printf("\n");
24452: }
24453: }
24454: function_tests++;
24455:
24456: return(test_ret);
24457: }
24458:
24459:
24460: static int
24461: test_xmlURIEscapeStr(void) {
24462: int test_ret = 0;
24463:
24464: int mem_base;
24465: xmlChar * ret_val;
24466: xmlChar * str; /* string to escape */
24467: int n_str;
24468: xmlChar * list; /* exception list string of chars not to escape */
24469: int n_list;
24470:
24471: for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
24472: for (n_list = 0;n_list < gen_nb_const_xmlChar_ptr;n_list++) {
24473: mem_base = xmlMemBlocks();
24474: str = gen_const_xmlChar_ptr(n_str, 0);
24475: list = gen_const_xmlChar_ptr(n_list, 1);
24476:
24477: ret_val = xmlURIEscapeStr((const xmlChar *)str, (const xmlChar *)list);
24478: desret_xmlChar_ptr(ret_val);
24479: call_tests++;
24480: des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
24481: des_const_xmlChar_ptr(n_list, (const xmlChar *)list, 1);
24482: xmlResetLastError();
24483: if (mem_base != xmlMemBlocks()) {
24484: printf("Leak of %d blocks found in xmlURIEscapeStr",
24485: xmlMemBlocks() - mem_base);
24486: test_ret++;
24487: printf(" %d", n_str);
24488: printf(" %d", n_list);
24489: printf("\n");
24490: }
24491: }
24492: }
24493: function_tests++;
24494:
24495: return(test_ret);
24496: }
24497:
24498:
24499: static int
24500: test_xmlURIUnescapeString(void) {
24501: int test_ret = 0;
24502:
24503:
24504: /* missing type support */
24505: return(test_ret);
24506: }
24507:
24508: static int
24509: test_uri(void) {
24510: int test_ret = 0;
24511:
24512: if (quiet == 0) printf("Testing uri : 10 of 15 functions ...\n");
24513: test_ret += test_xmlBuildRelativeURI();
24514: test_ret += test_xmlBuildURI();
24515: test_ret += test_xmlCanonicPath();
24516: test_ret += test_xmlCreateURI();
24517: test_ret += test_xmlNormalizeURIPath();
24518: test_ret += test_xmlParseURI();
24519: test_ret += test_xmlParseURIRaw();
24520: test_ret += test_xmlParseURIReference();
24521: test_ret += test_xmlPathToURI();
24522: test_ret += test_xmlPrintURI();
24523: test_ret += test_xmlSaveUri();
24524: test_ret += test_xmlURIEscape();
24525: test_ret += test_xmlURIEscapeStr();
24526: test_ret += test_xmlURIUnescapeString();
24527:
24528: if (test_ret != 0)
24529: printf("Module uri: %d errors\n", test_ret);
24530: return(test_ret);
24531: }
24532:
24533: static int
24534: test_xmlAddAttributeDecl(void) {
24535: int test_ret = 0;
24536:
24537: int mem_base;
24538: xmlAttributePtr ret_val;
24539: xmlValidCtxtPtr ctxt; /* the validation context */
24540: int n_ctxt;
24541: xmlDtdPtr dtd; /* pointer to the DTD */
24542: int n_dtd;
24543: xmlChar * elem; /* the element name */
24544: int n_elem;
24545: xmlChar * name; /* the attribute name */
24546: int n_name;
24547: xmlChar * ns; /* the attribute namespace prefix */
24548: int n_ns;
24549: xmlAttributeType type; /* the attribute type */
24550: int n_type;
24551: xmlAttributeDefault def; /* the attribute default type */
24552: int n_def;
24553: xmlChar * defaultValue; /* the attribute default value */
24554: int n_defaultValue;
24555: xmlEnumerationPtr tree; /* if it's an enumeration, the associated list */
24556: int n_tree;
24557:
24558: for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
24559: for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
24560: for (n_elem = 0;n_elem < gen_nb_const_xmlChar_ptr;n_elem++) {
24561: for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
24562: for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
24563: for (n_type = 0;n_type < gen_nb_xmlAttributeType;n_type++) {
24564: for (n_def = 0;n_def < gen_nb_xmlAttributeDefault;n_def++) {
24565: for (n_defaultValue = 0;n_defaultValue < gen_nb_const_xmlChar_ptr;n_defaultValue++) {
24566: for (n_tree = 0;n_tree < gen_nb_xmlEnumerationPtr;n_tree++) {
24567: mem_base = xmlMemBlocks();
24568: ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
24569: dtd = gen_xmlDtdPtr(n_dtd, 1);
24570: elem = gen_const_xmlChar_ptr(n_elem, 2);
24571: name = gen_const_xmlChar_ptr(n_name, 3);
24572: ns = gen_const_xmlChar_ptr(n_ns, 4);
24573: type = gen_xmlAttributeType(n_type, 5);
24574: def = gen_xmlAttributeDefault(n_def, 6);
24575: defaultValue = gen_const_xmlChar_ptr(n_defaultValue, 7);
24576: tree = gen_xmlEnumerationPtr(n_tree, 8);
24577:
24578: ret_val = xmlAddAttributeDecl(ctxt, dtd, (const xmlChar *)elem, (const xmlChar *)name, (const xmlChar *)ns, type, def, (const xmlChar *)defaultValue, tree);
24579: desret_xmlAttributePtr(ret_val);
24580: call_tests++;
24581: des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
24582: des_xmlDtdPtr(n_dtd, dtd, 1);
24583: des_const_xmlChar_ptr(n_elem, (const xmlChar *)elem, 2);
24584: des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 3);
24585: des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 4);
24586: des_xmlAttributeType(n_type, type, 5);
24587: des_xmlAttributeDefault(n_def, def, 6);
24588: des_const_xmlChar_ptr(n_defaultValue, (const xmlChar *)defaultValue, 7);
24589: des_xmlEnumerationPtr(n_tree, tree, 8);
24590: xmlResetLastError();
24591: if (mem_base != xmlMemBlocks()) {
24592: printf("Leak of %d blocks found in xmlAddAttributeDecl",
24593: xmlMemBlocks() - mem_base);
24594: test_ret++;
24595: printf(" %d", n_ctxt);
24596: printf(" %d", n_dtd);
24597: printf(" %d", n_elem);
24598: printf(" %d", n_name);
24599: printf(" %d", n_ns);
24600: printf(" %d", n_type);
24601: printf(" %d", n_def);
24602: printf(" %d", n_defaultValue);
24603: printf(" %d", n_tree);
24604: printf("\n");
24605: }
24606: }
24607: }
24608: }
24609: }
24610: }
24611: }
24612: }
24613: }
24614: }
24615: function_tests++;
24616:
24617: return(test_ret);
24618: }
24619:
24620:
24621: static int
24622: test_xmlAddElementDecl(void) {
24623: int test_ret = 0;
24624:
24625: int mem_base;
24626: xmlElementPtr ret_val;
24627: xmlValidCtxtPtr ctxt; /* the validation context */
24628: int n_ctxt;
24629: xmlDtdPtr dtd; /* pointer to the DTD */
24630: int n_dtd;
24631: xmlChar * name; /* the entity name */
24632: int n_name;
24633: xmlElementTypeVal type; /* the element type */
24634: int n_type;
24635: xmlElementContentPtr content; /* the element content tree or NULL */
24636: int n_content;
24637:
24638: for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
24639: for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
24640: for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
24641: for (n_type = 0;n_type < gen_nb_xmlElementTypeVal;n_type++) {
24642: for (n_content = 0;n_content < gen_nb_xmlElementContentPtr;n_content++) {
24643: mem_base = xmlMemBlocks();
24644: ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
24645: dtd = gen_xmlDtdPtr(n_dtd, 1);
24646: name = gen_const_xmlChar_ptr(n_name, 2);
24647: type = gen_xmlElementTypeVal(n_type, 3);
24648: content = gen_xmlElementContentPtr(n_content, 4);
24649:
24650: ret_val = xmlAddElementDecl(ctxt, dtd, (const xmlChar *)name, type, content);
24651: desret_xmlElementPtr(ret_val);
24652: call_tests++;
24653: des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
24654: des_xmlDtdPtr(n_dtd, dtd, 1);
24655: des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
24656: des_xmlElementTypeVal(n_type, type, 3);
24657: des_xmlElementContentPtr(n_content, content, 4);
24658: xmlResetLastError();
24659: if (mem_base != xmlMemBlocks()) {
24660: printf("Leak of %d blocks found in xmlAddElementDecl",
24661: xmlMemBlocks() - mem_base);
24662: test_ret++;
24663: printf(" %d", n_ctxt);
24664: printf(" %d", n_dtd);
24665: printf(" %d", n_name);
24666: printf(" %d", n_type);
24667: printf(" %d", n_content);
24668: printf("\n");
24669: }
24670: }
24671: }
24672: }
24673: }
24674: }
24675: function_tests++;
24676:
24677: return(test_ret);
24678: }
24679:
24680:
24681: static int
24682: test_xmlAddID(void) {
24683: int test_ret = 0;
24684:
24685:
24686: /* missing type support */
24687: return(test_ret);
24688: }
24689:
24690:
24691: static int
24692: test_xmlAddNotationDecl(void) {
24693: int test_ret = 0;
24694:
24695:
24696: /* missing type support */
24697: return(test_ret);
24698: }
24699:
24700:
24701: static int
24702: test_xmlAddRef(void) {
24703: int test_ret = 0;
24704:
24705:
24706: /* missing type support */
24707: return(test_ret);
24708: }
24709:
24710:
24711: #define gen_nb_xmlAttributeTablePtr 1
24712: static xmlAttributeTablePtr gen_xmlAttributeTablePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24713: return(NULL);
24714: }
24715: static void des_xmlAttributeTablePtr(int no ATTRIBUTE_UNUSED, xmlAttributeTablePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24716: }
24717:
24718: static int
24719: test_xmlCopyAttributeTable(void) {
24720: int test_ret = 0;
24721:
24722:
24723: /* missing type support */
24724: return(test_ret);
24725: }
24726:
24727:
24728: static int
24729: test_xmlCopyDocElementContent(void) {
24730: int test_ret = 0;
24731:
24732: int mem_base;
24733: xmlElementContentPtr ret_val;
24734: xmlDocPtr doc; /* the document owning the element declaration */
24735: int n_doc;
24736: xmlElementContentPtr cur; /* An element content pointer. */
24737: int n_cur;
24738:
24739: for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
24740: for (n_cur = 0;n_cur < gen_nb_xmlElementContentPtr;n_cur++) {
24741: mem_base = xmlMemBlocks();
24742: doc = gen_xmlDocPtr(n_doc, 0);
24743: cur = gen_xmlElementContentPtr(n_cur, 1);
24744:
24745: ret_val = xmlCopyDocElementContent(doc, cur);
24746: desret_xmlElementContentPtr(ret_val);
24747: call_tests++;
24748: des_xmlDocPtr(n_doc, doc, 0);
24749: des_xmlElementContentPtr(n_cur, cur, 1);
24750: xmlResetLastError();
24751: if (mem_base != xmlMemBlocks()) {
24752: printf("Leak of %d blocks found in xmlCopyDocElementContent",
24753: xmlMemBlocks() - mem_base);
24754: test_ret++;
24755: printf(" %d", n_doc);
24756: printf(" %d", n_cur);
24757: printf("\n");
24758: }
24759: }
24760: }
24761: function_tests++;
24762:
24763: return(test_ret);
24764: }
24765:
24766:
24767: static int
24768: test_xmlCopyElementContent(void) {
24769: int test_ret = 0;
24770:
24771: int mem_base;
24772: xmlElementContentPtr ret_val;
24773: xmlElementContentPtr cur; /* An element content pointer. */
24774: int n_cur;
24775:
24776: for (n_cur = 0;n_cur < gen_nb_xmlElementContentPtr;n_cur++) {
24777: mem_base = xmlMemBlocks();
24778: cur = gen_xmlElementContentPtr(n_cur, 0);
24779:
24780: ret_val = xmlCopyElementContent(cur);
24781: desret_xmlElementContentPtr(ret_val);
24782: call_tests++;
24783: des_xmlElementContentPtr(n_cur, cur, 0);
24784: xmlResetLastError();
24785: if (mem_base != xmlMemBlocks()) {
24786: printf("Leak of %d blocks found in xmlCopyElementContent",
24787: xmlMemBlocks() - mem_base);
24788: test_ret++;
24789: printf(" %d", n_cur);
24790: printf("\n");
24791: }
24792: }
24793: function_tests++;
24794:
24795: return(test_ret);
24796: }
24797:
24798:
24799: #define gen_nb_xmlElementTablePtr 1
24800: static xmlElementTablePtr gen_xmlElementTablePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24801: return(NULL);
24802: }
24803: static void des_xmlElementTablePtr(int no ATTRIBUTE_UNUSED, xmlElementTablePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24804: }
24805:
24806: static int
24807: test_xmlCopyElementTable(void) {
24808: int test_ret = 0;
24809:
24810:
24811: /* missing type support */
24812: return(test_ret);
24813: }
24814:
24815:
24816: static int
24817: test_xmlCopyEnumeration(void) {
24818: int test_ret = 0;
24819:
24820:
24821: /* missing type support */
24822: return(test_ret);
24823: }
24824:
24825:
24826: #define gen_nb_xmlNotationTablePtr 1
24827: static xmlNotationTablePtr gen_xmlNotationTablePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24828: return(NULL);
24829: }
24830: static void des_xmlNotationTablePtr(int no ATTRIBUTE_UNUSED, xmlNotationTablePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24831: }
24832:
24833: static int
24834: test_xmlCopyNotationTable(void) {
24835: int test_ret = 0;
24836:
24837:
24838: /* missing type support */
24839: return(test_ret);
24840: }
24841:
24842:
24843: static int
24844: test_xmlCreateEnumeration(void) {
24845: int test_ret = 0;
24846:
24847:
24848: /* missing type support */
24849: return(test_ret);
24850: }
24851:
24852:
24853: #define gen_nb_xmlAttributePtr 1
24854: static xmlAttributePtr gen_xmlAttributePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24855: return(NULL);
24856: }
24857: static void des_xmlAttributePtr(int no ATTRIBUTE_UNUSED, xmlAttributePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24858: }
24859:
24860: static int
24861: test_xmlDumpAttributeDecl(void) {
24862: int test_ret = 0;
24863:
24864: #if defined(LIBXML_OUTPUT_ENABLED)
24865: int mem_base;
24866: xmlBufferPtr buf; /* the XML buffer output */
24867: int n_buf;
24868: xmlAttributePtr attr; /* An attribute declaration */
24869: int n_attr;
24870:
24871: for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
24872: for (n_attr = 0;n_attr < gen_nb_xmlAttributePtr;n_attr++) {
24873: mem_base = xmlMemBlocks();
24874: buf = gen_xmlBufferPtr(n_buf, 0);
24875: attr = gen_xmlAttributePtr(n_attr, 1);
24876:
24877: xmlDumpAttributeDecl(buf, attr);
24878: call_tests++;
24879: des_xmlBufferPtr(n_buf, buf, 0);
24880: des_xmlAttributePtr(n_attr, attr, 1);
24881: xmlResetLastError();
24882: if (mem_base != xmlMemBlocks()) {
24883: printf("Leak of %d blocks found in xmlDumpAttributeDecl",
24884: xmlMemBlocks() - mem_base);
24885: test_ret++;
24886: printf(" %d", n_buf);
24887: printf(" %d", n_attr);
24888: printf("\n");
24889: }
24890: }
24891: }
24892: function_tests++;
24893: #endif
24894:
24895: return(test_ret);
24896: }
24897:
24898:
24899: static int
24900: test_xmlDumpAttributeTable(void) {
24901: int test_ret = 0;
24902:
24903: #if defined(LIBXML_OUTPUT_ENABLED)
24904: int mem_base;
24905: xmlBufferPtr buf; /* the XML buffer output */
24906: int n_buf;
24907: xmlAttributeTablePtr table; /* An attribute table */
24908: int n_table;
24909:
24910: for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
24911: for (n_table = 0;n_table < gen_nb_xmlAttributeTablePtr;n_table++) {
24912: mem_base = xmlMemBlocks();
24913: buf = gen_xmlBufferPtr(n_buf, 0);
24914: table = gen_xmlAttributeTablePtr(n_table, 1);
24915:
24916: xmlDumpAttributeTable(buf, table);
24917: call_tests++;
24918: des_xmlBufferPtr(n_buf, buf, 0);
24919: des_xmlAttributeTablePtr(n_table, table, 1);
24920: xmlResetLastError();
24921: if (mem_base != xmlMemBlocks()) {
24922: printf("Leak of %d blocks found in xmlDumpAttributeTable",
24923: xmlMemBlocks() - mem_base);
24924: test_ret++;
24925: printf(" %d", n_buf);
24926: printf(" %d", n_table);
24927: printf("\n");
24928: }
24929: }
24930: }
24931: function_tests++;
24932: #endif
24933:
24934: return(test_ret);
24935: }
24936:
24937:
24938: #define gen_nb_xmlElementPtr 1
24939: static xmlElementPtr gen_xmlElementPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24940: return(NULL);
24941: }
24942: static void des_xmlElementPtr(int no ATTRIBUTE_UNUSED, xmlElementPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24943: }
24944:
24945: static int
24946: test_xmlDumpElementDecl(void) {
24947: int test_ret = 0;
24948:
24949: #if defined(LIBXML_OUTPUT_ENABLED)
24950: int mem_base;
24951: xmlBufferPtr buf; /* the XML buffer output */
24952: int n_buf;
24953: xmlElementPtr elem; /* An element table */
24954: int n_elem;
24955:
24956: for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
24957: for (n_elem = 0;n_elem < gen_nb_xmlElementPtr;n_elem++) {
24958: mem_base = xmlMemBlocks();
24959: buf = gen_xmlBufferPtr(n_buf, 0);
24960: elem = gen_xmlElementPtr(n_elem, 1);
24961:
24962: xmlDumpElementDecl(buf, elem);
24963: call_tests++;
24964: des_xmlBufferPtr(n_buf, buf, 0);
24965: des_xmlElementPtr(n_elem, elem, 1);
24966: xmlResetLastError();
24967: if (mem_base != xmlMemBlocks()) {
24968: printf("Leak of %d blocks found in xmlDumpElementDecl",
24969: xmlMemBlocks() - mem_base);
24970: test_ret++;
24971: printf(" %d", n_buf);
24972: printf(" %d", n_elem);
24973: printf("\n");
24974: }
24975: }
24976: }
24977: function_tests++;
24978: #endif
24979:
24980: return(test_ret);
24981: }
24982:
24983:
24984: static int
24985: test_xmlDumpElementTable(void) {
24986: int test_ret = 0;
24987:
24988: #if defined(LIBXML_OUTPUT_ENABLED)
24989: int mem_base;
24990: xmlBufferPtr buf; /* the XML buffer output */
24991: int n_buf;
24992: xmlElementTablePtr table; /* An element table */
24993: int n_table;
24994:
24995: for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
24996: for (n_table = 0;n_table < gen_nb_xmlElementTablePtr;n_table++) {
24997: mem_base = xmlMemBlocks();
24998: buf = gen_xmlBufferPtr(n_buf, 0);
24999: table = gen_xmlElementTablePtr(n_table, 1);
25000:
25001: xmlDumpElementTable(buf, table);
25002: call_tests++;
25003: des_xmlBufferPtr(n_buf, buf, 0);
25004: des_xmlElementTablePtr(n_table, table, 1);
25005: xmlResetLastError();
25006: if (mem_base != xmlMemBlocks()) {
25007: printf("Leak of %d blocks found in xmlDumpElementTable",
25008: xmlMemBlocks() - mem_base);
25009: test_ret++;
25010: printf(" %d", n_buf);
25011: printf(" %d", n_table);
25012: printf("\n");
25013: }
25014: }
25015: }
25016: function_tests++;
25017: #endif
25018:
25019: return(test_ret);
25020: }
25021:
25022:
25023: #define gen_nb_xmlNotationPtr 1
25024: static xmlNotationPtr gen_xmlNotationPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25025: return(NULL);
25026: }
25027: static void des_xmlNotationPtr(int no ATTRIBUTE_UNUSED, xmlNotationPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25028: }
25029:
25030: static int
25031: test_xmlDumpNotationDecl(void) {
25032: int test_ret = 0;
25033:
25034: #if defined(LIBXML_OUTPUT_ENABLED)
25035: int mem_base;
25036: xmlBufferPtr buf; /* the XML buffer output */
25037: int n_buf;
25038: xmlNotationPtr nota; /* A notation declaration */
25039: int n_nota;
25040:
25041: for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
25042: for (n_nota = 0;n_nota < gen_nb_xmlNotationPtr;n_nota++) {
25043: mem_base = xmlMemBlocks();
25044: buf = gen_xmlBufferPtr(n_buf, 0);
25045: nota = gen_xmlNotationPtr(n_nota, 1);
25046:
25047: xmlDumpNotationDecl(buf, nota);
25048: call_tests++;
25049: des_xmlBufferPtr(n_buf, buf, 0);
25050: des_xmlNotationPtr(n_nota, nota, 1);
25051: xmlResetLastError();
25052: if (mem_base != xmlMemBlocks()) {
25053: printf("Leak of %d blocks found in xmlDumpNotationDecl",
25054: xmlMemBlocks() - mem_base);
25055: test_ret++;
25056: printf(" %d", n_buf);
25057: printf(" %d", n_nota);
25058: printf("\n");
25059: }
25060: }
25061: }
25062: function_tests++;
25063: #endif
25064:
25065: return(test_ret);
25066: }
25067:
25068:
25069: static int
25070: test_xmlDumpNotationTable(void) {
25071: int test_ret = 0;
25072:
25073: #if defined(LIBXML_OUTPUT_ENABLED)
25074: int mem_base;
25075: xmlBufferPtr buf; /* the XML buffer output */
25076: int n_buf;
25077: xmlNotationTablePtr table; /* A notation table */
25078: int n_table;
25079:
25080: for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
25081: for (n_table = 0;n_table < gen_nb_xmlNotationTablePtr;n_table++) {
25082: mem_base = xmlMemBlocks();
25083: buf = gen_xmlBufferPtr(n_buf, 0);
25084: table = gen_xmlNotationTablePtr(n_table, 1);
25085:
25086: xmlDumpNotationTable(buf, table);
25087: call_tests++;
25088: des_xmlBufferPtr(n_buf, buf, 0);
25089: des_xmlNotationTablePtr(n_table, table, 1);
25090: xmlResetLastError();
25091: if (mem_base != xmlMemBlocks()) {
25092: printf("Leak of %d blocks found in xmlDumpNotationTable",
25093: xmlMemBlocks() - mem_base);
25094: test_ret++;
25095: printf(" %d", n_buf);
25096: printf(" %d", n_table);
25097: printf("\n");
25098: }
25099: }
25100: }
25101: function_tests++;
25102: #endif
25103:
25104: return(test_ret);
25105: }
25106:
25107:
25108: static int
25109: test_xmlGetDtdAttrDesc(void) {
25110: int test_ret = 0;
25111:
25112: int mem_base;
25113: xmlAttributePtr ret_val;
25114: xmlDtdPtr dtd; /* a pointer to the DtD to search */
25115: int n_dtd;
25116: xmlChar * elem; /* the element name */
25117: int n_elem;
25118: xmlChar * name; /* the attribute name */
25119: int n_name;
25120:
25121: for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
25122: for (n_elem = 0;n_elem < gen_nb_const_xmlChar_ptr;n_elem++) {
25123: for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25124: mem_base = xmlMemBlocks();
25125: dtd = gen_xmlDtdPtr(n_dtd, 0);
25126: elem = gen_const_xmlChar_ptr(n_elem, 1);
25127: name = gen_const_xmlChar_ptr(n_name, 2);
25128:
25129: ret_val = xmlGetDtdAttrDesc(dtd, (const xmlChar *)elem, (const xmlChar *)name);
25130: desret_xmlAttributePtr(ret_val);
25131: call_tests++;
25132: des_xmlDtdPtr(n_dtd, dtd, 0);
25133: des_const_xmlChar_ptr(n_elem, (const xmlChar *)elem, 1);
25134: des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
25135: xmlResetLastError();
25136: if (mem_base != xmlMemBlocks()) {
25137: printf("Leak of %d blocks found in xmlGetDtdAttrDesc",
25138: xmlMemBlocks() - mem_base);
25139: test_ret++;
25140: printf(" %d", n_dtd);
25141: printf(" %d", n_elem);
25142: printf(" %d", n_name);
25143: printf("\n");
25144: }
25145: }
25146: }
25147: }
25148: function_tests++;
25149:
25150: return(test_ret);
25151: }
25152:
25153:
25154: static int
25155: test_xmlGetDtdElementDesc(void) {
25156: int test_ret = 0;
25157:
25158: int mem_base;
25159: xmlElementPtr ret_val;
25160: xmlDtdPtr dtd; /* a pointer to the DtD to search */
25161: int n_dtd;
25162: xmlChar * name; /* the element name */
25163: int n_name;
25164:
25165: for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
25166: for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25167: mem_base = xmlMemBlocks();
25168: dtd = gen_xmlDtdPtr(n_dtd, 0);
25169: name = gen_const_xmlChar_ptr(n_name, 1);
25170:
25171: ret_val = xmlGetDtdElementDesc(dtd, (const xmlChar *)name);
25172: desret_xmlElementPtr(ret_val);
25173: call_tests++;
25174: des_xmlDtdPtr(n_dtd, dtd, 0);
25175: des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
25176: xmlResetLastError();
25177: if (mem_base != xmlMemBlocks()) {
25178: printf("Leak of %d blocks found in xmlGetDtdElementDesc",
25179: xmlMemBlocks() - mem_base);
25180: test_ret++;
25181: printf(" %d", n_dtd);
25182: printf(" %d", n_name);
25183: printf("\n");
25184: }
25185: }
25186: }
25187: function_tests++;
25188:
25189: return(test_ret);
25190: }
25191:
25192:
25193: static int
25194: test_xmlGetDtdNotationDesc(void) {
25195: int test_ret = 0;
25196:
25197:
25198: /* missing type support */
25199: return(test_ret);
25200: }
25201:
25202:
25203: static int
25204: test_xmlGetDtdQAttrDesc(void) {
25205: int test_ret = 0;
25206:
25207: int mem_base;
25208: xmlAttributePtr ret_val;
25209: xmlDtdPtr dtd; /* a pointer to the DtD to search */
25210: int n_dtd;
25211: xmlChar * elem; /* the element name */
25212: int n_elem;
25213: xmlChar * name; /* the attribute name */
25214: int n_name;
25215: xmlChar * prefix; /* the attribute namespace prefix */
25216: int n_prefix;
25217:
25218: for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
25219: for (n_elem = 0;n_elem < gen_nb_const_xmlChar_ptr;n_elem++) {
25220: for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25221: for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
25222: mem_base = xmlMemBlocks();
25223: dtd = gen_xmlDtdPtr(n_dtd, 0);
25224: elem = gen_const_xmlChar_ptr(n_elem, 1);
25225: name = gen_const_xmlChar_ptr(n_name, 2);
25226: prefix = gen_const_xmlChar_ptr(n_prefix, 3);
25227:
25228: ret_val = xmlGetDtdQAttrDesc(dtd, (const xmlChar *)elem, (const xmlChar *)name, (const xmlChar *)prefix);
25229: desret_xmlAttributePtr(ret_val);
25230: call_tests++;
25231: des_xmlDtdPtr(n_dtd, dtd, 0);
25232: des_const_xmlChar_ptr(n_elem, (const xmlChar *)elem, 1);
25233: des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
25234: des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 3);
25235: xmlResetLastError();
25236: if (mem_base != xmlMemBlocks()) {
25237: printf("Leak of %d blocks found in xmlGetDtdQAttrDesc",
25238: xmlMemBlocks() - mem_base);
25239: test_ret++;
25240: printf(" %d", n_dtd);
25241: printf(" %d", n_elem);
25242: printf(" %d", n_name);
25243: printf(" %d", n_prefix);
25244: printf("\n");
25245: }
25246: }
25247: }
25248: }
25249: }
25250: function_tests++;
25251:
25252: return(test_ret);
25253: }
25254:
25255:
25256: static int
25257: test_xmlGetDtdQElementDesc(void) {
25258: int test_ret = 0;
25259:
25260: int mem_base;
25261: xmlElementPtr ret_val;
25262: xmlDtdPtr dtd; /* a pointer to the DtD to search */
25263: int n_dtd;
25264: xmlChar * name; /* the element name */
25265: int n_name;
25266: xmlChar * prefix; /* the element namespace prefix */
25267: int n_prefix;
25268:
25269: for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
25270: for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25271: for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
25272: mem_base = xmlMemBlocks();
25273: dtd = gen_xmlDtdPtr(n_dtd, 0);
25274: name = gen_const_xmlChar_ptr(n_name, 1);
25275: prefix = gen_const_xmlChar_ptr(n_prefix, 2);
25276:
25277: ret_val = xmlGetDtdQElementDesc(dtd, (const xmlChar *)name, (const xmlChar *)prefix);
25278: desret_xmlElementPtr(ret_val);
25279: call_tests++;
25280: des_xmlDtdPtr(n_dtd, dtd, 0);
25281: des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
25282: des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 2);
25283: xmlResetLastError();
25284: if (mem_base != xmlMemBlocks()) {
25285: printf("Leak of %d blocks found in xmlGetDtdQElementDesc",
25286: xmlMemBlocks() - mem_base);
25287: test_ret++;
25288: printf(" %d", n_dtd);
25289: printf(" %d", n_name);
25290: printf(" %d", n_prefix);
25291: printf("\n");
25292: }
25293: }
25294: }
25295: }
25296: function_tests++;
25297:
25298: return(test_ret);
25299: }
25300:
25301:
25302: static int
25303: test_xmlGetID(void) {
25304: int test_ret = 0;
25305:
25306: int mem_base;
25307: xmlAttrPtr ret_val;
25308: xmlDocPtr doc; /* pointer to the document */
25309: int n_doc;
25310: xmlChar * ID; /* the ID value */
25311: int n_ID;
25312:
25313: for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25314: for (n_ID = 0;n_ID < gen_nb_const_xmlChar_ptr;n_ID++) {
25315: mem_base = xmlMemBlocks();
25316: doc = gen_xmlDocPtr(n_doc, 0);
25317: ID = gen_const_xmlChar_ptr(n_ID, 1);
25318:
25319: ret_val = xmlGetID(doc, (const xmlChar *)ID);
25320: desret_xmlAttrPtr(ret_val);
25321: call_tests++;
25322: des_xmlDocPtr(n_doc, doc, 0);
25323: des_const_xmlChar_ptr(n_ID, (const xmlChar *)ID, 1);
25324: xmlResetLastError();
25325: if (mem_base != xmlMemBlocks()) {
25326: printf("Leak of %d blocks found in xmlGetID",
25327: xmlMemBlocks() - mem_base);
25328: test_ret++;
25329: printf(" %d", n_doc);
25330: printf(" %d", n_ID);
25331: printf("\n");
25332: }
25333: }
25334: }
25335: function_tests++;
25336:
25337: return(test_ret);
25338: }
25339:
25340:
25341: static int
25342: test_xmlGetRefs(void) {
25343: int test_ret = 0;
25344:
25345:
25346: /* missing type support */
25347: return(test_ret);
25348: }
25349:
25350:
25351: static int
25352: test_xmlIsID(void) {
25353: int test_ret = 0;
25354:
25355: int mem_base;
25356: int ret_val;
25357: xmlDocPtr doc; /* the document */
25358: int n_doc;
25359: xmlNodePtr elem; /* the element carrying the attribute */
25360: int n_elem;
25361: xmlAttrPtr attr; /* the attribute */
25362: int n_attr;
25363:
25364: for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25365: for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
25366: for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
25367: mem_base = xmlMemBlocks();
25368: doc = gen_xmlDocPtr(n_doc, 0);
25369: elem = gen_xmlNodePtr(n_elem, 1);
25370: attr = gen_xmlAttrPtr(n_attr, 2);
25371:
25372: ret_val = xmlIsID(doc, elem, attr);
25373: desret_int(ret_val);
25374: call_tests++;
25375: des_xmlDocPtr(n_doc, doc, 0);
25376: des_xmlNodePtr(n_elem, elem, 1);
25377: des_xmlAttrPtr(n_attr, attr, 2);
25378: xmlResetLastError();
25379: if (mem_base != xmlMemBlocks()) {
25380: printf("Leak of %d blocks found in xmlIsID",
25381: xmlMemBlocks() - mem_base);
25382: test_ret++;
25383: printf(" %d", n_doc);
25384: printf(" %d", n_elem);
25385: printf(" %d", n_attr);
25386: printf("\n");
25387: }
25388: }
25389: }
25390: }
25391: function_tests++;
25392:
25393: return(test_ret);
25394: }
25395:
25396:
25397: static int
25398: test_xmlIsMixedElement(void) {
25399: int test_ret = 0;
25400:
25401: int mem_base;
25402: int ret_val;
25403: xmlDocPtr doc; /* the document */
25404: int n_doc;
25405: xmlChar * name; /* the element name */
25406: int n_name;
25407:
25408: for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25409: for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25410: mem_base = xmlMemBlocks();
25411: doc = gen_xmlDocPtr(n_doc, 0);
25412: name = gen_const_xmlChar_ptr(n_name, 1);
25413:
25414: ret_val = xmlIsMixedElement(doc, (const xmlChar *)name);
25415: desret_int(ret_val);
25416: call_tests++;
25417: des_xmlDocPtr(n_doc, doc, 0);
25418: des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
25419: xmlResetLastError();
25420: if (mem_base != xmlMemBlocks()) {
25421: printf("Leak of %d blocks found in xmlIsMixedElement",
25422: xmlMemBlocks() - mem_base);
25423: test_ret++;
25424: printf(" %d", n_doc);
25425: printf(" %d", n_name);
25426: printf("\n");
25427: }
25428: }
25429: }
25430: function_tests++;
25431:
25432: return(test_ret);
25433: }
25434:
25435:
25436: static int
25437: test_xmlIsRef(void) {
25438: int test_ret = 0;
25439:
25440: int mem_base;
25441: int ret_val;
25442: xmlDocPtr doc; /* the document */
25443: int n_doc;
25444: xmlNodePtr elem; /* the element carrying the attribute */
25445: int n_elem;
25446: xmlAttrPtr attr; /* the attribute */
25447: int n_attr;
25448:
25449: for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25450: for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
25451: for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
25452: mem_base = xmlMemBlocks();
25453: doc = gen_xmlDocPtr(n_doc, 0);
25454: elem = gen_xmlNodePtr(n_elem, 1);
25455: attr = gen_xmlAttrPtr(n_attr, 2);
25456:
25457: ret_val = xmlIsRef(doc, elem, attr);
25458: desret_int(ret_val);
25459: call_tests++;
25460: des_xmlDocPtr(n_doc, doc, 0);
25461: des_xmlNodePtr(n_elem, elem, 1);
25462: des_xmlAttrPtr(n_attr, attr, 2);
25463: xmlResetLastError();
25464: if (mem_base != xmlMemBlocks()) {
25465: printf("Leak of %d blocks found in xmlIsRef",
25466: xmlMemBlocks() - mem_base);
25467: test_ret++;
25468: printf(" %d", n_doc);
25469: printf(" %d", n_elem);
25470: printf(" %d", n_attr);
25471: printf("\n");
25472: }
25473: }
25474: }
25475: }
25476: function_tests++;
25477:
25478: return(test_ret);
25479: }
25480:
25481:
25482: static int
25483: test_xmlNewDocElementContent(void) {
25484: int test_ret = 0;
25485:
25486: int mem_base;
25487: xmlElementContentPtr ret_val;
25488: xmlDocPtr doc; /* the document */
25489: int n_doc;
25490: xmlChar * name; /* the subelement name or NULL */
25491: int n_name;
25492: xmlElementContentType type; /* the type of element content decl */
25493: int n_type;
25494:
25495: for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25496: for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25497: for (n_type = 0;n_type < gen_nb_xmlElementContentType;n_type++) {
25498: mem_base = xmlMemBlocks();
25499: doc = gen_xmlDocPtr(n_doc, 0);
25500: name = gen_const_xmlChar_ptr(n_name, 1);
25501: type = gen_xmlElementContentType(n_type, 2);
25502:
25503: ret_val = xmlNewDocElementContent(doc, (const xmlChar *)name, type);
25504: xmlFreeDocElementContent(doc, ret_val); ret_val = NULL;
25505: desret_xmlElementContentPtr(ret_val);
25506: call_tests++;
25507: des_xmlDocPtr(n_doc, doc, 0);
25508: des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
25509: des_xmlElementContentType(n_type, type, 2);
25510: xmlResetLastError();
25511: if (mem_base != xmlMemBlocks()) {
25512: printf("Leak of %d blocks found in xmlNewDocElementContent",
25513: xmlMemBlocks() - mem_base);
25514: test_ret++;
25515: printf(" %d", n_doc);
25516: printf(" %d", n_name);
25517: printf(" %d", n_type);
25518: printf("\n");
25519: }
25520: }
25521: }
25522: }
25523: function_tests++;
25524:
25525: return(test_ret);
25526: }
25527:
25528:
25529: static int
25530: test_xmlNewElementContent(void) {
25531: int test_ret = 0;
25532:
25533: int mem_base;
25534: xmlElementContentPtr ret_val;
25535: xmlChar * name; /* the subelement name or NULL */
25536: int n_name;
25537: xmlElementContentType type; /* the type of element content decl */
25538: int n_type;
25539:
25540: for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25541: for (n_type = 0;n_type < gen_nb_xmlElementContentType;n_type++) {
25542: mem_base = xmlMemBlocks();
25543: name = gen_const_xmlChar_ptr(n_name, 0);
25544: type = gen_xmlElementContentType(n_type, 1);
25545:
25546: ret_val = xmlNewElementContent((const xmlChar *)name, type);
25547: desret_xmlElementContentPtr(ret_val);
25548: call_tests++;
25549: des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
25550: des_xmlElementContentType(n_type, type, 1);
25551: xmlResetLastError();
25552: if (mem_base != xmlMemBlocks()) {
25553: printf("Leak of %d blocks found in xmlNewElementContent",
25554: xmlMemBlocks() - mem_base);
25555: test_ret++;
25556: printf(" %d", n_name);
25557: printf(" %d", n_type);
25558: printf("\n");
25559: }
25560: }
25561: }
25562: function_tests++;
25563:
25564: return(test_ret);
25565: }
25566:
25567:
25568: static int
25569: test_xmlNewValidCtxt(void) {
25570: int test_ret = 0;
25571:
25572:
25573: /* missing type support */
25574: return(test_ret);
25575: }
25576:
25577:
25578: static int
25579: test_xmlRemoveID(void) {
25580: int test_ret = 0;
25581:
25582: int mem_base;
25583: int ret_val;
25584: xmlDocPtr doc; /* the document */
25585: int n_doc;
25586: xmlAttrPtr attr; /* the attribute */
25587: int n_attr;
25588:
25589: for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25590: for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
25591: mem_base = xmlMemBlocks();
25592: doc = gen_xmlDocPtr(n_doc, 0);
25593: attr = gen_xmlAttrPtr(n_attr, 1);
25594:
25595: ret_val = xmlRemoveID(doc, attr);
25596: desret_int(ret_val);
25597: call_tests++;
25598: des_xmlDocPtr(n_doc, doc, 0);
25599: des_xmlAttrPtr(n_attr, attr, 1);
25600: xmlResetLastError();
25601: if (mem_base != xmlMemBlocks()) {
25602: printf("Leak of %d blocks found in xmlRemoveID",
25603: xmlMemBlocks() - mem_base);
25604: test_ret++;
25605: printf(" %d", n_doc);
25606: printf(" %d", n_attr);
25607: printf("\n");
25608: }
25609: }
25610: }
25611: function_tests++;
25612:
25613: return(test_ret);
25614: }
25615:
25616:
25617: static int
25618: test_xmlRemoveRef(void) {
25619: int test_ret = 0;
25620:
25621: int mem_base;
25622: int ret_val;
25623: xmlDocPtr doc; /* the document */
25624: int n_doc;
25625: xmlAttrPtr attr; /* the attribute */
25626: int n_attr;
25627:
25628: for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25629: for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
25630: mem_base = xmlMemBlocks();
25631: doc = gen_xmlDocPtr(n_doc, 0);
25632: attr = gen_xmlAttrPtr(n_attr, 1);
25633:
25634: ret_val = xmlRemoveRef(doc, attr);
25635: desret_int(ret_val);
25636: call_tests++;
25637: des_xmlDocPtr(n_doc, doc, 0);
25638: des_xmlAttrPtr(n_attr, attr, 1);
25639: xmlResetLastError();
25640: if (mem_base != xmlMemBlocks()) {
25641: printf("Leak of %d blocks found in xmlRemoveRef",
25642: xmlMemBlocks() - mem_base);
25643: test_ret++;
25644: printf(" %d", n_doc);
25645: printf(" %d", n_attr);
25646: printf("\n");
25647: }
25648: }
25649: }
25650: function_tests++;
25651:
25652: return(test_ret);
25653: }
25654:
25655:
25656: static int
25657: test_xmlSnprintfElementContent(void) {
25658: int test_ret = 0;
25659:
25660: int mem_base;
25661: char * buf; /* an output buffer */
25662: int n_buf;
25663: int size; /* the buffer size */
25664: int n_size;
25665: xmlElementContentPtr content; /* An element table */
25666: int n_content;
25667: int englob; /* 1 if one must print the englobing parenthesis, 0 otherwise */
25668: int n_englob;
25669:
25670: for (n_buf = 0;n_buf < gen_nb_char_ptr;n_buf++) {
25671: for (n_size = 0;n_size < gen_nb_int;n_size++) {
25672: for (n_content = 0;n_content < gen_nb_xmlElementContentPtr;n_content++) {
25673: for (n_englob = 0;n_englob < gen_nb_int;n_englob++) {
25674: mem_base = xmlMemBlocks();
25675: buf = gen_char_ptr(n_buf, 0);
25676: size = gen_int(n_size, 1);
25677: content = gen_xmlElementContentPtr(n_content, 2);
25678: englob = gen_int(n_englob, 3);
25679:
25680: xmlSnprintfElementContent(buf, size, content, englob);
25681: call_tests++;
25682: des_char_ptr(n_buf, buf, 0);
25683: des_int(n_size, size, 1);
25684: des_xmlElementContentPtr(n_content, content, 2);
25685: des_int(n_englob, englob, 3);
25686: xmlResetLastError();
25687: if (mem_base != xmlMemBlocks()) {
25688: printf("Leak of %d blocks found in xmlSnprintfElementContent",
25689: xmlMemBlocks() - mem_base);
25690: test_ret++;
25691: printf(" %d", n_buf);
25692: printf(" %d", n_size);
25693: printf(" %d", n_content);
25694: printf(" %d", n_englob);
25695: printf("\n");
25696: }
25697: }
25698: }
25699: }
25700: }
25701: function_tests++;
25702:
25703: return(test_ret);
25704: }
25705:
25706:
25707: static int
25708: test_xmlSprintfElementContent(void) {
25709: int test_ret = 0;
25710:
25711: #if defined(LIBXML_OUTPUT_ENABLED)
25712: #ifdef LIBXML_OUTPUT_ENABLED
25713: int mem_base;
25714: char * buf; /* an output buffer */
25715: int n_buf;
25716: xmlElementContentPtr content; /* An element table */
25717: int n_content;
25718: int englob; /* 1 if one must print the englobing parenthesis, 0 otherwise */
25719: int n_englob;
25720:
25721: for (n_buf = 0;n_buf < gen_nb_char_ptr;n_buf++) {
25722: for (n_content = 0;n_content < gen_nb_xmlElementContentPtr;n_content++) {
25723: for (n_englob = 0;n_englob < gen_nb_int;n_englob++) {
25724: mem_base = xmlMemBlocks();
25725: buf = gen_char_ptr(n_buf, 0);
25726: content = gen_xmlElementContentPtr(n_content, 1);
25727: englob = gen_int(n_englob, 2);
25728:
25729: xmlSprintfElementContent(buf, content, englob);
25730: call_tests++;
25731: des_char_ptr(n_buf, buf, 0);
25732: des_xmlElementContentPtr(n_content, content, 1);
25733: des_int(n_englob, englob, 2);
25734: xmlResetLastError();
25735: if (mem_base != xmlMemBlocks()) {
25736: printf("Leak of %d blocks found in xmlSprintfElementContent",
25737: xmlMemBlocks() - mem_base);
25738: test_ret++;
25739: printf(" %d", n_buf);
25740: printf(" %d", n_content);
25741: printf(" %d", n_englob);
25742: printf("\n");
25743: }
25744: }
25745: }
25746: }
25747: function_tests++;
25748: #endif
25749: #endif
25750:
25751: return(test_ret);
25752: }
25753:
25754:
25755: static int
25756: test_xmlValidBuildContentModel(void) {
25757: int test_ret = 0;
25758:
25759: #if defined(LIBXML_VALID_ENABLED) && defined(LIBXML_REGEXP_ENABLED)
25760: int mem_base;
25761: int ret_val;
25762: xmlValidCtxtPtr ctxt; /* a validation context */
25763: int n_ctxt;
25764: xmlElementPtr elem; /* an element declaration node */
25765: int n_elem;
25766:
25767: for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
25768: for (n_elem = 0;n_elem < gen_nb_xmlElementPtr;n_elem++) {
25769: mem_base = xmlMemBlocks();
25770: ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
25771: elem = gen_xmlElementPtr(n_elem, 1);
25772:
25773: ret_val = xmlValidBuildContentModel(ctxt, elem);
25774: desret_int(ret_val);
25775: call_tests++;
25776: des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
25777: des_xmlElementPtr(n_elem, elem, 1);
25778: xmlResetLastError();
25779: if (mem_base != xmlMemBlocks()) {
25780: printf("Leak of %d blocks found in xmlValidBuildContentModel",
25781: xmlMemBlocks() - mem_base);
25782: test_ret++;
25783: printf(" %d", n_ctxt);
25784: printf(" %d", n_elem);
25785: printf("\n");
25786: }
25787: }
25788: }
25789: function_tests++;
25790: #endif
25791:
25792: return(test_ret);
25793: }
25794:
25795:
25796: static int
25797: test_xmlValidCtxtNormalizeAttributeValue(void) {
25798: int test_ret = 0;
25799:
25800: #if defined(LIBXML_VALID_ENABLED)
25801: int mem_base;
25802: xmlChar * ret_val;
25803: xmlValidCtxtPtr ctxt; /* the validation context or NULL */
25804: int n_ctxt;
25805: xmlDocPtr doc; /* the document */
25806: int n_doc;
25807: xmlNodePtr elem; /* the parent */
25808: int n_elem;
25809: xmlChar * name; /* the attribute name */
25810: int n_name;
25811: xmlChar * value; /* the attribute value */
25812: int n_value;
25813:
25814: for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
25815: for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25816: for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
25817: for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25818: for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
25819: mem_base = xmlMemBlocks();
25820: ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
25821: doc = gen_xmlDocPtr(n_doc, 1);
25822: elem = gen_xmlNodePtr(n_elem, 2);
25823: name = gen_const_xmlChar_ptr(n_name, 3);
25824: value = gen_const_xmlChar_ptr(n_value, 4);
25825:
25826: ret_val = xmlValidCtxtNormalizeAttributeValue(ctxt, doc, elem, (const xmlChar *)name, (const xmlChar *)value);
25827: desret_xmlChar_ptr(ret_val);
25828: call_tests++;
25829: des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
25830: des_xmlDocPtr(n_doc, doc, 1);
25831: des_xmlNodePtr(n_elem, elem, 2);
25832: des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 3);
25833: des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 4);
25834: xmlResetLastError();
25835: if (mem_base != xmlMemBlocks()) {
25836: printf("Leak of %d blocks found in xmlValidCtxtNormalizeAttributeValue",
25837: xmlMemBlocks() - mem_base);
25838: test_ret++;
25839: printf(" %d", n_ctxt);
25840: printf(" %d", n_doc);
25841: printf(" %d", n_elem);
25842: printf(" %d", n_name);
25843: printf(" %d", n_value);
25844: printf("\n");
25845: }
25846: }
25847: }
25848: }
25849: }
25850: }
25851: function_tests++;
25852: #endif
25853:
25854: return(test_ret);
25855: }
25856:
25857:
25858: #define gen_nb_xmlElementContent_ptr 1
25859: static xmlElementContent * gen_xmlElementContent_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25860: return(NULL);
25861: }
25862: static void des_xmlElementContent_ptr(int no ATTRIBUTE_UNUSED, xmlElementContent * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25863: }
25864:
25865: static int
25866: test_xmlValidGetPotentialChildren(void) {
25867: int test_ret = 0;
25868:
25869: #if defined(LIBXML_VALID_ENABLED)
25870: #ifdef LIBXML_VALID_ENABLED
25871: int mem_base;
25872: int ret_val;
25873: xmlElementContent * ctree; /* an element content tree */
25874: int n_ctree;
25875: xmlChar ** names; /* an array to store the list of child names */
25876: int n_names;
25877: int * len; /* a pointer to the number of element in the list */
25878: int n_len;
25879: int max; /* the size of the array */
25880: int n_max;
25881:
25882: for (n_ctree = 0;n_ctree < gen_nb_xmlElementContent_ptr;n_ctree++) {
25883: for (n_names = 0;n_names < gen_nb_const_xmlChar_ptr_ptr;n_names++) {
25884: for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
25885: for (n_max = 0;n_max < gen_nb_int;n_max++) {
25886: mem_base = xmlMemBlocks();
25887: ctree = gen_xmlElementContent_ptr(n_ctree, 0);
25888: names = gen_const_xmlChar_ptr_ptr(n_names, 1);
25889: len = gen_int_ptr(n_len, 2);
25890: max = gen_int(n_max, 3);
25891:
25892: ret_val = xmlValidGetPotentialChildren(ctree, (const xmlChar **)names, len, max);
25893: desret_int(ret_val);
25894: call_tests++;
25895: des_xmlElementContent_ptr(n_ctree, ctree, 0);
25896: des_const_xmlChar_ptr_ptr(n_names, (const xmlChar **)names, 1);
25897: des_int_ptr(n_len, len, 2);
25898: des_int(n_max, max, 3);
25899: xmlResetLastError();
25900: if (mem_base != xmlMemBlocks()) {
25901: printf("Leak of %d blocks found in xmlValidGetPotentialChildren",
25902: xmlMemBlocks() - mem_base);
25903: test_ret++;
25904: printf(" %d", n_ctree);
25905: printf(" %d", n_names);
25906: printf(" %d", n_len);
25907: printf(" %d", n_max);
25908: printf("\n");
25909: }
25910: }
25911: }
25912: }
25913: }
25914: function_tests++;
25915: #endif
25916: #endif
25917:
25918: return(test_ret);
25919: }
25920:
25921:
25922: static int
25923: test_xmlValidGetValidElements(void) {
25924: int test_ret = 0;
25925:
25926: #if defined(LIBXML_VALID_ENABLED)
25927: #ifdef LIBXML_VALID_ENABLED
25928: int mem_base;
25929: int ret_val;
25930: xmlNode * prev; /* an element to insert after */
25931: int n_prev;
25932: xmlNode * next; /* an element to insert next */
25933: int n_next;
25934: xmlChar ** names; /* an array to store the list of child names */
25935: int n_names;
25936: int max; /* the size of the array */
25937: int n_max;
25938:
25939: for (n_prev = 0;n_prev < gen_nb_xmlNodePtr;n_prev++) {
25940: for (n_next = 0;n_next < gen_nb_xmlNodePtr;n_next++) {
25941: for (n_names = 0;n_names < gen_nb_const_xmlChar_ptr_ptr;n_names++) {
25942: for (n_max = 0;n_max < gen_nb_int;n_max++) {
25943: mem_base = xmlMemBlocks();
25944: prev = gen_xmlNodePtr(n_prev, 0);
25945: next = gen_xmlNodePtr(n_next, 1);
25946: names = gen_const_xmlChar_ptr_ptr(n_names, 2);
25947: max = gen_int(n_max, 3);
25948:
25949: ret_val = xmlValidGetValidElements(prev, next, (const xmlChar **)names, max);
25950: desret_int(ret_val);
25951: call_tests++;
25952: des_xmlNodePtr(n_prev, prev, 0);
25953: des_xmlNodePtr(n_next, next, 1);
25954: des_const_xmlChar_ptr_ptr(n_names, (const xmlChar **)names, 2);
25955: des_int(n_max, max, 3);
25956: xmlResetLastError();
25957: if (mem_base != xmlMemBlocks()) {
25958: printf("Leak of %d blocks found in xmlValidGetValidElements",
25959: xmlMemBlocks() - mem_base);
25960: test_ret++;
25961: printf(" %d", n_prev);
25962: printf(" %d", n_next);
25963: printf(" %d", n_names);
25964: printf(" %d", n_max);
25965: printf("\n");
25966: }
25967: }
25968: }
25969: }
25970: }
25971: function_tests++;
25972: #endif
25973: #endif
25974:
25975: return(test_ret);
25976: }
25977:
25978:
25979: static int
25980: test_xmlValidNormalizeAttributeValue(void) {
25981: int test_ret = 0;
25982:
25983: #if defined(LIBXML_VALID_ENABLED)
25984: int mem_base;
25985: xmlChar * ret_val;
25986: xmlDocPtr doc; /* the document */
25987: int n_doc;
25988: xmlNodePtr elem; /* the parent */
25989: int n_elem;
25990: xmlChar * name; /* the attribute name */
25991: int n_name;
25992: xmlChar * value; /* the attribute value */
25993: int n_value;
25994:
25995: for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25996: for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
25997: for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25998: for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
25999: mem_base = xmlMemBlocks();
26000: doc = gen_xmlDocPtr(n_doc, 0);
26001: elem = gen_xmlNodePtr(n_elem, 1);
26002: name = gen_const_xmlChar_ptr(n_name, 2);
26003: value = gen_const_xmlChar_ptr(n_value, 3);
26004:
26005: ret_val = xmlValidNormalizeAttributeValue(doc, elem, (const xmlChar *)name, (const xmlChar *)value);
26006: desret_xmlChar_ptr(ret_val);
26007: call_tests++;
26008: des_xmlDocPtr(n_doc, doc, 0);
26009: des_xmlNodePtr(n_elem, elem, 1);
26010: des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
26011: des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
26012: xmlResetLastError();
26013: if (mem_base != xmlMemBlocks()) {
26014: printf("Leak of %d blocks found in xmlValidNormalizeAttributeValue",
26015: xmlMemBlocks() - mem_base);
26016: test_ret++;
26017: printf(" %d", n_doc);
26018: printf(" %d", n_elem);
26019: printf(" %d", n_name);
26020: printf(" %d", n_value);
26021: printf("\n");
26022: }
26023: }
26024: }
26025: }
26026: }
26027: function_tests++;
26028: #endif
26029:
26030: return(test_ret);
26031: }
26032:
26033:
26034: static int
26035: test_xmlValidateAttributeDecl(void) {
26036: int test_ret = 0;
26037:
26038: #if defined(LIBXML_VALID_ENABLED)
26039: int mem_base;
26040: int ret_val;
26041: xmlValidCtxtPtr ctxt; /* the validation context */
26042: int n_ctxt;
26043: xmlDocPtr doc; /* a document instance */
26044: int n_doc;
26045: xmlAttributePtr attr; /* an attribute definition */
26046: int n_attr;
26047:
26048: for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26049: for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26050: for (n_attr = 0;n_attr < gen_nb_xmlAttributePtr;n_attr++) {
26051: mem_base = xmlMemBlocks();
26052: ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26053: doc = gen_xmlDocPtr(n_doc, 1);
26054: attr = gen_xmlAttributePtr(n_attr, 2);
26055:
26056: ret_val = xmlValidateAttributeDecl(ctxt, doc, attr);
26057: desret_int(ret_val);
26058: call_tests++;
26059: des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26060: des_xmlDocPtr(n_doc, doc, 1);
26061: des_xmlAttributePtr(n_attr, attr, 2);
26062: xmlResetLastError();
26063: if (mem_base != xmlMemBlocks()) {
26064: printf("Leak of %d blocks found in xmlValidateAttributeDecl",
26065: xmlMemBlocks() - mem_base);
26066: test_ret++;
26067: printf(" %d", n_ctxt);
26068: printf(" %d", n_doc);
26069: printf(" %d", n_attr);
26070: printf("\n");
26071: }
26072: }
26073: }
26074: }
26075: function_tests++;
26076: #endif
26077:
26078: return(test_ret);
26079: }
26080:
26081:
26082: static int
26083: test_xmlValidateAttributeValue(void) {
26084: int test_ret = 0;
26085:
26086: #if defined(LIBXML_VALID_ENABLED)
26087: int mem_base;
26088: int ret_val;
26089: xmlAttributeType type; /* an attribute type */
26090: int n_type;
26091: xmlChar * value; /* an attribute value */
26092: int n_value;
26093:
26094: for (n_type = 0;n_type < gen_nb_xmlAttributeType;n_type++) {
26095: for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26096: mem_base = xmlMemBlocks();
26097: type = gen_xmlAttributeType(n_type, 0);
26098: value = gen_const_xmlChar_ptr(n_value, 1);
26099:
26100: ret_val = xmlValidateAttributeValue(type, (const xmlChar *)value);
26101: desret_int(ret_val);
26102: call_tests++;
26103: des_xmlAttributeType(n_type, type, 0);
26104: des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
26105: xmlResetLastError();
26106: if (mem_base != xmlMemBlocks()) {
26107: printf("Leak of %d blocks found in xmlValidateAttributeValue",
26108: xmlMemBlocks() - mem_base);
26109: test_ret++;
26110: printf(" %d", n_type);
26111: printf(" %d", n_value);
26112: printf("\n");
26113: }
26114: }
26115: }
26116: function_tests++;
26117: #endif
26118:
26119: return(test_ret);
26120: }
26121:
26122:
26123: static int
26124: test_xmlValidateDocument(void) {
26125: int test_ret = 0;
26126:
26127: #if defined(LIBXML_VALID_ENABLED)
26128: int mem_base;
26129: int ret_val;
26130: xmlValidCtxtPtr ctxt; /* the validation context */
26131: int n_ctxt;
26132: xmlDocPtr doc; /* a document instance */
26133: int n_doc;
26134:
26135: for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26136: for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26137: mem_base = xmlMemBlocks();
26138: ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26139: doc = gen_xmlDocPtr(n_doc, 1);
26140:
26141: ret_val = xmlValidateDocument(ctxt, doc);
26142: desret_int(ret_val);
26143: call_tests++;
26144: des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26145: des_xmlDocPtr(n_doc, doc, 1);
26146: xmlResetLastError();
26147: if (mem_base != xmlMemBlocks()) {
26148: printf("Leak of %d blocks found in xmlValidateDocument",
26149: xmlMemBlocks() - mem_base);
26150: test_ret++;
26151: printf(" %d", n_ctxt);
26152: printf(" %d", n_doc);
26153: printf("\n");
26154: }
26155: }
26156: }
26157: function_tests++;
26158: #endif
26159:
26160: return(test_ret);
26161: }
26162:
26163:
26164: static int
26165: test_xmlValidateDocumentFinal(void) {
26166: int test_ret = 0;
26167:
26168: #if defined(LIBXML_VALID_ENABLED)
26169: int mem_base;
26170: int ret_val;
26171: xmlValidCtxtPtr ctxt; /* the validation context */
26172: int n_ctxt;
26173: xmlDocPtr doc; /* a document instance */
26174: int n_doc;
26175:
26176: for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26177: for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26178: mem_base = xmlMemBlocks();
26179: ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26180: doc = gen_xmlDocPtr(n_doc, 1);
26181:
26182: ret_val = xmlValidateDocumentFinal(ctxt, doc);
26183: desret_int(ret_val);
26184: call_tests++;
26185: des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26186: des_xmlDocPtr(n_doc, doc, 1);
26187: xmlResetLastError();
26188: if (mem_base != xmlMemBlocks()) {
26189: printf("Leak of %d blocks found in xmlValidateDocumentFinal",
26190: xmlMemBlocks() - mem_base);
26191: test_ret++;
26192: printf(" %d", n_ctxt);
26193: printf(" %d", n_doc);
26194: printf("\n");
26195: }
26196: }
26197: }
26198: function_tests++;
26199: #endif
26200:
26201: return(test_ret);
26202: }
26203:
26204:
26205: static int
26206: test_xmlValidateDtd(void) {
26207: int test_ret = 0;
26208:
26209: #if defined(LIBXML_VALID_ENABLED)
26210: int mem_base;
26211: int ret_val;
26212: xmlValidCtxtPtr ctxt; /* the validation context */
26213: int n_ctxt;
26214: xmlDocPtr doc; /* a document instance */
26215: int n_doc;
26216: xmlDtdPtr dtd; /* a dtd instance */
26217: int n_dtd;
26218:
26219: for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26220: for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26221: for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
26222: mem_base = xmlMemBlocks();
26223: ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26224: doc = gen_xmlDocPtr(n_doc, 1);
26225: dtd = gen_xmlDtdPtr(n_dtd, 2);
26226:
26227: ret_val = xmlValidateDtd(ctxt, doc, dtd);
26228: desret_int(ret_val);
26229: call_tests++;
26230: des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26231: des_xmlDocPtr(n_doc, doc, 1);
26232: des_xmlDtdPtr(n_dtd, dtd, 2);
26233: xmlResetLastError();
26234: if (mem_base != xmlMemBlocks()) {
26235: printf("Leak of %d blocks found in xmlValidateDtd",
26236: xmlMemBlocks() - mem_base);
26237: test_ret++;
26238: printf(" %d", n_ctxt);
26239: printf(" %d", n_doc);
26240: printf(" %d", n_dtd);
26241: printf("\n");
26242: }
26243: }
26244: }
26245: }
26246: function_tests++;
26247: #endif
26248:
26249: return(test_ret);
26250: }
26251:
26252:
26253: static int
26254: test_xmlValidateDtdFinal(void) {
26255: int test_ret = 0;
26256:
26257: #if defined(LIBXML_VALID_ENABLED)
26258: int mem_base;
26259: int ret_val;
26260: xmlValidCtxtPtr ctxt; /* the validation context */
26261: int n_ctxt;
26262: xmlDocPtr doc; /* a document instance */
26263: int n_doc;
26264:
26265: for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26266: for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26267: mem_base = xmlMemBlocks();
26268: ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26269: doc = gen_xmlDocPtr(n_doc, 1);
26270:
26271: ret_val = xmlValidateDtdFinal(ctxt, doc);
26272: desret_int(ret_val);
26273: call_tests++;
26274: des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26275: des_xmlDocPtr(n_doc, doc, 1);
26276: xmlResetLastError();
26277: if (mem_base != xmlMemBlocks()) {
26278: printf("Leak of %d blocks found in xmlValidateDtdFinal",
26279: xmlMemBlocks() - mem_base);
26280: test_ret++;
26281: printf(" %d", n_ctxt);
26282: printf(" %d", n_doc);
26283: printf("\n");
26284: }
26285: }
26286: }
26287: function_tests++;
26288: #endif
26289:
26290: return(test_ret);
26291: }
26292:
26293:
26294: static int
26295: test_xmlValidateElement(void) {
26296: int test_ret = 0;
26297:
26298: #if defined(LIBXML_VALID_ENABLED)
26299: int mem_base;
26300: int ret_val;
26301: xmlValidCtxtPtr ctxt; /* the validation context */
26302: int n_ctxt;
26303: xmlDocPtr doc; /* a document instance */
26304: int n_doc;
26305: xmlNodePtr elem; /* an element instance */
26306: int n_elem;
26307:
26308: for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26309: for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26310: for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26311: mem_base = xmlMemBlocks();
26312: ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26313: doc = gen_xmlDocPtr(n_doc, 1);
26314: elem = gen_xmlNodePtr(n_elem, 2);
26315:
26316: ret_val = xmlValidateElement(ctxt, doc, elem);
26317: desret_int(ret_val);
26318: call_tests++;
26319: des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26320: des_xmlDocPtr(n_doc, doc, 1);
26321: des_xmlNodePtr(n_elem, elem, 2);
26322: xmlResetLastError();
26323: if (mem_base != xmlMemBlocks()) {
26324: printf("Leak of %d blocks found in xmlValidateElement",
26325: xmlMemBlocks() - mem_base);
26326: test_ret++;
26327: printf(" %d", n_ctxt);
26328: printf(" %d", n_doc);
26329: printf(" %d", n_elem);
26330: printf("\n");
26331: }
26332: }
26333: }
26334: }
26335: function_tests++;
26336: #endif
26337:
26338: return(test_ret);
26339: }
26340:
26341:
26342: static int
26343: test_xmlValidateElementDecl(void) {
26344: int test_ret = 0;
26345:
26346: #if defined(LIBXML_VALID_ENABLED)
26347: int mem_base;
26348: int ret_val;
26349: xmlValidCtxtPtr ctxt; /* the validation context */
26350: int n_ctxt;
26351: xmlDocPtr doc; /* a document instance */
26352: int n_doc;
26353: xmlElementPtr elem; /* an element definition */
26354: int n_elem;
26355:
26356: for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26357: for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26358: for (n_elem = 0;n_elem < gen_nb_xmlElementPtr;n_elem++) {
26359: mem_base = xmlMemBlocks();
26360: ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26361: doc = gen_xmlDocPtr(n_doc, 1);
26362: elem = gen_xmlElementPtr(n_elem, 2);
26363:
26364: ret_val = xmlValidateElementDecl(ctxt, doc, elem);
26365: desret_int(ret_val);
26366: call_tests++;
26367: des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26368: des_xmlDocPtr(n_doc, doc, 1);
26369: des_xmlElementPtr(n_elem, elem, 2);
26370: xmlResetLastError();
26371: if (mem_base != xmlMemBlocks()) {
26372: printf("Leak of %d blocks found in xmlValidateElementDecl",
26373: xmlMemBlocks() - mem_base);
26374: test_ret++;
26375: printf(" %d", n_ctxt);
26376: printf(" %d", n_doc);
26377: printf(" %d", n_elem);
26378: printf("\n");
26379: }
26380: }
26381: }
26382: }
26383: function_tests++;
26384: #endif
26385:
26386: return(test_ret);
26387: }
26388:
26389:
26390: static int
26391: test_xmlValidateNameValue(void) {
26392: int test_ret = 0;
26393:
26394: #if defined(LIBXML_VALID_ENABLED)
26395: int mem_base;
26396: int ret_val;
26397: xmlChar * value; /* an Name value */
26398: int n_value;
26399:
26400: for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26401: mem_base = xmlMemBlocks();
26402: value = gen_const_xmlChar_ptr(n_value, 0);
26403:
26404: ret_val = xmlValidateNameValue((const xmlChar *)value);
26405: desret_int(ret_val);
26406: call_tests++;
26407: des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
26408: xmlResetLastError();
26409: if (mem_base != xmlMemBlocks()) {
26410: printf("Leak of %d blocks found in xmlValidateNameValue",
26411: xmlMemBlocks() - mem_base);
26412: test_ret++;
26413: printf(" %d", n_value);
26414: printf("\n");
26415: }
26416: }
26417: function_tests++;
26418: #endif
26419:
26420: return(test_ret);
26421: }
26422:
26423:
26424: static int
26425: test_xmlValidateNamesValue(void) {
26426: int test_ret = 0;
26427:
26428: #if defined(LIBXML_VALID_ENABLED)
26429: int mem_base;
26430: int ret_val;
26431: xmlChar * value; /* an Names value */
26432: int n_value;
26433:
26434: for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26435: mem_base = xmlMemBlocks();
26436: value = gen_const_xmlChar_ptr(n_value, 0);
26437:
26438: ret_val = xmlValidateNamesValue((const xmlChar *)value);
26439: desret_int(ret_val);
26440: call_tests++;
26441: des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
26442: xmlResetLastError();
26443: if (mem_base != xmlMemBlocks()) {
26444: printf("Leak of %d blocks found in xmlValidateNamesValue",
26445: xmlMemBlocks() - mem_base);
26446: test_ret++;
26447: printf(" %d", n_value);
26448: printf("\n");
26449: }
26450: }
26451: function_tests++;
26452: #endif
26453:
26454: return(test_ret);
26455: }
26456:
26457:
26458: static int
26459: test_xmlValidateNmtokenValue(void) {
26460: int test_ret = 0;
26461:
26462: #if defined(LIBXML_VALID_ENABLED)
26463: int mem_base;
26464: int ret_val;
26465: xmlChar * value; /* an Nmtoken value */
26466: int n_value;
26467:
26468: for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26469: mem_base = xmlMemBlocks();
26470: value = gen_const_xmlChar_ptr(n_value, 0);
26471:
26472: ret_val = xmlValidateNmtokenValue((const xmlChar *)value);
26473: desret_int(ret_val);
26474: call_tests++;
26475: des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
26476: xmlResetLastError();
26477: if (mem_base != xmlMemBlocks()) {
26478: printf("Leak of %d blocks found in xmlValidateNmtokenValue",
26479: xmlMemBlocks() - mem_base);
26480: test_ret++;
26481: printf(" %d", n_value);
26482: printf("\n");
26483: }
26484: }
26485: function_tests++;
26486: #endif
26487:
26488: return(test_ret);
26489: }
26490:
26491:
26492: static int
26493: test_xmlValidateNmtokensValue(void) {
26494: int test_ret = 0;
26495:
26496: #if defined(LIBXML_VALID_ENABLED)
26497: int mem_base;
26498: int ret_val;
26499: xmlChar * value; /* an Nmtokens value */
26500: int n_value;
26501:
26502: for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26503: mem_base = xmlMemBlocks();
26504: value = gen_const_xmlChar_ptr(n_value, 0);
26505:
26506: ret_val = xmlValidateNmtokensValue((const xmlChar *)value);
26507: desret_int(ret_val);
26508: call_tests++;
26509: des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
26510: xmlResetLastError();
26511: if (mem_base != xmlMemBlocks()) {
26512: printf("Leak of %d blocks found in xmlValidateNmtokensValue",
26513: xmlMemBlocks() - mem_base);
26514: test_ret++;
26515: printf(" %d", n_value);
26516: printf("\n");
26517: }
26518: }
26519: function_tests++;
26520: #endif
26521:
26522: return(test_ret);
26523: }
26524:
26525:
26526: static int
26527: test_xmlValidateNotationDecl(void) {
26528: int test_ret = 0;
26529:
26530: #if defined(LIBXML_VALID_ENABLED)
26531: int mem_base;
26532: int ret_val;
26533: xmlValidCtxtPtr ctxt; /* the validation context */
26534: int n_ctxt;
26535: xmlDocPtr doc; /* a document instance */
26536: int n_doc;
26537: xmlNotationPtr nota; /* a notation definition */
26538: int n_nota;
26539:
26540: for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26541: for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26542: for (n_nota = 0;n_nota < gen_nb_xmlNotationPtr;n_nota++) {
26543: mem_base = xmlMemBlocks();
26544: ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26545: doc = gen_xmlDocPtr(n_doc, 1);
26546: nota = gen_xmlNotationPtr(n_nota, 2);
26547:
26548: ret_val = xmlValidateNotationDecl(ctxt, doc, nota);
26549: desret_int(ret_val);
26550: call_tests++;
26551: des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26552: des_xmlDocPtr(n_doc, doc, 1);
26553: des_xmlNotationPtr(n_nota, nota, 2);
26554: xmlResetLastError();
26555: if (mem_base != xmlMemBlocks()) {
26556: printf("Leak of %d blocks found in xmlValidateNotationDecl",
26557: xmlMemBlocks() - mem_base);
26558: test_ret++;
26559: printf(" %d", n_ctxt);
26560: printf(" %d", n_doc);
26561: printf(" %d", n_nota);
26562: printf("\n");
26563: }
26564: }
26565: }
26566: }
26567: function_tests++;
26568: #endif
26569:
26570: return(test_ret);
26571: }
26572:
26573:
26574: static int
26575: test_xmlValidateNotationUse(void) {
26576: int test_ret = 0;
26577:
26578: #if defined(LIBXML_VALID_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
26579: int mem_base;
26580: int ret_val;
26581: xmlValidCtxtPtr ctxt; /* the validation context */
26582: int n_ctxt;
26583: xmlDocPtr doc; /* the document */
26584: int n_doc;
26585: xmlChar * notationName; /* the notation name to check */
26586: int n_notationName;
26587:
26588: for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26589: for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26590: for (n_notationName = 0;n_notationName < gen_nb_const_xmlChar_ptr;n_notationName++) {
26591: mem_base = xmlMemBlocks();
26592: ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26593: doc = gen_xmlDocPtr(n_doc, 1);
26594: notationName = gen_const_xmlChar_ptr(n_notationName, 2);
26595:
26596: ret_val = xmlValidateNotationUse(ctxt, doc, (const xmlChar *)notationName);
26597: desret_int(ret_val);
26598: call_tests++;
26599: des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26600: des_xmlDocPtr(n_doc, doc, 1);
26601: des_const_xmlChar_ptr(n_notationName, (const xmlChar *)notationName, 2);
26602: xmlResetLastError();
26603: if (mem_base != xmlMemBlocks()) {
26604: printf("Leak of %d blocks found in xmlValidateNotationUse",
26605: xmlMemBlocks() - mem_base);
26606: test_ret++;
26607: printf(" %d", n_ctxt);
26608: printf(" %d", n_doc);
26609: printf(" %d", n_notationName);
26610: printf("\n");
26611: }
26612: }
26613: }
26614: }
26615: function_tests++;
26616: #endif
26617:
26618: return(test_ret);
26619: }
26620:
26621:
26622: static int
26623: test_xmlValidateOneAttribute(void) {
26624: int test_ret = 0;
26625:
26626: #if defined(LIBXML_VALID_ENABLED)
26627: int mem_base;
26628: int ret_val;
26629: xmlValidCtxtPtr ctxt; /* the validation context */
26630: int n_ctxt;
26631: xmlDocPtr doc; /* a document instance */
26632: int n_doc;
26633: xmlNodePtr elem; /* an element instance */
26634: int n_elem;
26635: xmlAttrPtr attr; /* an attribute instance */
26636: int n_attr;
26637: xmlChar * value; /* the attribute value (without entities processing) */
26638: int n_value;
26639:
26640: for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26641: for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26642: for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26643: for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
26644: for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26645: mem_base = xmlMemBlocks();
26646: ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26647: doc = gen_xmlDocPtr(n_doc, 1);
26648: elem = gen_xmlNodePtr(n_elem, 2);
26649: attr = gen_xmlAttrPtr(n_attr, 3);
26650: value = gen_const_xmlChar_ptr(n_value, 4);
26651:
26652: ret_val = xmlValidateOneAttribute(ctxt, doc, elem, attr, (const xmlChar *)value);
26653: desret_int(ret_val);
26654: call_tests++;
26655: des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26656: des_xmlDocPtr(n_doc, doc, 1);
26657: des_xmlNodePtr(n_elem, elem, 2);
26658: des_xmlAttrPtr(n_attr, attr, 3);
26659: des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 4);
26660: xmlResetLastError();
26661: if (mem_base != xmlMemBlocks()) {
26662: printf("Leak of %d blocks found in xmlValidateOneAttribute",
26663: xmlMemBlocks() - mem_base);
26664: test_ret++;
26665: printf(" %d", n_ctxt);
26666: printf(" %d", n_doc);
26667: printf(" %d", n_elem);
26668: printf(" %d", n_attr);
26669: printf(" %d", n_value);
26670: printf("\n");
26671: }
26672: }
26673: }
26674: }
26675: }
26676: }
26677: function_tests++;
26678: #endif
26679:
26680: return(test_ret);
26681: }
26682:
26683:
26684: static int
26685: test_xmlValidateOneElement(void) {
26686: int test_ret = 0;
26687:
26688: #if defined(LIBXML_VALID_ENABLED)
26689: int mem_base;
26690: int ret_val;
26691: xmlValidCtxtPtr ctxt; /* the validation context */
26692: int n_ctxt;
26693: xmlDocPtr doc; /* a document instance */
26694: int n_doc;
26695: xmlNodePtr elem; /* an element instance */
26696: int n_elem;
26697:
26698: for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26699: for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26700: for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26701: mem_base = xmlMemBlocks();
26702: ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26703: doc = gen_xmlDocPtr(n_doc, 1);
26704: elem = gen_xmlNodePtr(n_elem, 2);
26705:
26706: ret_val = xmlValidateOneElement(ctxt, doc, elem);
26707: desret_int(ret_val);
26708: call_tests++;
26709: des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26710: des_xmlDocPtr(n_doc, doc, 1);
26711: des_xmlNodePtr(n_elem, elem, 2);
26712: xmlResetLastError();
26713: if (mem_base != xmlMemBlocks()) {
26714: printf("Leak of %d blocks found in xmlValidateOneElement",
26715: xmlMemBlocks() - mem_base);
26716: test_ret++;
26717: printf(" %d", n_ctxt);
26718: printf(" %d", n_doc);
26719: printf(" %d", n_elem);
26720: printf("\n");
26721: }
26722: }
26723: }
26724: }
26725: function_tests++;
26726: #endif
26727:
26728: return(test_ret);
26729: }
26730:
26731:
26732: static int
26733: test_xmlValidateOneNamespace(void) {
26734: int test_ret = 0;
26735:
26736: #if defined(LIBXML_VALID_ENABLED)
26737: int mem_base;
26738: int ret_val;
26739: xmlValidCtxtPtr ctxt; /* the validation context */
26740: int n_ctxt;
26741: xmlDocPtr doc; /* a document instance */
26742: int n_doc;
26743: xmlNodePtr elem; /* an element instance */
26744: int n_elem;
26745: xmlChar * prefix; /* the namespace prefix */
26746: int n_prefix;
26747: xmlNsPtr ns; /* an namespace declaration instance */
26748: int n_ns;
26749: xmlChar * value; /* the attribute value (without entities processing) */
26750: int n_value;
26751:
26752: for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26753: for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26754: for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26755: for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
26756: for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
26757: for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26758: mem_base = xmlMemBlocks();
26759: ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26760: doc = gen_xmlDocPtr(n_doc, 1);
26761: elem = gen_xmlNodePtr(n_elem, 2);
26762: prefix = gen_const_xmlChar_ptr(n_prefix, 3);
26763: ns = gen_xmlNsPtr(n_ns, 4);
26764: value = gen_const_xmlChar_ptr(n_value, 5);
26765:
26766: ret_val = xmlValidateOneNamespace(ctxt, doc, elem, (const xmlChar *)prefix, ns, (const xmlChar *)value);
26767: desret_int(ret_val);
26768: call_tests++;
26769: des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26770: des_xmlDocPtr(n_doc, doc, 1);
26771: des_xmlNodePtr(n_elem, elem, 2);
26772: des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 3);
26773: des_xmlNsPtr(n_ns, ns, 4);
26774: des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 5);
26775: xmlResetLastError();
26776: if (mem_base != xmlMemBlocks()) {
26777: printf("Leak of %d blocks found in xmlValidateOneNamespace",
26778: xmlMemBlocks() - mem_base);
26779: test_ret++;
26780: printf(" %d", n_ctxt);
26781: printf(" %d", n_doc);
26782: printf(" %d", n_elem);
26783: printf(" %d", n_prefix);
26784: printf(" %d", n_ns);
26785: printf(" %d", n_value);
26786: printf("\n");
26787: }
26788: }
26789: }
26790: }
26791: }
26792: }
26793: }
26794: function_tests++;
26795: #endif
26796:
26797: return(test_ret);
26798: }
26799:
26800:
26801: static int
26802: test_xmlValidatePopElement(void) {
26803: int test_ret = 0;
26804:
26805: #if defined(LIBXML_VALID_ENABLED) && defined(LIBXML_REGEXP_ENABLED)
26806: int mem_base;
26807: int ret_val;
26808: xmlValidCtxtPtr ctxt; /* the validation context */
26809: int n_ctxt;
26810: xmlDocPtr doc; /* a document instance */
26811: int n_doc;
26812: xmlNodePtr elem; /* an element instance */
26813: int n_elem;
26814: xmlChar * qname; /* the qualified name as appearing in the serialization */
26815: int n_qname;
26816:
26817: for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26818: for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26819: for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26820: for (n_qname = 0;n_qname < gen_nb_const_xmlChar_ptr;n_qname++) {
26821: mem_base = xmlMemBlocks();
26822: ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26823: doc = gen_xmlDocPtr(n_doc, 1);
26824: elem = gen_xmlNodePtr(n_elem, 2);
26825: qname = gen_const_xmlChar_ptr(n_qname, 3);
26826:
26827: ret_val = xmlValidatePopElement(ctxt, doc, elem, (const xmlChar *)qname);
26828: desret_int(ret_val);
26829: call_tests++;
26830: des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26831: des_xmlDocPtr(n_doc, doc, 1);
26832: des_xmlNodePtr(n_elem, elem, 2);
26833: des_const_xmlChar_ptr(n_qname, (const xmlChar *)qname, 3);
26834: xmlResetLastError();
26835: if (mem_base != xmlMemBlocks()) {
26836: printf("Leak of %d blocks found in xmlValidatePopElement",
26837: xmlMemBlocks() - mem_base);
26838: test_ret++;
26839: printf(" %d", n_ctxt);
26840: printf(" %d", n_doc);
26841: printf(" %d", n_elem);
26842: printf(" %d", n_qname);
26843: printf("\n");
26844: }
26845: }
26846: }
26847: }
26848: }
26849: function_tests++;
26850: #endif
26851:
26852: return(test_ret);
26853: }
26854:
26855:
26856: static int
26857: test_xmlValidatePushCData(void) {
26858: int test_ret = 0;
26859:
26860: #if defined(LIBXML_VALID_ENABLED) && defined(LIBXML_REGEXP_ENABLED)
26861: int mem_base;
26862: int ret_val;
26863: xmlValidCtxtPtr ctxt; /* the validation context */
26864: int n_ctxt;
26865: xmlChar * data; /* some character data read */
26866: int n_data;
26867: int len; /* the lenght of the data */
26868: int n_len;
26869:
26870: for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26871: for (n_data = 0;n_data < gen_nb_const_xmlChar_ptr;n_data++) {
26872: for (n_len = 0;n_len < gen_nb_int;n_len++) {
26873: mem_base = xmlMemBlocks();
26874: ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26875: data = gen_const_xmlChar_ptr(n_data, 1);
26876: len = gen_int(n_len, 2);
26877:
26878: ret_val = xmlValidatePushCData(ctxt, (const xmlChar *)data, len);
26879: desret_int(ret_val);
26880: call_tests++;
26881: des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26882: des_const_xmlChar_ptr(n_data, (const xmlChar *)data, 1);
26883: des_int(n_len, len, 2);
26884: xmlResetLastError();
26885: if (mem_base != xmlMemBlocks()) {
26886: printf("Leak of %d blocks found in xmlValidatePushCData",
26887: xmlMemBlocks() - mem_base);
26888: test_ret++;
26889: printf(" %d", n_ctxt);
26890: printf(" %d", n_data);
26891: printf(" %d", n_len);
26892: printf("\n");
26893: }
26894: }
26895: }
26896: }
26897: function_tests++;
26898: #endif
26899:
26900: return(test_ret);
26901: }
26902:
26903:
26904: static int
26905: test_xmlValidatePushElement(void) {
26906: int test_ret = 0;
26907:
26908: #if defined(LIBXML_VALID_ENABLED) && defined(LIBXML_REGEXP_ENABLED)
26909: int mem_base;
26910: int ret_val;
26911: xmlValidCtxtPtr ctxt; /* the validation context */
26912: int n_ctxt;
26913: xmlDocPtr doc; /* a document instance */
26914: int n_doc;
26915: xmlNodePtr elem; /* an element instance */
26916: int n_elem;
26917: xmlChar * qname; /* the qualified name as appearing in the serialization */
26918: int n_qname;
26919:
26920: for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26921: for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26922: for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26923: for (n_qname = 0;n_qname < gen_nb_const_xmlChar_ptr;n_qname++) {
26924: mem_base = xmlMemBlocks();
26925: ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26926: doc = gen_xmlDocPtr(n_doc, 1);
26927: elem = gen_xmlNodePtr(n_elem, 2);
26928: qname = gen_const_xmlChar_ptr(n_qname, 3);
26929:
26930: ret_val = xmlValidatePushElement(ctxt, doc, elem, (const xmlChar *)qname);
26931: desret_int(ret_val);
26932: call_tests++;
26933: des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26934: des_xmlDocPtr(n_doc, doc, 1);
26935: des_xmlNodePtr(n_elem, elem, 2);
26936: des_const_xmlChar_ptr(n_qname, (const xmlChar *)qname, 3);
26937: xmlResetLastError();
26938: if (mem_base != xmlMemBlocks()) {
26939: printf("Leak of %d blocks found in xmlValidatePushElement",
26940: xmlMemBlocks() - mem_base);
26941: test_ret++;
26942: printf(" %d", n_ctxt);
26943: printf(" %d", n_doc);
26944: printf(" %d", n_elem);
26945: printf(" %d", n_qname);
26946: printf("\n");
26947: }
26948: }
26949: }
26950: }
26951: }
26952: function_tests++;
26953: #endif
26954:
26955: return(test_ret);
26956: }
26957:
26958:
26959: static int
26960: test_xmlValidateRoot(void) {
26961: int test_ret = 0;
26962:
26963: #if defined(LIBXML_VALID_ENABLED)
26964: int mem_base;
26965: int ret_val;
26966: xmlValidCtxtPtr ctxt; /* the validation context */
26967: int n_ctxt;
26968: xmlDocPtr doc; /* a document instance */
26969: int n_doc;
26970:
26971: for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26972: for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26973: mem_base = xmlMemBlocks();
26974: ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26975: doc = gen_xmlDocPtr(n_doc, 1);
26976:
26977: ret_val = xmlValidateRoot(ctxt, doc);
26978: desret_int(ret_val);
26979: call_tests++;
26980: des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26981: des_xmlDocPtr(n_doc, doc, 1);
26982: xmlResetLastError();
26983: if (mem_base != xmlMemBlocks()) {
26984: printf("Leak of %d blocks found in xmlValidateRoot",
26985: xmlMemBlocks() - mem_base);
26986: test_ret++;
26987: printf(" %d", n_ctxt);
26988: printf(" %d", n_doc);
26989: printf("\n");
26990: }
26991: }
26992: }
26993: function_tests++;
26994: #endif
26995:
26996: return(test_ret);
26997: }
26998:
26999: static int
27000: test_valid(void) {
27001: int test_ret = 0;
27002:
27003: if (quiet == 0) printf("Testing valid : 50 of 70 functions ...\n");
27004: test_ret += test_xmlAddAttributeDecl();
27005: test_ret += test_xmlAddElementDecl();
27006: test_ret += test_xmlAddID();
27007: test_ret += test_xmlAddNotationDecl();
27008: test_ret += test_xmlAddRef();
27009: test_ret += test_xmlCopyAttributeTable();
27010: test_ret += test_xmlCopyDocElementContent();
27011: test_ret += test_xmlCopyElementContent();
27012: test_ret += test_xmlCopyElementTable();
27013: test_ret += test_xmlCopyEnumeration();
27014: test_ret += test_xmlCopyNotationTable();
27015: test_ret += test_xmlCreateEnumeration();
27016: test_ret += test_xmlDumpAttributeDecl();
27017: test_ret += test_xmlDumpAttributeTable();
27018: test_ret += test_xmlDumpElementDecl();
27019: test_ret += test_xmlDumpElementTable();
27020: test_ret += test_xmlDumpNotationDecl();
27021: test_ret += test_xmlDumpNotationTable();
27022: test_ret += test_xmlGetDtdAttrDesc();
27023: test_ret += test_xmlGetDtdElementDesc();
27024: test_ret += test_xmlGetDtdNotationDesc();
27025: test_ret += test_xmlGetDtdQAttrDesc();
27026: test_ret += test_xmlGetDtdQElementDesc();
27027: test_ret += test_xmlGetID();
27028: test_ret += test_xmlGetRefs();
27029: test_ret += test_xmlIsID();
27030: test_ret += test_xmlIsMixedElement();
27031: test_ret += test_xmlIsRef();
27032: test_ret += test_xmlNewDocElementContent();
27033: test_ret += test_xmlNewElementContent();
27034: test_ret += test_xmlNewValidCtxt();
27035: test_ret += test_xmlRemoveID();
27036: test_ret += test_xmlRemoveRef();
27037: test_ret += test_xmlSnprintfElementContent();
27038: test_ret += test_xmlSprintfElementContent();
27039: test_ret += test_xmlValidBuildContentModel();
27040: test_ret += test_xmlValidCtxtNormalizeAttributeValue();
27041: test_ret += test_xmlValidGetPotentialChildren();
27042: test_ret += test_xmlValidGetValidElements();
27043: test_ret += test_xmlValidNormalizeAttributeValue();
27044: test_ret += test_xmlValidateAttributeDecl();
27045: test_ret += test_xmlValidateAttributeValue();
27046: test_ret += test_xmlValidateDocument();
27047: test_ret += test_xmlValidateDocumentFinal();
27048: test_ret += test_xmlValidateDtd();
27049: test_ret += test_xmlValidateDtdFinal();
27050: test_ret += test_xmlValidateElement();
27051: test_ret += test_xmlValidateElementDecl();
27052: test_ret += test_xmlValidateNameValue();
27053: test_ret += test_xmlValidateNamesValue();
27054: test_ret += test_xmlValidateNmtokenValue();
27055: test_ret += test_xmlValidateNmtokensValue();
27056: test_ret += test_xmlValidateNotationDecl();
27057: test_ret += test_xmlValidateNotationUse();
27058: test_ret += test_xmlValidateOneAttribute();
27059: test_ret += test_xmlValidateOneElement();
27060: test_ret += test_xmlValidateOneNamespace();
27061: test_ret += test_xmlValidatePopElement();
27062: test_ret += test_xmlValidatePushCData();
27063: test_ret += test_xmlValidatePushElement();
27064: test_ret += test_xmlValidateRoot();
27065:
27066: if (test_ret != 0)
27067: printf("Module valid: %d errors\n", test_ret);
27068: return(test_ret);
27069: }
27070:
27071: static int
27072: test_xmlXIncludeNewContext(void) {
27073: int test_ret = 0;
27074:
27075:
27076: /* missing type support */
27077: return(test_ret);
27078: }
27079:
27080:
27081: static int
27082: test_xmlXIncludeProcess(void) {
27083: int test_ret = 0;
27084:
27085: #if defined(LIBXML_XINCLUDE_ENABLED)
27086: int mem_base;
27087: int ret_val;
27088: xmlDocPtr doc; /* an XML document */
27089: int n_doc;
27090:
27091: for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
27092: mem_base = xmlMemBlocks();
27093: doc = gen_xmlDocPtr(n_doc, 0);
27094:
27095: ret_val = xmlXIncludeProcess(doc);
27096: desret_int(ret_val);
27097: call_tests++;
27098: des_xmlDocPtr(n_doc, doc, 0);
27099: xmlResetLastError();
27100: if (mem_base != xmlMemBlocks()) {
27101: printf("Leak of %d blocks found in xmlXIncludeProcess",
27102: xmlMemBlocks() - mem_base);
27103: test_ret++;
27104: printf(" %d", n_doc);
27105: printf("\n");
27106: }
27107: }
27108: function_tests++;
27109: #endif
27110:
27111: return(test_ret);
27112: }
27113:
27114:
27115: static int
27116: test_xmlXIncludeProcessFlags(void) {
27117: int test_ret = 0;
27118:
27119: #if defined(LIBXML_XINCLUDE_ENABLED)
27120: int mem_base;
27121: int ret_val;
27122: xmlDocPtr doc; /* an XML document */
27123: int n_doc;
27124: int flags; /* a set of xmlParserOption used for parsing XML includes */
27125: int n_flags;
27126:
27127: for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
27128: for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
27129: mem_base = xmlMemBlocks();
27130: doc = gen_xmlDocPtr(n_doc, 0);
27131: flags = gen_int(n_flags, 1);
27132:
27133: ret_val = xmlXIncludeProcessFlags(doc, flags);
27134: desret_int(ret_val);
27135: call_tests++;
27136: des_xmlDocPtr(n_doc, doc, 0);
27137: des_int(n_flags, flags, 1);
27138: xmlResetLastError();
27139: if (mem_base != xmlMemBlocks()) {
27140: printf("Leak of %d blocks found in xmlXIncludeProcessFlags",
27141: xmlMemBlocks() - mem_base);
27142: test_ret++;
27143: printf(" %d", n_doc);
27144: printf(" %d", n_flags);
27145: printf("\n");
27146: }
27147: }
27148: }
27149: function_tests++;
27150: #endif
27151:
27152: return(test_ret);
27153: }
27154:
27155:
27156: static int
27157: test_xmlXIncludeProcessFlagsData(void) {
27158: int test_ret = 0;
27159:
27160: #if defined(LIBXML_XINCLUDE_ENABLED)
27161: int mem_base;
27162: int ret_val;
27163: xmlDocPtr doc; /* an XML document */
27164: int n_doc;
27165: int flags; /* a set of xmlParserOption used for parsing XML includes */
27166: int n_flags;
27167: void * data; /* application data that will be passed to the parser context in the _private field of the parser context(s) */
27168: int n_data;
27169:
27170: for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
27171: for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
27172: for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
27173: mem_base = xmlMemBlocks();
27174: doc = gen_xmlDocPtr(n_doc, 0);
27175: flags = gen_int(n_flags, 1);
27176: data = gen_userdata(n_data, 2);
27177:
27178: ret_val = xmlXIncludeProcessFlagsData(doc, flags, data);
27179: desret_int(ret_val);
27180: call_tests++;
27181: des_xmlDocPtr(n_doc, doc, 0);
27182: des_int(n_flags, flags, 1);
27183: des_userdata(n_data, data, 2);
27184: xmlResetLastError();
27185: if (mem_base != xmlMemBlocks()) {
27186: printf("Leak of %d blocks found in xmlXIncludeProcessFlagsData",
27187: xmlMemBlocks() - mem_base);
27188: test_ret++;
27189: printf(" %d", n_doc);
27190: printf(" %d", n_flags);
27191: printf(" %d", n_data);
27192: printf("\n");
27193: }
27194: }
27195: }
27196: }
27197: function_tests++;
27198: #endif
27199:
27200: return(test_ret);
27201: }
27202:
27203: #ifdef LIBXML_XINCLUDE_ENABLED
27204:
27205: #define gen_nb_xmlXIncludeCtxtPtr 1
27206: static xmlXIncludeCtxtPtr gen_xmlXIncludeCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
27207: return(NULL);
27208: }
27209: static void des_xmlXIncludeCtxtPtr(int no ATTRIBUTE_UNUSED, xmlXIncludeCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
27210: }
27211: #endif
27212:
27213:
27214: static int
27215: test_xmlXIncludeProcessNode(void) {
27216: int test_ret = 0;
27217:
27218: #if defined(LIBXML_XINCLUDE_ENABLED)
27219: int mem_base;
27220: int ret_val;
27221: xmlXIncludeCtxtPtr ctxt; /* an existing XInclude context */
27222: int n_ctxt;
27223: xmlNodePtr node; /* a node in an XML document */
27224: int n_node;
27225:
27226: for (n_ctxt = 0;n_ctxt < gen_nb_xmlXIncludeCtxtPtr;n_ctxt++) {
27227: for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
27228: mem_base = xmlMemBlocks();
27229: ctxt = gen_xmlXIncludeCtxtPtr(n_ctxt, 0);
27230: node = gen_xmlNodePtr(n_node, 1);
27231:
27232: ret_val = xmlXIncludeProcessNode(ctxt, node);
27233: desret_int(ret_val);
27234: call_tests++;
27235: des_xmlXIncludeCtxtPtr(n_ctxt, ctxt, 0);
27236: des_xmlNodePtr(n_node, node, 1);
27237: xmlResetLastError();
27238: if (mem_base != xmlMemBlocks()) {
27239: printf("Leak of %d blocks found in xmlXIncludeProcessNode",
27240: xmlMemBlocks() - mem_base);
27241: test_ret++;
27242: printf(" %d", n_ctxt);
27243: printf(" %d", n_node);
27244: printf("\n");
27245: }
27246: }
27247: }
27248: function_tests++;
27249: #endif
27250:
27251: return(test_ret);
27252: }
27253:
27254:
27255: static int
27256: test_xmlXIncludeProcessTree(void) {
27257: int test_ret = 0;
27258:
27259: #if defined(LIBXML_XINCLUDE_ENABLED)
27260: int mem_base;
27261: int ret_val;
27262: xmlNodePtr tree; /* a node in an XML document */
27263: int n_tree;
27264:
27265: for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
27266: mem_base = xmlMemBlocks();
27267: tree = gen_xmlNodePtr(n_tree, 0);
27268:
27269: ret_val = xmlXIncludeProcessTree(tree);
27270: desret_int(ret_val);
27271: call_tests++;
27272: des_xmlNodePtr(n_tree, tree, 0);
27273: xmlResetLastError();
27274: if (mem_base != xmlMemBlocks()) {
27275: printf("Leak of %d blocks found in xmlXIncludeProcessTree",
27276: xmlMemBlocks() - mem_base);
27277: test_ret++;
27278: printf(" %d", n_tree);
27279: printf("\n");
27280: }
27281: }
27282: function_tests++;
27283: #endif
27284:
27285: return(test_ret);
27286: }
27287:
27288:
27289: static int
27290: test_xmlXIncludeProcessTreeFlags(void) {
27291: int test_ret = 0;
27292:
27293: #if defined(LIBXML_XINCLUDE_ENABLED)
27294: int mem_base;
27295: int ret_val;
27296: xmlNodePtr tree; /* a node in an XML document */
27297: int n_tree;
27298: int flags; /* a set of xmlParserOption used for parsing XML includes */
27299: int n_flags;
27300:
27301: for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
27302: for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
27303: mem_base = xmlMemBlocks();
27304: tree = gen_xmlNodePtr(n_tree, 0);
27305: flags = gen_int(n_flags, 1);
27306:
27307: ret_val = xmlXIncludeProcessTreeFlags(tree, flags);
27308: desret_int(ret_val);
27309: call_tests++;
27310: des_xmlNodePtr(n_tree, tree, 0);
27311: des_int(n_flags, flags, 1);
27312: xmlResetLastError();
27313: if (mem_base != xmlMemBlocks()) {
27314: printf("Leak of %d blocks found in xmlXIncludeProcessTreeFlags",
27315: xmlMemBlocks() - mem_base);
27316: test_ret++;
27317: printf(" %d", n_tree);
27318: printf(" %d", n_flags);
27319: printf("\n");
27320: }
27321: }
27322: }
27323: function_tests++;
27324: #endif
27325:
27326: return(test_ret);
27327: }
27328:
27329:
27330: static int
27331: test_xmlXIncludeProcessTreeFlagsData(void) {
27332: int test_ret = 0;
27333:
27334: #if defined(LIBXML_XINCLUDE_ENABLED)
27335: int mem_base;
27336: int ret_val;
27337: xmlNodePtr tree; /* an XML node */
27338: int n_tree;
27339: int flags; /* a set of xmlParserOption used for parsing XML includes */
27340: int n_flags;
27341: void * data; /* application data that will be passed to the parser context in the _private field of the parser context(s) */
27342: int n_data;
27343:
27344: for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
27345: for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
27346: for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
27347: mem_base = xmlMemBlocks();
27348: tree = gen_xmlNodePtr(n_tree, 0);
27349: flags = gen_int(n_flags, 1);
27350: data = gen_userdata(n_data, 2);
27351:
27352: ret_val = xmlXIncludeProcessTreeFlagsData(tree, flags, data);
27353: desret_int(ret_val);
27354: call_tests++;
27355: des_xmlNodePtr(n_tree, tree, 0);
27356: des_int(n_flags, flags, 1);
27357: des_userdata(n_data, data, 2);
27358: xmlResetLastError();
27359: if (mem_base != xmlMemBlocks()) {
27360: printf("Leak of %d blocks found in xmlXIncludeProcessTreeFlagsData",
27361: xmlMemBlocks() - mem_base);
27362: test_ret++;
27363: printf(" %d", n_tree);
27364: printf(" %d", n_flags);
27365: printf(" %d", n_data);
27366: printf("\n");
27367: }
27368: }
27369: }
27370: }
27371: function_tests++;
27372: #endif
27373:
27374: return(test_ret);
27375: }
27376:
27377:
27378: static int
27379: test_xmlXIncludeSetFlags(void) {
27380: int test_ret = 0;
27381:
27382: #if defined(LIBXML_XINCLUDE_ENABLED)
27383: int mem_base;
27384: int ret_val;
27385: xmlXIncludeCtxtPtr ctxt; /* an XInclude processing context */
27386: int n_ctxt;
27387: int flags; /* a set of xmlParserOption used for parsing XML includes */
27388: int n_flags;
27389:
27390: for (n_ctxt = 0;n_ctxt < gen_nb_xmlXIncludeCtxtPtr;n_ctxt++) {
27391: for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
27392: mem_base = xmlMemBlocks();
27393: ctxt = gen_xmlXIncludeCtxtPtr(n_ctxt, 0);
27394: flags = gen_int(n_flags, 1);
27395:
27396: ret_val = xmlXIncludeSetFlags(ctxt, flags);
27397: desret_int(ret_val);
27398: call_tests++;
27399: des_xmlXIncludeCtxtPtr(n_ctxt, ctxt, 0);
27400: des_int(n_flags, flags, 1);
27401: xmlResetLastError();
27402: if (mem_base != xmlMemBlocks()) {
27403: printf("Leak of %d blocks found in xmlXIncludeSetFlags",
27404: xmlMemBlocks() - mem_base);
27405: test_ret++;
27406: printf(" %d", n_ctxt);
27407: printf(" %d", n_flags);
27408: printf("\n");
27409: }
27410: }
27411: }
27412: function_tests++;
27413: #endif
27414:
27415: return(test_ret);
27416: }
27417:
27418: static int
27419: test_xinclude(void) {
27420: int test_ret = 0;
27421:
27422: if (quiet == 0) printf("Testing xinclude : 8 of 10 functions ...\n");
27423: test_ret += test_xmlXIncludeNewContext();
27424: test_ret += test_xmlXIncludeProcess();
27425: test_ret += test_xmlXIncludeProcessFlags();
27426: test_ret += test_xmlXIncludeProcessFlagsData();
27427: test_ret += test_xmlXIncludeProcessNode();
27428: test_ret += test_xmlXIncludeProcessTree();
27429: test_ret += test_xmlXIncludeProcessTreeFlags();
27430: test_ret += test_xmlXIncludeProcessTreeFlagsData();
27431: test_ret += test_xmlXIncludeSetFlags();
27432:
27433: if (test_ret != 0)
27434: printf("Module xinclude: %d errors\n", test_ret);
27435: return(test_ret);
27436: }
27437:
27438: static int
27439: test_xmlAllocOutputBuffer(void) {
27440: int test_ret = 0;
27441:
27442: #if defined(LIBXML_OUTPUT_ENABLED)
27443: int mem_base;
27444: xmlOutputBufferPtr ret_val;
27445: xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
27446: int n_encoder;
27447:
27448: for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
27449: mem_base = xmlMemBlocks();
27450: encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 0);
27451:
27452: ret_val = xmlAllocOutputBuffer(encoder);
27453: desret_xmlOutputBufferPtr(ret_val);
27454: call_tests++;
27455: des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 0);
27456: xmlResetLastError();
27457: if (mem_base != xmlMemBlocks()) {
27458: printf("Leak of %d blocks found in xmlAllocOutputBuffer",
27459: xmlMemBlocks() - mem_base);
27460: test_ret++;
27461: printf(" %d", n_encoder);
27462: printf("\n");
27463: }
27464: }
27465: function_tests++;
27466: #endif
27467:
27468: return(test_ret);
27469: }
27470:
27471:
27472: static int
27473: test_xmlAllocParserInputBuffer(void) {
27474: int test_ret = 0;
27475:
27476: int mem_base;
27477: xmlParserInputBufferPtr ret_val;
27478: xmlCharEncoding enc; /* the charset encoding if known */
27479: int n_enc;
27480:
27481: for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
27482: mem_base = xmlMemBlocks();
27483: enc = gen_xmlCharEncoding(n_enc, 0);
27484:
27485: ret_val = xmlAllocParserInputBuffer(enc);
27486: desret_xmlParserInputBufferPtr(ret_val);
27487: call_tests++;
27488: des_xmlCharEncoding(n_enc, enc, 0);
27489: xmlResetLastError();
27490: if (mem_base != xmlMemBlocks()) {
27491: printf("Leak of %d blocks found in xmlAllocParserInputBuffer",
27492: xmlMemBlocks() - mem_base);
27493: test_ret++;
27494: printf(" %d", n_enc);
27495: printf("\n");
27496: }
27497: }
27498: function_tests++;
27499:
27500: return(test_ret);
27501: }
27502:
27503:
27504: static int
27505: test_xmlCheckFilename(void) {
27506: int test_ret = 0;
27507:
27508: int mem_base;
27509: int ret_val;
27510: char * path; /* the path to check */
27511: int n_path;
27512:
27513: for (n_path = 0;n_path < gen_nb_const_char_ptr;n_path++) {
27514: mem_base = xmlMemBlocks();
27515: path = gen_const_char_ptr(n_path, 0);
27516:
27517: ret_val = xmlCheckFilename((const char *)path);
27518: desret_int(ret_val);
27519: call_tests++;
27520: des_const_char_ptr(n_path, (const char *)path, 0);
27521: xmlResetLastError();
27522: if (mem_base != xmlMemBlocks()) {
27523: printf("Leak of %d blocks found in xmlCheckFilename",
27524: xmlMemBlocks() - mem_base);
27525: test_ret++;
27526: printf(" %d", n_path);
27527: printf("\n");
27528: }
27529: }
27530: function_tests++;
27531:
27532: return(test_ret);
27533: }
27534:
27535:
27536: static int
27537: test_xmlCheckHTTPInput(void) {
27538: int test_ret = 0;
27539:
27540: int mem_base;
27541: xmlParserInputPtr ret_val;
27542: xmlParserCtxtPtr ctxt; /* an XML parser context */
27543: int n_ctxt;
27544: xmlParserInputPtr ret; /* an XML parser input */
27545: int n_ret;
27546:
27547: for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
27548: for (n_ret = 0;n_ret < gen_nb_xmlParserInputPtr;n_ret++) {
27549: mem_base = xmlMemBlocks();
27550: ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
27551: ret = gen_xmlParserInputPtr(n_ret, 1);
27552:
27553: ret_val = xmlCheckHTTPInput(ctxt, ret);
27554: desret_xmlParserInputPtr(ret_val);
27555: call_tests++;
27556: des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
27557: des_xmlParserInputPtr(n_ret, ret, 1);
27558: xmlResetLastError();
27559: if (mem_base != xmlMemBlocks()) {
27560: printf("Leak of %d blocks found in xmlCheckHTTPInput",
27561: xmlMemBlocks() - mem_base);
27562: test_ret++;
27563: printf(" %d", n_ctxt);
27564: printf(" %d", n_ret);
27565: printf("\n");
27566: }
27567: }
27568: }
27569: function_tests++;
27570:
27571: return(test_ret);
27572: }
27573:
27574:
27575: static int
27576: test_xmlCleanupInputCallbacks(void) {
27577: int test_ret = 0;
27578:
27579: int mem_base;
27580:
27581: mem_base = xmlMemBlocks();
27582:
27583: xmlCleanupInputCallbacks();
27584: call_tests++;
27585: xmlResetLastError();
27586: if (mem_base != xmlMemBlocks()) {
27587: printf("Leak of %d blocks found in xmlCleanupInputCallbacks",
27588: xmlMemBlocks() - mem_base);
27589: test_ret++;
27590: printf("\n");
27591: }
27592: function_tests++;
27593:
27594: return(test_ret);
27595: }
27596:
27597:
27598: static int
27599: test_xmlCleanupOutputCallbacks(void) {
27600: int test_ret = 0;
27601:
27602: #if defined(LIBXML_OUTPUT_ENABLED)
27603: int mem_base;
27604:
27605: mem_base = xmlMemBlocks();
27606:
27607: xmlCleanupOutputCallbacks();
27608: call_tests++;
27609: xmlResetLastError();
27610: if (mem_base != xmlMemBlocks()) {
27611: printf("Leak of %d blocks found in xmlCleanupOutputCallbacks",
27612: xmlMemBlocks() - mem_base);
27613: test_ret++;
27614: printf("\n");
27615: }
27616: function_tests++;
27617: #endif
27618:
27619: return(test_ret);
27620: }
27621:
27622:
27623: static int
27624: test_xmlFileClose(void) {
27625: int test_ret = 0;
27626:
27627: int mem_base;
27628: int ret_val;
27629: void * context; /* the I/O context */
27630: int n_context;
27631:
27632: for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
27633: mem_base = xmlMemBlocks();
27634: context = gen_void_ptr(n_context, 0);
27635:
27636: ret_val = xmlFileClose(context);
27637: desret_int(ret_val);
27638: call_tests++;
27639: des_void_ptr(n_context, context, 0);
27640: xmlResetLastError();
27641: if (mem_base != xmlMemBlocks()) {
27642: printf("Leak of %d blocks found in xmlFileClose",
27643: xmlMemBlocks() - mem_base);
27644: test_ret++;
27645: printf(" %d", n_context);
27646: printf("\n");
27647: }
27648: }
27649: function_tests++;
27650:
27651: return(test_ret);
27652: }
27653:
27654:
27655: static int
27656: test_xmlFileMatch(void) {
27657: int test_ret = 0;
27658:
27659: int mem_base;
27660: int ret_val;
27661: const char * filename; /* the URI for matching */
27662: int n_filename;
27663:
27664: for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
27665: mem_base = xmlMemBlocks();
27666: filename = gen_filepath(n_filename, 0);
27667:
27668: ret_val = xmlFileMatch(filename);
27669: desret_int(ret_val);
27670: call_tests++;
27671: des_filepath(n_filename, filename, 0);
27672: xmlResetLastError();
27673: if (mem_base != xmlMemBlocks()) {
27674: printf("Leak of %d blocks found in xmlFileMatch",
27675: xmlMemBlocks() - mem_base);
27676: test_ret++;
27677: printf(" %d", n_filename);
27678: printf("\n");
27679: }
27680: }
27681: function_tests++;
27682:
27683: return(test_ret);
27684: }
27685:
27686:
27687: static int
27688: test_xmlFileOpen(void) {
27689: int test_ret = 0;
27690:
27691: int mem_base;
27692: void * ret_val;
27693: const char * filename; /* the URI for matching */
27694: int n_filename;
27695:
27696: for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
27697: mem_base = xmlMemBlocks();
27698: filename = gen_filepath(n_filename, 0);
27699:
27700: ret_val = xmlFileOpen(filename);
27701: desret_void_ptr(ret_val);
27702: call_tests++;
27703: des_filepath(n_filename, filename, 0);
27704: xmlResetLastError();
27705: if (mem_base != xmlMemBlocks()) {
27706: printf("Leak of %d blocks found in xmlFileOpen",
27707: xmlMemBlocks() - mem_base);
27708: test_ret++;
27709: printf(" %d", n_filename);
27710: printf("\n");
27711: }
27712: }
27713: function_tests++;
27714:
27715: return(test_ret);
27716: }
27717:
27718:
27719: static int
27720: test_xmlFileRead(void) {
27721: int test_ret = 0;
27722:
27723: int mem_base;
27724: int ret_val;
27725: void * context; /* the I/O context */
27726: int n_context;
27727: char * buffer; /* where to drop data */
27728: int n_buffer;
27729: int len; /* number of bytes to write */
27730: int n_len;
27731:
27732: for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
27733: for (n_buffer = 0;n_buffer < gen_nb_char_ptr;n_buffer++) {
27734: for (n_len = 0;n_len < gen_nb_int;n_len++) {
27735: mem_base = xmlMemBlocks();
27736: context = gen_void_ptr(n_context, 0);
27737: buffer = gen_char_ptr(n_buffer, 1);
27738: len = gen_int(n_len, 2);
27739:
27740: ret_val = xmlFileRead(context, buffer, len);
27741: desret_int(ret_val);
27742: call_tests++;
27743: des_void_ptr(n_context, context, 0);
27744: des_char_ptr(n_buffer, buffer, 1);
27745: des_int(n_len, len, 2);
27746: xmlResetLastError();
27747: if (mem_base != xmlMemBlocks()) {
27748: printf("Leak of %d blocks found in xmlFileRead",
27749: xmlMemBlocks() - mem_base);
27750: test_ret++;
27751: printf(" %d", n_context);
27752: printf(" %d", n_buffer);
27753: printf(" %d", n_len);
27754: printf("\n");
27755: }
27756: }
27757: }
27758: }
27759: function_tests++;
27760:
27761: return(test_ret);
27762: }
27763:
27764:
27765: static int
27766: test_xmlIOFTPClose(void) {
27767: int test_ret = 0;
27768:
27769: #if defined(LIBXML_FTP_ENABLED)
27770: int mem_base;
27771: int ret_val;
27772: void * context; /* the I/O context */
27773: int n_context;
27774:
27775: for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
27776: mem_base = xmlMemBlocks();
27777: context = gen_void_ptr(n_context, 0);
27778:
27779: ret_val = xmlIOFTPClose(context);
27780: desret_int(ret_val);
27781: call_tests++;
27782: des_void_ptr(n_context, context, 0);
27783: xmlResetLastError();
27784: if (mem_base != xmlMemBlocks()) {
27785: printf("Leak of %d blocks found in xmlIOFTPClose",
27786: xmlMemBlocks() - mem_base);
27787: test_ret++;
27788: printf(" %d", n_context);
27789: printf("\n");
27790: }
27791: }
27792: function_tests++;
27793: #endif
27794:
27795: return(test_ret);
27796: }
27797:
27798:
27799: static int
27800: test_xmlIOFTPMatch(void) {
27801: int test_ret = 0;
27802:
27803: #if defined(LIBXML_FTP_ENABLED)
27804: int mem_base;
27805: int ret_val;
27806: const char * filename; /* the URI for matching */
27807: int n_filename;
27808:
27809: for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
27810: mem_base = xmlMemBlocks();
27811: filename = gen_filepath(n_filename, 0);
27812:
27813: ret_val = xmlIOFTPMatch(filename);
27814: desret_int(ret_val);
27815: call_tests++;
27816: des_filepath(n_filename, filename, 0);
27817: xmlResetLastError();
27818: if (mem_base != xmlMemBlocks()) {
27819: printf("Leak of %d blocks found in xmlIOFTPMatch",
27820: xmlMemBlocks() - mem_base);
27821: test_ret++;
27822: printf(" %d", n_filename);
27823: printf("\n");
27824: }
27825: }
27826: function_tests++;
27827: #endif
27828:
27829: return(test_ret);
27830: }
27831:
27832:
27833: static int
27834: test_xmlIOFTPOpen(void) {
27835: int test_ret = 0;
27836:
27837: #if defined(LIBXML_FTP_ENABLED)
27838: int mem_base;
27839: void * ret_val;
27840: const char * filename; /* the URI for matching */
27841: int n_filename;
27842:
27843: for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
27844: mem_base = xmlMemBlocks();
27845: filename = gen_filepath(n_filename, 0);
27846:
27847: ret_val = xmlIOFTPOpen(filename);
27848: desret_void_ptr(ret_val);
27849: call_tests++;
27850: des_filepath(n_filename, filename, 0);
27851: xmlResetLastError();
27852: if (mem_base != xmlMemBlocks()) {
27853: printf("Leak of %d blocks found in xmlIOFTPOpen",
27854: xmlMemBlocks() - mem_base);
27855: test_ret++;
27856: printf(" %d", n_filename);
27857: printf("\n");
27858: }
27859: }
27860: function_tests++;
27861: #endif
27862:
27863: return(test_ret);
27864: }
27865:
27866:
27867: static int
27868: test_xmlIOFTPRead(void) {
27869: int test_ret = 0;
27870:
27871: #if defined(LIBXML_FTP_ENABLED)
27872: int mem_base;
27873: int ret_val;
27874: void * context; /* the I/O context */
27875: int n_context;
27876: char * buffer; /* where to drop data */
27877: int n_buffer;
27878: int len; /* number of bytes to write */
27879: int n_len;
27880:
27881: for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
27882: for (n_buffer = 0;n_buffer < gen_nb_char_ptr;n_buffer++) {
27883: for (n_len = 0;n_len < gen_nb_int;n_len++) {
27884: mem_base = xmlMemBlocks();
27885: context = gen_void_ptr(n_context, 0);
27886: buffer = gen_char_ptr(n_buffer, 1);
27887: len = gen_int(n_len, 2);
27888:
27889: ret_val = xmlIOFTPRead(context, buffer, len);
27890: desret_int(ret_val);
27891: call_tests++;
27892: des_void_ptr(n_context, context, 0);
27893: des_char_ptr(n_buffer, buffer, 1);
27894: des_int(n_len, len, 2);
27895: xmlResetLastError();
27896: if (mem_base != xmlMemBlocks()) {
27897: printf("Leak of %d blocks found in xmlIOFTPRead",
27898: xmlMemBlocks() - mem_base);
27899: test_ret++;
27900: printf(" %d", n_context);
27901: printf(" %d", n_buffer);
27902: printf(" %d", n_len);
27903: printf("\n");
27904: }
27905: }
27906: }
27907: }
27908: function_tests++;
27909: #endif
27910:
27911: return(test_ret);
27912: }
27913:
27914:
27915: static int
27916: test_xmlIOHTTPClose(void) {
27917: int test_ret = 0;
27918:
27919: #if defined(LIBXML_HTTP_ENABLED)
27920: int mem_base;
27921: int ret_val;
27922: void * context; /* the I/O context */
27923: int n_context;
27924:
27925: for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
27926: mem_base = xmlMemBlocks();
27927: context = gen_void_ptr(n_context, 0);
27928:
27929: ret_val = xmlIOHTTPClose(context);
27930: desret_int(ret_val);
27931: call_tests++;
27932: des_void_ptr(n_context, context, 0);
27933: xmlResetLastError();
27934: if (mem_base != xmlMemBlocks()) {
27935: printf("Leak of %d blocks found in xmlIOHTTPClose",
27936: xmlMemBlocks() - mem_base);
27937: test_ret++;
27938: printf(" %d", n_context);
27939: printf("\n");
27940: }
27941: }
27942: function_tests++;
27943: #endif
27944:
27945: return(test_ret);
27946: }
27947:
27948:
27949: static int
27950: test_xmlIOHTTPMatch(void) {
27951: int test_ret = 0;
27952:
27953: #if defined(LIBXML_HTTP_ENABLED)
27954: int mem_base;
27955: int ret_val;
27956: const char * filename; /* the URI for matching */
27957: int n_filename;
27958:
27959: for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
27960: mem_base = xmlMemBlocks();
27961: filename = gen_filepath(n_filename, 0);
27962:
27963: ret_val = xmlIOHTTPMatch(filename);
27964: desret_int(ret_val);
27965: call_tests++;
27966: des_filepath(n_filename, filename, 0);
27967: xmlResetLastError();
27968: if (mem_base != xmlMemBlocks()) {
27969: printf("Leak of %d blocks found in xmlIOHTTPMatch",
27970: xmlMemBlocks() - mem_base);
27971: test_ret++;
27972: printf(" %d", n_filename);
27973: printf("\n");
27974: }
27975: }
27976: function_tests++;
27977: #endif
27978:
27979: return(test_ret);
27980: }
27981:
27982:
27983: static int
27984: test_xmlIOHTTPOpen(void) {
27985: int test_ret = 0;
27986:
27987: #if defined(LIBXML_HTTP_ENABLED)
27988: int mem_base;
27989: void * ret_val;
27990: const char * filename; /* the URI for matching */
27991: int n_filename;
27992:
27993: for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
27994: mem_base = xmlMemBlocks();
27995: filename = gen_filepath(n_filename, 0);
27996:
27997: ret_val = xmlIOHTTPOpen(filename);
27998: desret_xmlNanoHTTPCtxtPtr(ret_val);
27999: call_tests++;
28000: des_filepath(n_filename, filename, 0);
28001: xmlResetLastError();
28002: if (mem_base != xmlMemBlocks()) {
28003: printf("Leak of %d blocks found in xmlIOHTTPOpen",
28004: xmlMemBlocks() - mem_base);
28005: test_ret++;
28006: printf(" %d", n_filename);
28007: printf("\n");
28008: }
28009: }
28010: function_tests++;
28011: #endif
28012:
28013: return(test_ret);
28014: }
28015:
28016:
28017: static int
28018: test_xmlIOHTTPRead(void) {
28019: int test_ret = 0;
28020:
28021: #if defined(LIBXML_HTTP_ENABLED)
28022: int mem_base;
28023: int ret_val;
28024: void * context; /* the I/O context */
28025: int n_context;
28026: char * buffer; /* where to drop data */
28027: int n_buffer;
28028: int len; /* number of bytes to write */
28029: int n_len;
28030:
28031: for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
28032: for (n_buffer = 0;n_buffer < gen_nb_char_ptr;n_buffer++) {
28033: for (n_len = 0;n_len < gen_nb_int;n_len++) {
28034: mem_base = xmlMemBlocks();
28035: context = gen_void_ptr(n_context, 0);
28036: buffer = gen_char_ptr(n_buffer, 1);
28037: len = gen_int(n_len, 2);
28038:
28039: ret_val = xmlIOHTTPRead(context, buffer, len);
28040: desret_int(ret_val);
28041: call_tests++;
28042: des_void_ptr(n_context, context, 0);
28043: des_char_ptr(n_buffer, buffer, 1);
28044: des_int(n_len, len, 2);
28045: xmlResetLastError();
28046: if (mem_base != xmlMemBlocks()) {
28047: printf("Leak of %d blocks found in xmlIOHTTPRead",
28048: xmlMemBlocks() - mem_base);
28049: test_ret++;
28050: printf(" %d", n_context);
28051: printf(" %d", n_buffer);
28052: printf(" %d", n_len);
28053: printf("\n");
28054: }
28055: }
28056: }
28057: }
28058: function_tests++;
28059: #endif
28060:
28061: return(test_ret);
28062: }
28063:
28064:
28065: static int
28066: test_xmlNoNetExternalEntityLoader(void) {
28067: int test_ret = 0;
28068:
28069: int mem_base;
28070: xmlParserInputPtr ret_val;
28071: const char * URL; /* the URL for the entity to load */
28072: int n_URL;
28073: char * ID; /* the System ID for the entity to load */
28074: int n_ID;
28075: xmlParserCtxtPtr ctxt; /* the context in which the entity is called or NULL */
28076: int n_ctxt;
28077:
28078: for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
28079: for (n_ID = 0;n_ID < gen_nb_const_char_ptr;n_ID++) {
28080: for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
28081: mem_base = xmlMemBlocks();
28082: URL = gen_filepath(n_URL, 0);
28083: ID = gen_const_char_ptr(n_ID, 1);
28084: ctxt = gen_xmlParserCtxtPtr(n_ctxt, 2);
28085:
28086: ret_val = xmlNoNetExternalEntityLoader(URL, (const char *)ID, ctxt);
28087: desret_xmlParserInputPtr(ret_val);
28088: call_tests++;
28089: des_filepath(n_URL, URL, 0);
28090: des_const_char_ptr(n_ID, (const char *)ID, 1);
28091: des_xmlParserCtxtPtr(n_ctxt, ctxt, 2);
28092: xmlResetLastError();
28093: if (mem_base != xmlMemBlocks()) {
28094: printf("Leak of %d blocks found in xmlNoNetExternalEntityLoader",
28095: xmlMemBlocks() - mem_base);
28096: test_ret++;
28097: printf(" %d", n_URL);
28098: printf(" %d", n_ID);
28099: printf(" %d", n_ctxt);
28100: printf("\n");
28101: }
28102: }
28103: }
28104: }
28105: function_tests++;
28106:
28107: return(test_ret);
28108: }
28109:
28110:
28111: static int
28112: test_xmlNormalizeWindowsPath(void) {
28113: int test_ret = 0;
28114:
28115: int mem_base;
28116: xmlChar * ret_val;
28117: xmlChar * path; /* the input file path */
28118: int n_path;
28119:
28120: for (n_path = 0;n_path < gen_nb_const_xmlChar_ptr;n_path++) {
28121: mem_base = xmlMemBlocks();
28122: path = gen_const_xmlChar_ptr(n_path, 0);
28123:
28124: ret_val = xmlNormalizeWindowsPath((const xmlChar *)path);
28125: desret_xmlChar_ptr(ret_val);
28126: call_tests++;
28127: des_const_xmlChar_ptr(n_path, (const xmlChar *)path, 0);
28128: xmlResetLastError();
28129: if (mem_base != xmlMemBlocks()) {
28130: printf("Leak of %d blocks found in xmlNormalizeWindowsPath",
28131: xmlMemBlocks() - mem_base);
28132: test_ret++;
28133: printf(" %d", n_path);
28134: printf("\n");
28135: }
28136: }
28137: function_tests++;
28138:
28139: return(test_ret);
28140: }
28141:
28142:
28143: static int
28144: test_xmlOutputBufferCreateBuffer(void) {
28145: int test_ret = 0;
28146:
28147: #if defined(LIBXML_OUTPUT_ENABLED)
28148: int mem_base;
28149: xmlOutputBufferPtr ret_val;
28150: xmlBufferPtr buffer; /* a xmlBufferPtr */
28151: int n_buffer;
28152: xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
28153: int n_encoder;
28154:
28155: for (n_buffer = 0;n_buffer < gen_nb_xmlBufferPtr;n_buffer++) {
28156: for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
28157: mem_base = xmlMemBlocks();
28158: buffer = gen_xmlBufferPtr(n_buffer, 0);
28159: encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 1);
28160:
28161: ret_val = xmlOutputBufferCreateBuffer(buffer, encoder);
28162: desret_xmlOutputBufferPtr(ret_val);
28163: call_tests++;
28164: des_xmlBufferPtr(n_buffer, buffer, 0);
28165: des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 1);
28166: xmlResetLastError();
28167: if (mem_base != xmlMemBlocks()) {
28168: printf("Leak of %d blocks found in xmlOutputBufferCreateBuffer",
28169: xmlMemBlocks() - mem_base);
28170: test_ret++;
28171: printf(" %d", n_buffer);
28172: printf(" %d", n_encoder);
28173: printf("\n");
28174: }
28175: }
28176: }
28177: function_tests++;
28178: #endif
28179:
28180: return(test_ret);
28181: }
28182:
28183:
28184: static int
28185: test_xmlOutputBufferCreateFd(void) {
28186: int test_ret = 0;
28187:
28188: #if defined(LIBXML_OUTPUT_ENABLED)
28189: int mem_base;
28190: xmlOutputBufferPtr ret_val;
28191: int fd; /* a file descriptor number */
28192: int n_fd;
28193: xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
28194: int n_encoder;
28195:
28196: for (n_fd = 0;n_fd < gen_nb_int;n_fd++) {
28197: for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
28198: mem_base = xmlMemBlocks();
28199: fd = gen_int(n_fd, 0);
28200: encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 1);
28201:
28202: ret_val = xmlOutputBufferCreateFd(fd, encoder);
28203: desret_xmlOutputBufferPtr(ret_val);
28204: call_tests++;
28205: des_int(n_fd, fd, 0);
28206: des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 1);
28207: xmlResetLastError();
28208: if (mem_base != xmlMemBlocks()) {
28209: printf("Leak of %d blocks found in xmlOutputBufferCreateFd",
28210: xmlMemBlocks() - mem_base);
28211: test_ret++;
28212: printf(" %d", n_fd);
28213: printf(" %d", n_encoder);
28214: printf("\n");
28215: }
28216: }
28217: }
28218: function_tests++;
28219: #endif
28220:
28221: return(test_ret);
28222: }
28223:
28224:
28225: static int
28226: test_xmlOutputBufferCreateFile(void) {
28227: int test_ret = 0;
28228:
28229: #if defined(LIBXML_OUTPUT_ENABLED)
28230: int mem_base;
28231: xmlOutputBufferPtr ret_val;
28232: FILE * file; /* a FILE* */
28233: int n_file;
28234: xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
28235: int n_encoder;
28236:
28237: for (n_file = 0;n_file < gen_nb_FILE_ptr;n_file++) {
28238: for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
28239: mem_base = xmlMemBlocks();
28240: file = gen_FILE_ptr(n_file, 0);
28241: encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 1);
28242:
28243: ret_val = xmlOutputBufferCreateFile(file, encoder);
28244: desret_xmlOutputBufferPtr(ret_val);
28245: call_tests++;
28246: des_FILE_ptr(n_file, file, 0);
28247: des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 1);
28248: xmlResetLastError();
28249: if (mem_base != xmlMemBlocks()) {
28250: printf("Leak of %d blocks found in xmlOutputBufferCreateFile",
28251: xmlMemBlocks() - mem_base);
28252: test_ret++;
28253: printf(" %d", n_file);
28254: printf(" %d", n_encoder);
28255: printf("\n");
28256: }
28257: }
28258: }
28259: function_tests++;
28260: #endif
28261:
28262: return(test_ret);
28263: }
28264:
28265:
28266: static int
28267: test_xmlOutputBufferCreateFilename(void) {
28268: int test_ret = 0;
28269:
28270: #if defined(LIBXML_OUTPUT_ENABLED)
28271: int mem_base;
28272: xmlOutputBufferPtr ret_val;
28273: const char * URI; /* a C string containing the URI or filename */
28274: int n_URI;
28275: xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
28276: int n_encoder;
28277: int compression; /* the compression ration (0 none, 9 max). */
28278: int n_compression;
28279:
28280: for (n_URI = 0;n_URI < gen_nb_fileoutput;n_URI++) {
28281: for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
28282: for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
28283: mem_base = xmlMemBlocks();
28284: URI = gen_fileoutput(n_URI, 0);
28285: encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 1);
28286: compression = gen_int(n_compression, 2);
28287:
28288: ret_val = xmlOutputBufferCreateFilename(URI, encoder, compression);
28289: desret_xmlOutputBufferPtr(ret_val);
28290: call_tests++;
28291: des_fileoutput(n_URI, URI, 0);
28292: des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 1);
28293: des_int(n_compression, compression, 2);
28294: xmlResetLastError();
28295: if (mem_base != xmlMemBlocks()) {
28296: printf("Leak of %d blocks found in xmlOutputBufferCreateFilename",
28297: xmlMemBlocks() - mem_base);
28298: test_ret++;
28299: printf(" %d", n_URI);
28300: printf(" %d", n_encoder);
28301: printf(" %d", n_compression);
28302: printf("\n");
28303: }
28304: }
28305: }
28306: }
28307: function_tests++;
28308: #endif
28309:
28310: return(test_ret);
28311: }
28312:
28313:
28314: static int
28315: test_xmlOutputBufferFlush(void) {
28316: int test_ret = 0;
28317:
28318: #if defined(LIBXML_OUTPUT_ENABLED)
28319: int mem_base;
28320: int ret_val;
28321: xmlOutputBufferPtr out; /* a buffered output */
28322: int n_out;
28323:
28324: for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
28325: mem_base = xmlMemBlocks();
28326: out = gen_xmlOutputBufferPtr(n_out, 0);
28327:
28328: ret_val = xmlOutputBufferFlush(out);
28329: desret_int(ret_val);
28330: call_tests++;
28331: des_xmlOutputBufferPtr(n_out, out, 0);
28332: xmlResetLastError();
28333: if (mem_base != xmlMemBlocks()) {
28334: printf("Leak of %d blocks found in xmlOutputBufferFlush",
28335: xmlMemBlocks() - mem_base);
28336: test_ret++;
28337: printf(" %d", n_out);
28338: printf("\n");
28339: }
28340: }
28341: function_tests++;
28342: #endif
28343:
28344: return(test_ret);
28345: }
28346:
28347:
28348: static int
28349: test_xmlOutputBufferWrite(void) {
28350: int test_ret = 0;
28351:
28352: #if defined(LIBXML_OUTPUT_ENABLED)
28353: int mem_base;
28354: int ret_val;
28355: xmlOutputBufferPtr out; /* a buffered parser output */
28356: int n_out;
28357: int len; /* the size in bytes of the array. */
28358: int n_len;
28359: char * buf; /* an char array */
28360: int n_buf;
28361:
28362: for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
28363: for (n_len = 0;n_len < gen_nb_int;n_len++) {
28364: for (n_buf = 0;n_buf < gen_nb_const_char_ptr;n_buf++) {
28365: mem_base = xmlMemBlocks();
28366: out = gen_xmlOutputBufferPtr(n_out, 0);
28367: len = gen_int(n_len, 1);
28368: buf = gen_const_char_ptr(n_buf, 2);
28369:
28370: ret_val = xmlOutputBufferWrite(out, len, (const char *)buf);
28371: desret_int(ret_val);
28372: call_tests++;
28373: des_xmlOutputBufferPtr(n_out, out, 0);
28374: des_int(n_len, len, 1);
28375: des_const_char_ptr(n_buf, (const char *)buf, 2);
28376: xmlResetLastError();
28377: if (mem_base != xmlMemBlocks()) {
28378: printf("Leak of %d blocks found in xmlOutputBufferWrite",
28379: xmlMemBlocks() - mem_base);
28380: test_ret++;
28381: printf(" %d", n_out);
28382: printf(" %d", n_len);
28383: printf(" %d", n_buf);
28384: printf("\n");
28385: }
28386: }
28387: }
28388: }
28389: function_tests++;
28390: #endif
28391:
28392: return(test_ret);
28393: }
28394:
28395:
28396: static int
28397: test_xmlOutputBufferWriteEscape(void) {
28398: int test_ret = 0;
28399:
28400:
28401: /* missing type support */
28402: return(test_ret);
28403: }
28404:
28405:
28406: static int
28407: test_xmlOutputBufferWriteString(void) {
28408: int test_ret = 0;
28409:
28410: #if defined(LIBXML_OUTPUT_ENABLED)
28411: int mem_base;
28412: int ret_val;
28413: xmlOutputBufferPtr out; /* a buffered parser output */
28414: int n_out;
28415: char * str; /* a zero terminated C string */
28416: int n_str;
28417:
28418: for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
28419: for (n_str = 0;n_str < gen_nb_const_char_ptr;n_str++) {
28420: mem_base = xmlMemBlocks();
28421: out = gen_xmlOutputBufferPtr(n_out, 0);
28422: str = gen_const_char_ptr(n_str, 1);
28423:
28424: ret_val = xmlOutputBufferWriteString(out, (const char *)str);
28425: desret_int(ret_val);
28426: call_tests++;
28427: des_xmlOutputBufferPtr(n_out, out, 0);
28428: des_const_char_ptr(n_str, (const char *)str, 1);
28429: xmlResetLastError();
28430: if (mem_base != xmlMemBlocks()) {
28431: printf("Leak of %d blocks found in xmlOutputBufferWriteString",
28432: xmlMemBlocks() - mem_base);
28433: test_ret++;
28434: printf(" %d", n_out);
28435: printf(" %d", n_str);
28436: printf("\n");
28437: }
28438: }
28439: }
28440: function_tests++;
28441: #endif
28442:
28443: return(test_ret);
28444: }
28445:
28446:
28447: static int
28448: test_xmlParserGetDirectory(void) {
28449: int test_ret = 0;
28450:
28451:
28452: /* missing type support */
28453: return(test_ret);
28454: }
28455:
28456:
28457: static int
28458: test_xmlParserInputBufferCreateFd(void) {
28459: int test_ret = 0;
28460:
28461: int mem_base;
28462: xmlParserInputBufferPtr ret_val;
28463: int fd; /* a file descriptor number */
28464: int n_fd;
28465: xmlCharEncoding enc; /* the charset encoding if known */
28466: int n_enc;
28467:
28468: for (n_fd = 0;n_fd < gen_nb_int;n_fd++) {
28469: for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
28470: mem_base = xmlMemBlocks();
28471: fd = gen_int(n_fd, 0);
28472: enc = gen_xmlCharEncoding(n_enc, 1);
28473: if (fd >= 0) fd = -1;
28474:
28475: ret_val = xmlParserInputBufferCreateFd(fd, enc);
28476: desret_xmlParserInputBufferPtr(ret_val);
28477: call_tests++;
28478: des_int(n_fd, fd, 0);
28479: des_xmlCharEncoding(n_enc, enc, 1);
28480: xmlResetLastError();
28481: if (mem_base != xmlMemBlocks()) {
28482: printf("Leak of %d blocks found in xmlParserInputBufferCreateFd",
28483: xmlMemBlocks() - mem_base);
28484: test_ret++;
28485: printf(" %d", n_fd);
28486: printf(" %d", n_enc);
28487: printf("\n");
28488: }
28489: }
28490: }
28491: function_tests++;
28492:
28493: return(test_ret);
28494: }
28495:
28496:
28497: static int
28498: test_xmlParserInputBufferCreateFile(void) {
28499: int test_ret = 0;
28500:
28501: int mem_base;
28502: xmlParserInputBufferPtr ret_val;
28503: FILE * file; /* a FILE* */
28504: int n_file;
28505: xmlCharEncoding enc; /* the charset encoding if known */
28506: int n_enc;
28507:
28508: for (n_file = 0;n_file < gen_nb_FILE_ptr;n_file++) {
28509: for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
28510: mem_base = xmlMemBlocks();
28511: file = gen_FILE_ptr(n_file, 0);
28512: enc = gen_xmlCharEncoding(n_enc, 1);
28513:
28514: ret_val = xmlParserInputBufferCreateFile(file, enc);
28515: desret_xmlParserInputBufferPtr(ret_val);
28516: call_tests++;
28517: des_FILE_ptr(n_file, file, 0);
28518: des_xmlCharEncoding(n_enc, enc, 1);
28519: xmlResetLastError();
28520: if (mem_base != xmlMemBlocks()) {
28521: printf("Leak of %d blocks found in xmlParserInputBufferCreateFile",
28522: xmlMemBlocks() - mem_base);
28523: test_ret++;
28524: printf(" %d", n_file);
28525: printf(" %d", n_enc);
28526: printf("\n");
28527: }
28528: }
28529: }
28530: function_tests++;
28531:
28532: return(test_ret);
28533: }
28534:
28535:
28536: static int
28537: test_xmlParserInputBufferCreateFilename(void) {
28538: int test_ret = 0;
28539:
28540: int mem_base;
28541: xmlParserInputBufferPtr ret_val;
28542: const char * URI; /* a C string containing the URI or filename */
28543: int n_URI;
28544: xmlCharEncoding enc; /* the charset encoding if known */
28545: int n_enc;
28546:
28547: for (n_URI = 0;n_URI < gen_nb_fileoutput;n_URI++) {
28548: for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
28549: mem_base = xmlMemBlocks();
28550: URI = gen_fileoutput(n_URI, 0);
28551: enc = gen_xmlCharEncoding(n_enc, 1);
28552:
28553: ret_val = xmlParserInputBufferCreateFilename(URI, enc);
28554: desret_xmlParserInputBufferPtr(ret_val);
28555: call_tests++;
28556: des_fileoutput(n_URI, URI, 0);
28557: des_xmlCharEncoding(n_enc, enc, 1);
28558: xmlResetLastError();
28559: if (mem_base != xmlMemBlocks()) {
28560: printf("Leak of %d blocks found in xmlParserInputBufferCreateFilename",
28561: xmlMemBlocks() - mem_base);
28562: test_ret++;
28563: printf(" %d", n_URI);
28564: printf(" %d", n_enc);
28565: printf("\n");
28566: }
28567: }
28568: }
28569: function_tests++;
28570:
28571: return(test_ret);
28572: }
28573:
28574:
28575: static int
28576: test_xmlParserInputBufferCreateMem(void) {
28577: int test_ret = 0;
28578:
28579: int mem_base;
28580: xmlParserInputBufferPtr ret_val;
28581: char * mem; /* the memory input */
28582: int n_mem;
28583: int size; /* the length of the memory block */
28584: int n_size;
28585: xmlCharEncoding enc; /* the charset encoding if known */
28586: int n_enc;
28587:
28588: for (n_mem = 0;n_mem < gen_nb_const_char_ptr;n_mem++) {
28589: for (n_size = 0;n_size < gen_nb_int;n_size++) {
28590: for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
28591: mem_base = xmlMemBlocks();
28592: mem = gen_const_char_ptr(n_mem, 0);
28593: size = gen_int(n_size, 1);
28594: enc = gen_xmlCharEncoding(n_enc, 2);
28595:
28596: ret_val = xmlParserInputBufferCreateMem((const char *)mem, size, enc);
28597: desret_xmlParserInputBufferPtr(ret_val);
28598: call_tests++;
28599: des_const_char_ptr(n_mem, (const char *)mem, 0);
28600: des_int(n_size, size, 1);
28601: des_xmlCharEncoding(n_enc, enc, 2);
28602: xmlResetLastError();
28603: if (mem_base != xmlMemBlocks()) {
28604: printf("Leak of %d blocks found in xmlParserInputBufferCreateMem",
28605: xmlMemBlocks() - mem_base);
28606: test_ret++;
28607: printf(" %d", n_mem);
28608: printf(" %d", n_size);
28609: printf(" %d", n_enc);
28610: printf("\n");
28611: }
28612: }
28613: }
28614: }
28615: function_tests++;
28616:
28617: return(test_ret);
28618: }
28619:
28620:
28621: static int
28622: test_xmlParserInputBufferCreateStatic(void) {
28623: int test_ret = 0;
28624:
28625: int mem_base;
28626: xmlParserInputBufferPtr ret_val;
28627: char * mem; /* the memory input */
28628: int n_mem;
28629: int size; /* the length of the memory block */
28630: int n_size;
28631: xmlCharEncoding enc; /* the charset encoding if known */
28632: int n_enc;
28633:
28634: for (n_mem = 0;n_mem < gen_nb_const_char_ptr;n_mem++) {
28635: for (n_size = 0;n_size < gen_nb_int;n_size++) {
28636: for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
28637: mem_base = xmlMemBlocks();
28638: mem = gen_const_char_ptr(n_mem, 0);
28639: size = gen_int(n_size, 1);
28640: enc = gen_xmlCharEncoding(n_enc, 2);
28641:
28642: ret_val = xmlParserInputBufferCreateStatic((const char *)mem, size, enc);
28643: desret_xmlParserInputBufferPtr(ret_val);
28644: call_tests++;
28645: des_const_char_ptr(n_mem, (const char *)mem, 0);
28646: des_int(n_size, size, 1);
28647: des_xmlCharEncoding(n_enc, enc, 2);
28648: xmlResetLastError();
28649: if (mem_base != xmlMemBlocks()) {
28650: printf("Leak of %d blocks found in xmlParserInputBufferCreateStatic",
28651: xmlMemBlocks() - mem_base);
28652: test_ret++;
28653: printf(" %d", n_mem);
28654: printf(" %d", n_size);
28655: printf(" %d", n_enc);
28656: printf("\n");
28657: }
28658: }
28659: }
28660: }
28661: function_tests++;
28662:
28663: return(test_ret);
28664: }
28665:
28666:
28667: static int
28668: test_xmlParserInputBufferGrow(void) {
28669: int test_ret = 0;
28670:
28671: int mem_base;
28672: int ret_val;
28673: xmlParserInputBufferPtr in; /* a buffered parser input */
28674: int n_in;
28675: int len; /* indicative value of the amount of chars to read */
28676: int n_len;
28677:
28678: for (n_in = 0;n_in < gen_nb_xmlParserInputBufferPtr;n_in++) {
28679: for (n_len = 0;n_len < gen_nb_int;n_len++) {
28680: mem_base = xmlMemBlocks();
28681: in = gen_xmlParserInputBufferPtr(n_in, 0);
28682: len = gen_int(n_len, 1);
28683:
28684: ret_val = xmlParserInputBufferGrow(in, len);
28685: desret_int(ret_val);
28686: call_tests++;
28687: des_xmlParserInputBufferPtr(n_in, in, 0);
28688: des_int(n_len, len, 1);
28689: xmlResetLastError();
28690: if (mem_base != xmlMemBlocks()) {
28691: printf("Leak of %d blocks found in xmlParserInputBufferGrow",
28692: xmlMemBlocks() - mem_base);
28693: test_ret++;
28694: printf(" %d", n_in);
28695: printf(" %d", n_len);
28696: printf("\n");
28697: }
28698: }
28699: }
28700: function_tests++;
28701:
28702: return(test_ret);
28703: }
28704:
28705:
28706: static int
28707: test_xmlParserInputBufferPush(void) {
28708: int test_ret = 0;
28709:
28710: int mem_base;
28711: int ret_val;
28712: xmlParserInputBufferPtr in; /* a buffered parser input */
28713: int n_in;
28714: int len; /* the size in bytes of the array. */
28715: int n_len;
28716: char * buf; /* an char array */
28717: int n_buf;
28718:
28719: for (n_in = 0;n_in < gen_nb_xmlParserInputBufferPtr;n_in++) {
28720: for (n_len = 0;n_len < gen_nb_int;n_len++) {
28721: for (n_buf = 0;n_buf < gen_nb_const_char_ptr;n_buf++) {
28722: mem_base = xmlMemBlocks();
28723: in = gen_xmlParserInputBufferPtr(n_in, 0);
28724: len = gen_int(n_len, 1);
28725: buf = gen_const_char_ptr(n_buf, 2);
28726:
28727: ret_val = xmlParserInputBufferPush(in, len, (const char *)buf);
28728: desret_int(ret_val);
28729: call_tests++;
28730: des_xmlParserInputBufferPtr(n_in, in, 0);
28731: des_int(n_len, len, 1);
28732: des_const_char_ptr(n_buf, (const char *)buf, 2);
28733: xmlResetLastError();
28734: if (mem_base != xmlMemBlocks()) {
28735: printf("Leak of %d blocks found in xmlParserInputBufferPush",
28736: xmlMemBlocks() - mem_base);
28737: test_ret++;
28738: printf(" %d", n_in);
28739: printf(" %d", n_len);
28740: printf(" %d", n_buf);
28741: printf("\n");
28742: }
28743: }
28744: }
28745: }
28746: function_tests++;
28747:
28748: return(test_ret);
28749: }
28750:
28751:
28752: static int
28753: test_xmlParserInputBufferRead(void) {
28754: int test_ret = 0;
28755:
28756: int mem_base;
28757: int ret_val;
28758: xmlParserInputBufferPtr in; /* a buffered parser input */
28759: int n_in;
28760: int len; /* indicative value of the amount of chars to read */
28761: int n_len;
28762:
28763: for (n_in = 0;n_in < gen_nb_xmlParserInputBufferPtr;n_in++) {
28764: for (n_len = 0;n_len < gen_nb_int;n_len++) {
28765: mem_base = xmlMemBlocks();
28766: in = gen_xmlParserInputBufferPtr(n_in, 0);
28767: len = gen_int(n_len, 1);
28768:
28769: ret_val = xmlParserInputBufferRead(in, len);
28770: desret_int(ret_val);
28771: call_tests++;
28772: des_xmlParserInputBufferPtr(n_in, in, 0);
28773: des_int(n_len, len, 1);
28774: xmlResetLastError();
28775: if (mem_base != xmlMemBlocks()) {
28776: printf("Leak of %d blocks found in xmlParserInputBufferRead",
28777: xmlMemBlocks() - mem_base);
28778: test_ret++;
28779: printf(" %d", n_in);
28780: printf(" %d", n_len);
28781: printf("\n");
28782: }
28783: }
28784: }
28785: function_tests++;
28786:
28787: return(test_ret);
28788: }
28789:
28790:
28791: static int
28792: test_xmlPopInputCallbacks(void) {
28793: int test_ret = 0;
28794:
28795: int mem_base;
28796: int ret_val;
28797:
28798: mem_base = xmlMemBlocks();
28799:
28800: ret_val = xmlPopInputCallbacks();
28801: desret_int(ret_val);
28802: call_tests++;
28803: xmlResetLastError();
28804: if (mem_base != xmlMemBlocks()) {
28805: printf("Leak of %d blocks found in xmlPopInputCallbacks",
28806: xmlMemBlocks() - mem_base);
28807: test_ret++;
28808: printf("\n");
28809: }
28810: function_tests++;
28811:
28812: return(test_ret);
28813: }
28814:
28815:
28816: static int
28817: test_xmlRegisterDefaultInputCallbacks(void) {
28818: int test_ret = 0;
28819:
28820: int mem_base;
28821:
28822: mem_base = xmlMemBlocks();
28823:
28824: xmlRegisterDefaultInputCallbacks();
28825: call_tests++;
28826: xmlResetLastError();
28827: if (mem_base != xmlMemBlocks()) {
28828: printf("Leak of %d blocks found in xmlRegisterDefaultInputCallbacks",
28829: xmlMemBlocks() - mem_base);
28830: test_ret++;
28831: printf("\n");
28832: }
28833: function_tests++;
28834:
28835: return(test_ret);
28836: }
28837:
28838:
28839: static int
28840: test_xmlRegisterDefaultOutputCallbacks(void) {
28841: int test_ret = 0;
28842:
28843: #if defined(LIBXML_OUTPUT_ENABLED)
28844: int mem_base;
28845:
28846: mem_base = xmlMemBlocks();
28847:
28848: xmlRegisterDefaultOutputCallbacks();
28849: call_tests++;
28850: xmlResetLastError();
28851: if (mem_base != xmlMemBlocks()) {
28852: printf("Leak of %d blocks found in xmlRegisterDefaultOutputCallbacks",
28853: xmlMemBlocks() - mem_base);
28854: test_ret++;
28855: printf("\n");
28856: }
28857: function_tests++;
28858: #endif
28859:
28860: return(test_ret);
28861: }
28862:
28863:
28864: static int
28865: test_xmlRegisterHTTPPostCallbacks(void) {
28866: int test_ret = 0;
28867:
28868: #if defined(LIBXML_OUTPUT_ENABLED) && defined(LIBXML_HTTP_ENABLED)
28869: int mem_base;
28870:
28871: mem_base = xmlMemBlocks();
28872:
28873: xmlRegisterHTTPPostCallbacks();
28874: call_tests++;
28875: xmlResetLastError();
28876: if (mem_base != xmlMemBlocks()) {
28877: printf("Leak of %d blocks found in xmlRegisterHTTPPostCallbacks",
28878: xmlMemBlocks() - mem_base);
28879: test_ret++;
28880: printf("\n");
28881: }
28882: function_tests++;
28883: #endif
28884:
28885: return(test_ret);
28886: }
28887:
28888: static int
28889: test_xmlIO(void) {
28890: int test_ret = 0;
28891:
28892: if (quiet == 0) printf("Testing xmlIO : 39 of 48 functions ...\n");
28893: test_ret += test_xmlAllocOutputBuffer();
28894: test_ret += test_xmlAllocParserInputBuffer();
28895: test_ret += test_xmlCheckFilename();
28896: test_ret += test_xmlCheckHTTPInput();
28897: test_ret += test_xmlCleanupInputCallbacks();
28898: test_ret += test_xmlCleanupOutputCallbacks();
28899: test_ret += test_xmlFileClose();
28900: test_ret += test_xmlFileMatch();
28901: test_ret += test_xmlFileOpen();
28902: test_ret += test_xmlFileRead();
28903: test_ret += test_xmlIOFTPClose();
28904: test_ret += test_xmlIOFTPMatch();
28905: test_ret += test_xmlIOFTPOpen();
28906: test_ret += test_xmlIOFTPRead();
28907: test_ret += test_xmlIOHTTPClose();
28908: test_ret += test_xmlIOHTTPMatch();
28909: test_ret += test_xmlIOHTTPOpen();
28910: test_ret += test_xmlIOHTTPRead();
28911: test_ret += test_xmlNoNetExternalEntityLoader();
28912: test_ret += test_xmlNormalizeWindowsPath();
28913: test_ret += test_xmlOutputBufferCreateBuffer();
28914: test_ret += test_xmlOutputBufferCreateFd();
28915: test_ret += test_xmlOutputBufferCreateFile();
28916: test_ret += test_xmlOutputBufferCreateFilename();
28917: test_ret += test_xmlOutputBufferFlush();
28918: test_ret += test_xmlOutputBufferWrite();
28919: test_ret += test_xmlOutputBufferWriteEscape();
28920: test_ret += test_xmlOutputBufferWriteString();
28921: test_ret += test_xmlParserGetDirectory();
28922: test_ret += test_xmlParserInputBufferCreateFd();
28923: test_ret += test_xmlParserInputBufferCreateFile();
28924: test_ret += test_xmlParserInputBufferCreateFilename();
28925: test_ret += test_xmlParserInputBufferCreateMem();
28926: test_ret += test_xmlParserInputBufferCreateStatic();
28927: test_ret += test_xmlParserInputBufferGrow();
28928: test_ret += test_xmlParserInputBufferPush();
28929: test_ret += test_xmlParserInputBufferRead();
28930: test_ret += test_xmlPopInputCallbacks();
28931: test_ret += test_xmlRegisterDefaultInputCallbacks();
28932: test_ret += test_xmlRegisterDefaultOutputCallbacks();
28933: test_ret += test_xmlRegisterHTTPPostCallbacks();
28934:
28935: if (test_ret != 0)
28936: printf("Module xmlIO: %d errors\n", test_ret);
28937: return(test_ret);
28938: }
28939: #ifdef LIBXML_AUTOMATA_ENABLED
28940:
28941: #define gen_nb_xmlAutomataPtr 1
28942: static xmlAutomataPtr gen_xmlAutomataPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
28943: return(NULL);
28944: }
28945: static void des_xmlAutomataPtr(int no ATTRIBUTE_UNUSED, xmlAutomataPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
28946: }
28947: #endif
28948:
28949:
28950: static int
28951: test_xmlAutomataCompile(void) {
28952: int test_ret = 0;
28953:
28954:
28955: /* missing type support */
28956: return(test_ret);
28957: }
28958:
28959:
28960: static int
28961: test_xmlAutomataGetInitState(void) {
28962: int test_ret = 0;
28963:
28964:
28965: /* missing type support */
28966: return(test_ret);
28967: }
28968:
28969:
28970: static int
28971: test_xmlAutomataIsDeterminist(void) {
28972: int test_ret = 0;
28973:
28974: #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_AUTOMATA_ENABLED)
28975: int mem_base;
28976: int ret_val;
28977: xmlAutomataPtr am; /* an automata */
28978: int n_am;
28979:
28980: for (n_am = 0;n_am < gen_nb_xmlAutomataPtr;n_am++) {
28981: mem_base = xmlMemBlocks();
28982: am = gen_xmlAutomataPtr(n_am, 0);
28983:
28984: ret_val = xmlAutomataIsDeterminist(am);
28985: desret_int(ret_val);
28986: call_tests++;
28987: des_xmlAutomataPtr(n_am, am, 0);
28988: xmlResetLastError();
28989: if (mem_base != xmlMemBlocks()) {
28990: printf("Leak of %d blocks found in xmlAutomataIsDeterminist",
28991: xmlMemBlocks() - mem_base);
28992: test_ret++;
28993: printf(" %d", n_am);
28994: printf("\n");
28995: }
28996: }
28997: function_tests++;
28998: #endif
28999:
29000: return(test_ret);
29001: }
29002:
29003: #ifdef LIBXML_AUTOMATA_ENABLED
29004:
29005: #define gen_nb_xmlAutomataStatePtr 1
29006: static xmlAutomataStatePtr gen_xmlAutomataStatePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29007: return(NULL);
29008: }
29009: static void des_xmlAutomataStatePtr(int no ATTRIBUTE_UNUSED, xmlAutomataStatePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29010: }
29011: #endif
29012:
29013:
29014: static int
29015: test_xmlAutomataNewAllTrans(void) {
29016: int test_ret = 0;
29017:
29018:
29019: /* missing type support */
29020: return(test_ret);
29021: }
29022:
29023:
29024: static int
29025: test_xmlAutomataNewCountTrans(void) {
29026: int test_ret = 0;
29027:
29028:
29029: /* missing type support */
29030: return(test_ret);
29031: }
29032:
29033:
29034: static int
29035: test_xmlAutomataNewCountTrans2(void) {
29036: int test_ret = 0;
29037:
29038:
29039: /* missing type support */
29040: return(test_ret);
29041: }
29042:
29043:
29044: static int
29045: test_xmlAutomataNewCountedTrans(void) {
29046: int test_ret = 0;
29047:
29048:
29049: /* missing type support */
29050: return(test_ret);
29051: }
29052:
29053:
29054: static int
29055: test_xmlAutomataNewCounter(void) {
29056: int test_ret = 0;
29057:
29058: #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_AUTOMATA_ENABLED)
29059: int mem_base;
29060: int ret_val;
29061: xmlAutomataPtr am; /* an automata */
29062: int n_am;
29063: int min; /* the minimal value on the counter */
29064: int n_min;
29065: int max; /* the maximal value on the counter */
29066: int n_max;
29067:
29068: for (n_am = 0;n_am < gen_nb_xmlAutomataPtr;n_am++) {
29069: for (n_min = 0;n_min < gen_nb_int;n_min++) {
29070: for (n_max = 0;n_max < gen_nb_int;n_max++) {
29071: mem_base = xmlMemBlocks();
29072: am = gen_xmlAutomataPtr(n_am, 0);
29073: min = gen_int(n_min, 1);
29074: max = gen_int(n_max, 2);
29075:
29076: ret_val = xmlAutomataNewCounter(am, min, max);
29077: desret_int(ret_val);
29078: call_tests++;
29079: des_xmlAutomataPtr(n_am, am, 0);
29080: des_int(n_min, min, 1);
29081: des_int(n_max, max, 2);
29082: xmlResetLastError();
29083: if (mem_base != xmlMemBlocks()) {
29084: printf("Leak of %d blocks found in xmlAutomataNewCounter",
29085: xmlMemBlocks() - mem_base);
29086: test_ret++;
29087: printf(" %d", n_am);
29088: printf(" %d", n_min);
29089: printf(" %d", n_max);
29090: printf("\n");
29091: }
29092: }
29093: }
29094: }
29095: function_tests++;
29096: #endif
29097:
29098: return(test_ret);
29099: }
29100:
29101:
29102: static int
29103: test_xmlAutomataNewCounterTrans(void) {
29104: int test_ret = 0;
29105:
29106:
29107: /* missing type support */
29108: return(test_ret);
29109: }
29110:
29111:
29112: static int
29113: test_xmlAutomataNewEpsilon(void) {
29114: int test_ret = 0;
29115:
29116:
29117: /* missing type support */
29118: return(test_ret);
29119: }
29120:
29121:
29122: static int
29123: test_xmlAutomataNewNegTrans(void) {
29124: int test_ret = 0;
29125:
29126:
29127: /* missing type support */
29128: return(test_ret);
29129: }
29130:
29131:
29132: static int
29133: test_xmlAutomataNewOnceTrans(void) {
29134: int test_ret = 0;
29135:
29136:
29137: /* missing type support */
29138: return(test_ret);
29139: }
29140:
29141:
29142: static int
29143: test_xmlAutomataNewOnceTrans2(void) {
29144: int test_ret = 0;
29145:
29146:
29147: /* missing type support */
29148: return(test_ret);
29149: }
29150:
29151:
29152: static int
29153: test_xmlAutomataNewState(void) {
29154: int test_ret = 0;
29155:
29156:
29157: /* missing type support */
29158: return(test_ret);
29159: }
29160:
29161:
29162: static int
29163: test_xmlAutomataNewTransition(void) {
29164: int test_ret = 0;
29165:
29166:
29167: /* missing type support */
29168: return(test_ret);
29169: }
29170:
29171:
29172: static int
29173: test_xmlAutomataNewTransition2(void) {
29174: int test_ret = 0;
29175:
29176:
29177: /* missing type support */
29178: return(test_ret);
29179: }
29180:
29181:
29182: static int
29183: test_xmlAutomataSetFinalState(void) {
29184: int test_ret = 0;
29185:
29186: #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_AUTOMATA_ENABLED)
29187: int mem_base;
29188: int ret_val;
29189: xmlAutomataPtr am; /* an automata */
29190: int n_am;
29191: xmlAutomataStatePtr state; /* a state in this automata */
29192: int n_state;
29193:
29194: for (n_am = 0;n_am < gen_nb_xmlAutomataPtr;n_am++) {
29195: for (n_state = 0;n_state < gen_nb_xmlAutomataStatePtr;n_state++) {
29196: mem_base = xmlMemBlocks();
29197: am = gen_xmlAutomataPtr(n_am, 0);
29198: state = gen_xmlAutomataStatePtr(n_state, 1);
29199:
29200: ret_val = xmlAutomataSetFinalState(am, state);
29201: desret_int(ret_val);
29202: call_tests++;
29203: des_xmlAutomataPtr(n_am, am, 0);
29204: des_xmlAutomataStatePtr(n_state, state, 1);
29205: xmlResetLastError();
29206: if (mem_base != xmlMemBlocks()) {
29207: printf("Leak of %d blocks found in xmlAutomataSetFinalState",
29208: xmlMemBlocks() - mem_base);
29209: test_ret++;
29210: printf(" %d", n_am);
29211: printf(" %d", n_state);
29212: printf("\n");
29213: }
29214: }
29215: }
29216: function_tests++;
29217: #endif
29218:
29219: return(test_ret);
29220: }
29221:
29222:
29223: static int
29224: test_xmlNewAutomata(void) {
29225: int test_ret = 0;
29226:
29227:
29228: /* missing type support */
29229: return(test_ret);
29230: }
29231:
29232: static int
29233: test_xmlautomata(void) {
29234: int test_ret = 0;
29235:
29236: if (quiet == 0) printf("Testing xmlautomata : 3 of 19 functions ...\n");
29237: test_ret += test_xmlAutomataCompile();
29238: test_ret += test_xmlAutomataGetInitState();
29239: test_ret += test_xmlAutomataIsDeterminist();
29240: test_ret += test_xmlAutomataNewAllTrans();
29241: test_ret += test_xmlAutomataNewCountTrans();
29242: test_ret += test_xmlAutomataNewCountTrans2();
29243: test_ret += test_xmlAutomataNewCountedTrans();
29244: test_ret += test_xmlAutomataNewCounter();
29245: test_ret += test_xmlAutomataNewCounterTrans();
29246: test_ret += test_xmlAutomataNewEpsilon();
29247: test_ret += test_xmlAutomataNewNegTrans();
29248: test_ret += test_xmlAutomataNewOnceTrans();
29249: test_ret += test_xmlAutomataNewOnceTrans2();
29250: test_ret += test_xmlAutomataNewState();
29251: test_ret += test_xmlAutomataNewTransition();
29252: test_ret += test_xmlAutomataNewTransition2();
29253: test_ret += test_xmlAutomataSetFinalState();
29254: test_ret += test_xmlNewAutomata();
29255:
29256: if (test_ret != 0)
29257: printf("Module xmlautomata: %d errors\n", test_ret);
29258: return(test_ret);
29259: }
29260:
29261: #define gen_nb_xmlGenericErrorFunc_ptr 1
29262: static xmlGenericErrorFunc * gen_xmlGenericErrorFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29263: return(NULL);
29264: }
29265: static void des_xmlGenericErrorFunc_ptr(int no ATTRIBUTE_UNUSED, xmlGenericErrorFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29266: }
29267:
29268: static int
29269: test_initGenericErrorDefaultFunc(void) {
29270: int test_ret = 0;
29271:
29272: int mem_base;
29273: xmlGenericErrorFunc * handler; /* the handler */
29274: int n_handler;
29275:
29276: for (n_handler = 0;n_handler < gen_nb_xmlGenericErrorFunc_ptr;n_handler++) {
29277: mem_base = xmlMemBlocks();
29278: handler = gen_xmlGenericErrorFunc_ptr(n_handler, 0);
29279:
29280: initGenericErrorDefaultFunc(handler);
29281: call_tests++;
29282: des_xmlGenericErrorFunc_ptr(n_handler, handler, 0);
29283: xmlResetLastError();
29284: if (mem_base != xmlMemBlocks()) {
29285: printf("Leak of %d blocks found in initGenericErrorDefaultFunc",
29286: xmlMemBlocks() - mem_base);
29287: test_ret++;
29288: printf(" %d", n_handler);
29289: printf("\n");
29290: }
29291: }
29292: function_tests++;
29293:
29294: return(test_ret);
29295: }
29296:
29297:
29298: #define gen_nb_xmlErrorPtr 1
29299: static xmlErrorPtr gen_xmlErrorPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29300: return(NULL);
29301: }
29302: static void des_xmlErrorPtr(int no ATTRIBUTE_UNUSED, xmlErrorPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29303: }
29304:
29305: static int
29306: test_xmlCopyError(void) {
29307: int test_ret = 0;
29308:
29309: int mem_base;
29310: int ret_val;
29311: xmlErrorPtr from; /* a source error */
29312: int n_from;
29313: xmlErrorPtr to; /* a target error */
29314: int n_to;
29315:
29316: for (n_from = 0;n_from < gen_nb_xmlErrorPtr;n_from++) {
29317: for (n_to = 0;n_to < gen_nb_xmlErrorPtr;n_to++) {
29318: mem_base = xmlMemBlocks();
29319: from = gen_xmlErrorPtr(n_from, 0);
29320: to = gen_xmlErrorPtr(n_to, 1);
29321:
29322: ret_val = xmlCopyError(from, to);
29323: desret_int(ret_val);
29324: call_tests++;
29325: des_xmlErrorPtr(n_from, from, 0);
29326: des_xmlErrorPtr(n_to, to, 1);
29327: xmlResetLastError();
29328: if (mem_base != xmlMemBlocks()) {
29329: printf("Leak of %d blocks found in xmlCopyError",
29330: xmlMemBlocks() - mem_base);
29331: test_ret++;
29332: printf(" %d", n_from);
29333: printf(" %d", n_to);
29334: printf("\n");
29335: }
29336: }
29337: }
29338: function_tests++;
29339:
29340: return(test_ret);
29341: }
29342:
29343:
29344: static int
29345: test_xmlCtxtGetLastError(void) {
29346: int test_ret = 0;
29347:
29348:
29349: /* missing type support */
29350: return(test_ret);
29351: }
29352:
29353:
29354: static int
29355: test_xmlCtxtResetLastError(void) {
29356: int test_ret = 0;
29357:
29358: int mem_base;
29359: void * ctx; /* an XML parser context */
29360: int n_ctx;
29361:
29362: for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
29363: mem_base = xmlMemBlocks();
29364: ctx = gen_void_ptr(n_ctx, 0);
29365:
29366: xmlCtxtResetLastError(ctx);
29367: call_tests++;
29368: des_void_ptr(n_ctx, ctx, 0);
29369: xmlResetLastError();
29370: if (mem_base != xmlMemBlocks()) {
29371: printf("Leak of %d blocks found in xmlCtxtResetLastError",
29372: xmlMemBlocks() - mem_base);
29373: test_ret++;
29374: printf(" %d", n_ctx);
29375: printf("\n");
29376: }
29377: }
29378: function_tests++;
29379:
29380: return(test_ret);
29381: }
29382:
29383:
29384: static int
29385: test_xmlGetLastError(void) {
29386: int test_ret = 0;
29387:
29388:
29389: /* missing type support */
29390: return(test_ret);
29391: }
29392:
29393:
29394: static int
29395: test_xmlParserError(void) {
29396: int test_ret = 0;
29397:
29398:
29399: /* missing type support */
29400: return(test_ret);
29401: }
29402:
29403:
29404: static int
29405: test_xmlParserPrintFileContext(void) {
29406: int test_ret = 0;
29407:
29408: int mem_base;
29409: xmlParserInputPtr input; /* an xmlParserInputPtr input */
29410: int n_input;
29411:
29412: for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) {
29413: mem_base = xmlMemBlocks();
29414: input = gen_xmlParserInputPtr(n_input, 0);
29415:
29416: xmlParserPrintFileContext(input);
29417: call_tests++;
29418: des_xmlParserInputPtr(n_input, input, 0);
29419: xmlResetLastError();
29420: if (mem_base != xmlMemBlocks()) {
29421: printf("Leak of %d blocks found in xmlParserPrintFileContext",
29422: xmlMemBlocks() - mem_base);
29423: test_ret++;
29424: printf(" %d", n_input);
29425: printf("\n");
29426: }
29427: }
29428: function_tests++;
29429:
29430: return(test_ret);
29431: }
29432:
29433:
29434: static int
29435: test_xmlParserPrintFileInfo(void) {
29436: int test_ret = 0;
29437:
29438: int mem_base;
29439: xmlParserInputPtr input; /* an xmlParserInputPtr input */
29440: int n_input;
29441:
29442: for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) {
29443: mem_base = xmlMemBlocks();
29444: input = gen_xmlParserInputPtr(n_input, 0);
29445:
29446: xmlParserPrintFileInfo(input);
29447: call_tests++;
29448: des_xmlParserInputPtr(n_input, input, 0);
29449: xmlResetLastError();
29450: if (mem_base != xmlMemBlocks()) {
29451: printf("Leak of %d blocks found in xmlParserPrintFileInfo",
29452: xmlMemBlocks() - mem_base);
29453: test_ret++;
29454: printf(" %d", n_input);
29455: printf("\n");
29456: }
29457: }
29458: function_tests++;
29459:
29460: return(test_ret);
29461: }
29462:
29463:
29464: static int
29465: test_xmlParserValidityError(void) {
29466: int test_ret = 0;
29467:
29468:
29469: /* missing type support */
29470: return(test_ret);
29471: }
29472:
29473:
29474: static int
29475: test_xmlParserValidityWarning(void) {
29476: int test_ret = 0;
29477:
29478:
29479: /* missing type support */
29480: return(test_ret);
29481: }
29482:
29483:
29484: static int
29485: test_xmlParserWarning(void) {
29486: int test_ret = 0;
29487:
29488:
29489: /* missing type support */
29490: return(test_ret);
29491: }
29492:
29493:
29494: static int
29495: test_xmlResetError(void) {
29496: int test_ret = 0;
29497:
29498: int mem_base;
29499: xmlErrorPtr err; /* pointer to the error. */
29500: int n_err;
29501:
29502: for (n_err = 0;n_err < gen_nb_xmlErrorPtr;n_err++) {
29503: mem_base = xmlMemBlocks();
29504: err = gen_xmlErrorPtr(n_err, 0);
29505:
29506: xmlResetError(err);
29507: call_tests++;
29508: des_xmlErrorPtr(n_err, err, 0);
29509: xmlResetLastError();
29510: if (mem_base != xmlMemBlocks()) {
29511: printf("Leak of %d blocks found in xmlResetError",
29512: xmlMemBlocks() - mem_base);
29513: test_ret++;
29514: printf(" %d", n_err);
29515: printf("\n");
29516: }
29517: }
29518: function_tests++;
29519:
29520: return(test_ret);
29521: }
29522:
29523:
29524: static int
29525: test_xmlResetLastError(void) {
29526: int test_ret = 0;
29527:
29528:
29529:
29530: xmlResetLastError();
29531: call_tests++;
29532: xmlResetLastError();
29533: function_tests++;
29534:
29535: return(test_ret);
29536: }
29537:
29538:
29539: static int
29540: test_xmlSetGenericErrorFunc(void) {
29541: int test_ret = 0;
29542:
29543:
29544: /* missing type support */
29545: return(test_ret);
29546: }
29547:
29548:
29549: static int
29550: test_xmlSetStructuredErrorFunc(void) {
29551: int test_ret = 0;
29552:
29553:
29554: /* missing type support */
29555: return(test_ret);
29556: }
29557:
29558: static int
29559: test_xmlerror(void) {
29560: int test_ret = 0;
29561:
29562: if (quiet == 0) printf("Testing xmlerror : 7 of 15 functions ...\n");
29563: test_ret += test_initGenericErrorDefaultFunc();
29564: test_ret += test_xmlCopyError();
29565: test_ret += test_xmlCtxtGetLastError();
29566: test_ret += test_xmlCtxtResetLastError();
29567: test_ret += test_xmlGetLastError();
29568: test_ret += test_xmlParserError();
29569: test_ret += test_xmlParserPrintFileContext();
29570: test_ret += test_xmlParserPrintFileInfo();
29571: test_ret += test_xmlParserValidityError();
29572: test_ret += test_xmlParserValidityWarning();
29573: test_ret += test_xmlParserWarning();
29574: test_ret += test_xmlResetError();
29575: test_ret += test_xmlResetLastError();
29576: test_ret += test_xmlSetGenericErrorFunc();
29577: test_ret += test_xmlSetStructuredErrorFunc();
29578:
29579: if (test_ret != 0)
29580: printf("Module xmlerror: %d errors\n", test_ret);
29581: return(test_ret);
29582: }
29583: #ifdef LIBXML_MODULES_ENABLED
29584:
29585: #define gen_nb_xmlModulePtr 1
29586: static xmlModulePtr gen_xmlModulePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29587: return(NULL);
29588: }
29589: static void des_xmlModulePtr(int no ATTRIBUTE_UNUSED, xmlModulePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29590: }
29591: #endif
29592:
29593:
29594: static int
29595: test_xmlModuleClose(void) {
29596: int test_ret = 0;
29597:
29598: #if defined(LIBXML_MODULES_ENABLED)
29599: int mem_base;
29600: int ret_val;
29601: xmlModulePtr module; /* the module handle */
29602: int n_module;
29603:
29604: for (n_module = 0;n_module < gen_nb_xmlModulePtr;n_module++) {
29605: mem_base = xmlMemBlocks();
29606: module = gen_xmlModulePtr(n_module, 0);
29607:
29608: ret_val = xmlModuleClose(module);
29609: desret_int(ret_val);
29610: call_tests++;
29611: des_xmlModulePtr(n_module, module, 0);
29612: xmlResetLastError();
29613: if (mem_base != xmlMemBlocks()) {
29614: printf("Leak of %d blocks found in xmlModuleClose",
29615: xmlMemBlocks() - mem_base);
29616: test_ret++;
29617: printf(" %d", n_module);
29618: printf("\n");
29619: }
29620: }
29621: function_tests++;
29622: #endif
29623:
29624: return(test_ret);
29625: }
29626:
29627:
29628: static int
29629: test_xmlModuleOpen(void) {
29630: int test_ret = 0;
29631:
29632:
29633: /* missing type support */
29634: return(test_ret);
29635: }
29636:
29637:
29638: static int
29639: test_xmlModuleSymbol(void) {
29640: int test_ret = 0;
29641:
29642: #if defined(LIBXML_MODULES_ENABLED)
29643: int mem_base;
29644: int ret_val;
29645: xmlModulePtr module; /* the module */
29646: int n_module;
29647: char * name; /* the name of the symbol */
29648: int n_name;
29649: void ** symbol; /* the resulting symbol address */
29650: int n_symbol;
29651:
29652: for (n_module = 0;n_module < gen_nb_xmlModulePtr;n_module++) {
29653: for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
29654: for (n_symbol = 0;n_symbol < gen_nb_void_ptr_ptr;n_symbol++) {
29655: mem_base = xmlMemBlocks();
29656: module = gen_xmlModulePtr(n_module, 0);
29657: name = gen_const_char_ptr(n_name, 1);
29658: symbol = gen_void_ptr_ptr(n_symbol, 2);
29659:
29660: ret_val = xmlModuleSymbol(module, (const char *)name, symbol);
29661: desret_int(ret_val);
29662: call_tests++;
29663: des_xmlModulePtr(n_module, module, 0);
29664: des_const_char_ptr(n_name, (const char *)name, 1);
29665: des_void_ptr_ptr(n_symbol, symbol, 2);
29666: xmlResetLastError();
29667: if (mem_base != xmlMemBlocks()) {
29668: printf("Leak of %d blocks found in xmlModuleSymbol",
29669: xmlMemBlocks() - mem_base);
29670: test_ret++;
29671: printf(" %d", n_module);
29672: printf(" %d", n_name);
29673: printf(" %d", n_symbol);
29674: printf("\n");
29675: }
29676: }
29677: }
29678: }
29679: function_tests++;
29680: #endif
29681:
29682: return(test_ret);
29683: }
29684:
29685: static int
29686: test_xmlmodule(void) {
29687: int test_ret = 0;
29688:
29689: if (quiet == 0) printf("Testing xmlmodule : 2 of 4 functions ...\n");
29690: test_ret += test_xmlModuleClose();
29691: test_ret += test_xmlModuleOpen();
29692: test_ret += test_xmlModuleSymbol();
29693:
29694: if (test_ret != 0)
29695: printf("Module xmlmodule: %d errors\n", test_ret);
29696: return(test_ret);
29697: }
29698:
29699: static int
29700: test_xmlNewTextReader(void) {
29701: int test_ret = 0;
29702:
29703: #if defined(LIBXML_READER_ENABLED)
29704: int mem_base;
29705: xmlTextReaderPtr ret_val;
29706: xmlParserInputBufferPtr input; /* the xmlParserInputBufferPtr used to read data */
29707: int n_input;
29708: const char * URI; /* the URI information for the source if available */
29709: int n_URI;
29710:
29711: for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
29712: for (n_URI = 0;n_URI < gen_nb_filepath;n_URI++) {
29713: mem_base = xmlMemBlocks();
29714: input = gen_xmlParserInputBufferPtr(n_input, 0);
29715: URI = gen_filepath(n_URI, 1);
29716:
29717: ret_val = xmlNewTextReader(input, URI);
29718: desret_xmlTextReaderPtr(ret_val);
29719: call_tests++;
29720: des_xmlParserInputBufferPtr(n_input, input, 0);
29721: des_filepath(n_URI, URI, 1);
29722: xmlResetLastError();
29723: if (mem_base != xmlMemBlocks()) {
29724: printf("Leak of %d blocks found in xmlNewTextReader",
29725: xmlMemBlocks() - mem_base);
29726: test_ret++;
29727: printf(" %d", n_input);
29728: printf(" %d", n_URI);
29729: printf("\n");
29730: }
29731: }
29732: }
29733: function_tests++;
29734: #endif
29735:
29736: return(test_ret);
29737: }
29738:
29739:
29740: static int
29741: test_xmlNewTextReaderFilename(void) {
29742: int test_ret = 0;
29743:
29744: #if defined(LIBXML_READER_ENABLED)
29745: int mem_base;
29746: xmlTextReaderPtr ret_val;
29747: const char * URI; /* the URI of the resource to process */
29748: int n_URI;
29749:
29750: for (n_URI = 0;n_URI < gen_nb_filepath;n_URI++) {
29751: mem_base = xmlMemBlocks();
29752: URI = gen_filepath(n_URI, 0);
29753:
29754: ret_val = xmlNewTextReaderFilename(URI);
29755: desret_xmlTextReaderPtr(ret_val);
29756: call_tests++;
29757: des_filepath(n_URI, URI, 0);
29758: xmlResetLastError();
29759: if (mem_base != xmlMemBlocks()) {
29760: printf("Leak of %d blocks found in xmlNewTextReaderFilename",
29761: xmlMemBlocks() - mem_base);
29762: test_ret++;
29763: printf(" %d", n_URI);
29764: printf("\n");
29765: }
29766: }
29767: function_tests++;
29768: #endif
29769:
29770: return(test_ret);
29771: }
29772:
29773:
29774: static int
29775: test_xmlReaderForDoc(void) {
29776: int test_ret = 0;
29777:
29778: #if defined(LIBXML_READER_ENABLED)
29779: int mem_base;
29780: xmlTextReaderPtr ret_val;
29781: xmlChar * cur; /* a pointer to a zero terminated string */
29782: int n_cur;
29783: const char * URL; /* the base URL to use for the document */
29784: int n_URL;
29785: char * encoding; /* the document encoding, or NULL */
29786: int n_encoding;
29787: int options; /* a combination of xmlParserOption */
29788: int n_options;
29789:
29790: for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
29791: for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
29792: for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
29793: for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
29794: mem_base = xmlMemBlocks();
29795: cur = gen_const_xmlChar_ptr(n_cur, 0);
29796: URL = gen_filepath(n_URL, 1);
29797: encoding = gen_const_char_ptr(n_encoding, 2);
29798: options = gen_parseroptions(n_options, 3);
29799:
29800: ret_val = xmlReaderForDoc((const xmlChar *)cur, URL, (const char *)encoding, options);
29801: desret_xmlTextReaderPtr(ret_val);
29802: call_tests++;
29803: des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
29804: des_filepath(n_URL, URL, 1);
29805: des_const_char_ptr(n_encoding, (const char *)encoding, 2);
29806: des_parseroptions(n_options, options, 3);
29807: xmlResetLastError();
29808: if (mem_base != xmlMemBlocks()) {
29809: printf("Leak of %d blocks found in xmlReaderForDoc",
29810: xmlMemBlocks() - mem_base);
29811: test_ret++;
29812: printf(" %d", n_cur);
29813: printf(" %d", n_URL);
29814: printf(" %d", n_encoding);
29815: printf(" %d", n_options);
29816: printf("\n");
29817: }
29818: }
29819: }
29820: }
29821: }
29822: function_tests++;
29823: #endif
29824:
29825: return(test_ret);
29826: }
29827:
29828:
29829: static int
29830: test_xmlReaderForFile(void) {
29831: int test_ret = 0;
29832:
29833: #if defined(LIBXML_READER_ENABLED)
29834: int mem_base;
29835: xmlTextReaderPtr ret_val;
29836: const char * filename; /* a file or URL */
29837: int n_filename;
29838: char * encoding; /* the document encoding, or NULL */
29839: int n_encoding;
29840: int options; /* a combination of xmlParserOption */
29841: int n_options;
29842:
29843: for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
29844: for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
29845: for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
29846: mem_base = xmlMemBlocks();
29847: filename = gen_filepath(n_filename, 0);
29848: encoding = gen_const_char_ptr(n_encoding, 1);
29849: options = gen_parseroptions(n_options, 2);
29850:
29851: ret_val = xmlReaderForFile(filename, (const char *)encoding, options);
29852: desret_xmlTextReaderPtr(ret_val);
29853: call_tests++;
29854: des_filepath(n_filename, filename, 0);
29855: des_const_char_ptr(n_encoding, (const char *)encoding, 1);
29856: des_parseroptions(n_options, options, 2);
29857: xmlResetLastError();
29858: if (mem_base != xmlMemBlocks()) {
29859: printf("Leak of %d blocks found in xmlReaderForFile",
29860: xmlMemBlocks() - mem_base);
29861: test_ret++;
29862: printf(" %d", n_filename);
29863: printf(" %d", n_encoding);
29864: printf(" %d", n_options);
29865: printf("\n");
29866: }
29867: }
29868: }
29869: }
29870: function_tests++;
29871: #endif
29872:
29873: return(test_ret);
29874: }
29875:
29876:
29877: static int
29878: test_xmlReaderForMemory(void) {
29879: int test_ret = 0;
29880:
29881: #if defined(LIBXML_READER_ENABLED)
29882: int mem_base;
29883: xmlTextReaderPtr ret_val;
29884: char * buffer; /* a pointer to a char array */
29885: int n_buffer;
29886: int size; /* the size of the array */
29887: int n_size;
29888: const char * URL; /* the base URL to use for the document */
29889: int n_URL;
29890: char * encoding; /* the document encoding, or NULL */
29891: int n_encoding;
29892: int options; /* a combination of xmlParserOption */
29893: int n_options;
29894:
29895: for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
29896: for (n_size = 0;n_size < gen_nb_int;n_size++) {
29897: for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
29898: for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
29899: for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
29900: mem_base = xmlMemBlocks();
29901: buffer = gen_const_char_ptr(n_buffer, 0);
29902: size = gen_int(n_size, 1);
29903: URL = gen_filepath(n_URL, 2);
29904: encoding = gen_const_char_ptr(n_encoding, 3);
29905: options = gen_parseroptions(n_options, 4);
29906:
29907: ret_val = xmlReaderForMemory((const char *)buffer, size, URL, (const char *)encoding, options);
29908: desret_xmlTextReaderPtr(ret_val);
29909: call_tests++;
29910: des_const_char_ptr(n_buffer, (const char *)buffer, 0);
29911: des_int(n_size, size, 1);
29912: des_filepath(n_URL, URL, 2);
29913: des_const_char_ptr(n_encoding, (const char *)encoding, 3);
29914: des_parseroptions(n_options, options, 4);
29915: xmlResetLastError();
29916: if (mem_base != xmlMemBlocks()) {
29917: printf("Leak of %d blocks found in xmlReaderForMemory",
29918: xmlMemBlocks() - mem_base);
29919: test_ret++;
29920: printf(" %d", n_buffer);
29921: printf(" %d", n_size);
29922: printf(" %d", n_URL);
29923: printf(" %d", n_encoding);
29924: printf(" %d", n_options);
29925: printf("\n");
29926: }
29927: }
29928: }
29929: }
29930: }
29931: }
29932: function_tests++;
29933: #endif
29934:
29935: return(test_ret);
29936: }
29937:
29938:
29939: static int
29940: test_xmlReaderNewDoc(void) {
29941: int test_ret = 0;
29942:
29943: #if defined(LIBXML_READER_ENABLED)
29944: int mem_base;
29945: int ret_val;
29946: xmlTextReaderPtr reader; /* an XML reader */
29947: int n_reader;
29948: xmlChar * cur; /* a pointer to a zero terminated string */
29949: int n_cur;
29950: const char * URL; /* the base URL to use for the document */
29951: int n_URL;
29952: char * encoding; /* the document encoding, or NULL */
29953: int n_encoding;
29954: int options; /* a combination of xmlParserOption */
29955: int n_options;
29956:
29957: for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29958: for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
29959: for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
29960: for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
29961: for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
29962: mem_base = xmlMemBlocks();
29963: reader = gen_xmlTextReaderPtr(n_reader, 0);
29964: cur = gen_const_xmlChar_ptr(n_cur, 1);
29965: URL = gen_filepath(n_URL, 2);
29966: encoding = gen_const_char_ptr(n_encoding, 3);
29967: options = gen_parseroptions(n_options, 4);
29968:
29969: ret_val = xmlReaderNewDoc(reader, (const xmlChar *)cur, URL, (const char *)encoding, options);
29970: desret_int(ret_val);
29971: call_tests++;
29972: des_xmlTextReaderPtr(n_reader, reader, 0);
29973: des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1);
29974: des_filepath(n_URL, URL, 2);
29975: des_const_char_ptr(n_encoding, (const char *)encoding, 3);
29976: des_parseroptions(n_options, options, 4);
29977: xmlResetLastError();
29978: if (mem_base != xmlMemBlocks()) {
29979: printf("Leak of %d blocks found in xmlReaderNewDoc",
29980: xmlMemBlocks() - mem_base);
29981: test_ret++;
29982: printf(" %d", n_reader);
29983: printf(" %d", n_cur);
29984: printf(" %d", n_URL);
29985: printf(" %d", n_encoding);
29986: printf(" %d", n_options);
29987: printf("\n");
29988: }
29989: }
29990: }
29991: }
29992: }
29993: }
29994: function_tests++;
29995: #endif
29996:
29997: return(test_ret);
29998: }
29999:
30000:
30001: static int
30002: test_xmlReaderNewFile(void) {
30003: int test_ret = 0;
30004:
30005: #if defined(LIBXML_READER_ENABLED)
30006: int mem_base;
30007: int ret_val;
30008: xmlTextReaderPtr reader; /* an XML reader */
30009: int n_reader;
30010: const char * filename; /* a file or URL */
30011: int n_filename;
30012: char * encoding; /* the document encoding, or NULL */
30013: int n_encoding;
30014: int options; /* a combination of xmlParserOption */
30015: int n_options;
30016:
30017: for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30018: for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
30019: for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
30020: for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
30021: mem_base = xmlMemBlocks();
30022: reader = gen_xmlTextReaderPtr(n_reader, 0);
30023: filename = gen_filepath(n_filename, 1);
30024: encoding = gen_const_char_ptr(n_encoding, 2);
30025: options = gen_parseroptions(n_options, 3);
30026:
30027: ret_val = xmlReaderNewFile(reader, filename, (const char *)encoding, options);
30028: desret_int(ret_val);
30029: call_tests++;
30030: des_xmlTextReaderPtr(n_reader, reader, 0);
30031: des_filepath(n_filename, filename, 1);
30032: des_const_char_ptr(n_encoding, (const char *)encoding, 2);
30033: des_parseroptions(n_options, options, 3);
30034: xmlResetLastError();
30035: if (mem_base != xmlMemBlocks()) {
30036: printf("Leak of %d blocks found in xmlReaderNewFile",
30037: xmlMemBlocks() - mem_base);
30038: test_ret++;
30039: printf(" %d", n_reader);
30040: printf(" %d", n_filename);
30041: printf(" %d", n_encoding);
30042: printf(" %d", n_options);
30043: printf("\n");
30044: }
30045: }
30046: }
30047: }
30048: }
30049: function_tests++;
30050: #endif
30051:
30052: return(test_ret);
30053: }
30054:
30055:
30056: static int
30057: test_xmlReaderNewMemory(void) {
30058: int test_ret = 0;
30059:
30060: #if defined(LIBXML_READER_ENABLED)
30061: int mem_base;
30062: int ret_val;
30063: xmlTextReaderPtr reader; /* an XML reader */
30064: int n_reader;
30065: char * buffer; /* a pointer to a char array */
30066: int n_buffer;
30067: int size; /* the size of the array */
30068: int n_size;
30069: const char * URL; /* the base URL to use for the document */
30070: int n_URL;
30071: char * encoding; /* the document encoding, or NULL */
30072: int n_encoding;
30073: int options; /* a combination of xmlParserOption */
30074: int n_options;
30075:
30076: for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30077: for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
30078: for (n_size = 0;n_size < gen_nb_int;n_size++) {
30079: for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
30080: for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
30081: for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
30082: mem_base = xmlMemBlocks();
30083: reader = gen_xmlTextReaderPtr(n_reader, 0);
30084: buffer = gen_const_char_ptr(n_buffer, 1);
30085: size = gen_int(n_size, 2);
30086: URL = gen_filepath(n_URL, 3);
30087: encoding = gen_const_char_ptr(n_encoding, 4);
30088: options = gen_parseroptions(n_options, 5);
30089:
30090: ret_val = xmlReaderNewMemory(reader, (const char *)buffer, size, URL, (const char *)encoding, options);
30091: desret_int(ret_val);
30092: call_tests++;
30093: des_xmlTextReaderPtr(n_reader, reader, 0);
30094: des_const_char_ptr(n_buffer, (const char *)buffer, 1);
30095: des_int(n_size, size, 2);
30096: des_filepath(n_URL, URL, 3);
30097: des_const_char_ptr(n_encoding, (const char *)encoding, 4);
30098: des_parseroptions(n_options, options, 5);
30099: xmlResetLastError();
30100: if (mem_base != xmlMemBlocks()) {
30101: printf("Leak of %d blocks found in xmlReaderNewMemory",
30102: xmlMemBlocks() - mem_base);
30103: test_ret++;
30104: printf(" %d", n_reader);
30105: printf(" %d", n_buffer);
30106: printf(" %d", n_size);
30107: printf(" %d", n_URL);
30108: printf(" %d", n_encoding);
30109: printf(" %d", n_options);
30110: printf("\n");
30111: }
30112: }
30113: }
30114: }
30115: }
30116: }
30117: }
30118: function_tests++;
30119: #endif
30120:
30121: return(test_ret);
30122: }
30123:
30124:
30125: static int
30126: test_xmlReaderNewWalker(void) {
30127: int test_ret = 0;
30128:
30129: #if defined(LIBXML_READER_ENABLED)
30130: int mem_base;
30131: int ret_val;
30132: xmlTextReaderPtr reader; /* an XML reader */
30133: int n_reader;
30134: xmlDocPtr doc; /* a preparsed document */
30135: int n_doc;
30136:
30137: for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30138: for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
30139: mem_base = xmlMemBlocks();
30140: reader = gen_xmlTextReaderPtr(n_reader, 0);
30141: doc = gen_xmlDocPtr(n_doc, 1);
30142:
30143: ret_val = xmlReaderNewWalker(reader, doc);
30144: desret_int(ret_val);
30145: call_tests++;
30146: des_xmlTextReaderPtr(n_reader, reader, 0);
30147: des_xmlDocPtr(n_doc, doc, 1);
30148: xmlResetLastError();
30149: if (mem_base != xmlMemBlocks()) {
30150: printf("Leak of %d blocks found in xmlReaderNewWalker",
30151: xmlMemBlocks() - mem_base);
30152: test_ret++;
30153: printf(" %d", n_reader);
30154: printf(" %d", n_doc);
30155: printf("\n");
30156: }
30157: }
30158: }
30159: function_tests++;
30160: #endif
30161:
30162: return(test_ret);
30163: }
30164:
30165:
30166: static int
30167: test_xmlReaderWalker(void) {
30168: int test_ret = 0;
30169:
30170: #if defined(LIBXML_READER_ENABLED)
30171: int mem_base;
30172: xmlTextReaderPtr ret_val;
30173: xmlDocPtr doc; /* a preparsed document */
30174: int n_doc;
30175:
30176: for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
30177: mem_base = xmlMemBlocks();
30178: doc = gen_xmlDocPtr(n_doc, 0);
30179:
30180: ret_val = xmlReaderWalker(doc);
30181: desret_xmlTextReaderPtr(ret_val);
30182: call_tests++;
30183: des_xmlDocPtr(n_doc, doc, 0);
30184: xmlResetLastError();
30185: if (mem_base != xmlMemBlocks()) {
30186: printf("Leak of %d blocks found in xmlReaderWalker",
30187: xmlMemBlocks() - mem_base);
30188: test_ret++;
30189: printf(" %d", n_doc);
30190: printf("\n");
30191: }
30192: }
30193: function_tests++;
30194: #endif
30195:
30196: return(test_ret);
30197: }
30198:
30199:
30200: static int
30201: test_xmlTextReaderAttributeCount(void) {
30202: int test_ret = 0;
30203:
30204: #if defined(LIBXML_READER_ENABLED)
30205: int mem_base;
30206: int ret_val;
30207: xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30208: int n_reader;
30209:
30210: for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30211: mem_base = xmlMemBlocks();
30212: reader = gen_xmlTextReaderPtr(n_reader, 0);
30213:
30214: ret_val = xmlTextReaderAttributeCount(reader);
30215: desret_int(ret_val);
30216: call_tests++;
30217: des_xmlTextReaderPtr(n_reader, reader, 0);
30218: xmlResetLastError();
30219: if (mem_base != xmlMemBlocks()) {
30220: printf("Leak of %d blocks found in xmlTextReaderAttributeCount",
30221: xmlMemBlocks() - mem_base);
30222: test_ret++;
30223: printf(" %d", n_reader);
30224: printf("\n");
30225: }
30226: }
30227: function_tests++;
30228: #endif
30229:
30230: return(test_ret);
30231: }
30232:
30233:
30234: static int
30235: test_xmlTextReaderBaseUri(void) {
30236: int test_ret = 0;
30237:
30238: #if defined(LIBXML_READER_ENABLED)
30239: int mem_base;
30240: xmlChar * ret_val;
30241: xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30242: int n_reader;
30243:
30244: for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30245: mem_base = xmlMemBlocks();
30246: reader = gen_xmlTextReaderPtr(n_reader, 0);
30247:
30248: ret_val = xmlTextReaderBaseUri(reader);
30249: desret_xmlChar_ptr(ret_val);
30250: call_tests++;
30251: des_xmlTextReaderPtr(n_reader, reader, 0);
30252: xmlResetLastError();
30253: if (mem_base != xmlMemBlocks()) {
30254: printf("Leak of %d blocks found in xmlTextReaderBaseUri",
30255: xmlMemBlocks() - mem_base);
30256: test_ret++;
30257: printf(" %d", n_reader);
30258: printf("\n");
30259: }
30260: }
30261: function_tests++;
30262: #endif
30263:
30264: return(test_ret);
30265: }
30266:
30267:
30268: static int
30269: test_xmlTextReaderByteConsumed(void) {
30270: int test_ret = 0;
30271:
30272: #if defined(LIBXML_READER_ENABLED)
30273: int mem_base;
30274: long ret_val;
30275: xmlTextReaderPtr reader; /* an XML reader */
30276: int n_reader;
30277:
30278: for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30279: mem_base = xmlMemBlocks();
30280: reader = gen_xmlTextReaderPtr(n_reader, 0);
30281:
30282: ret_val = xmlTextReaderByteConsumed(reader);
30283: desret_long(ret_val);
30284: call_tests++;
30285: des_xmlTextReaderPtr(n_reader, reader, 0);
30286: xmlResetLastError();
30287: if (mem_base != xmlMemBlocks()) {
30288: printf("Leak of %d blocks found in xmlTextReaderByteConsumed",
30289: xmlMemBlocks() - mem_base);
30290: test_ret++;
30291: printf(" %d", n_reader);
30292: printf("\n");
30293: }
30294: }
30295: function_tests++;
30296: #endif
30297:
30298: return(test_ret);
30299: }
30300:
30301:
30302: static int
30303: test_xmlTextReaderClose(void) {
30304: int test_ret = 0;
30305:
30306: #if defined(LIBXML_READER_ENABLED)
30307: int mem_base;
30308: int ret_val;
30309: xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30310: int n_reader;
30311:
30312: for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30313: mem_base = xmlMemBlocks();
30314: reader = gen_xmlTextReaderPtr(n_reader, 0);
30315:
30316: ret_val = xmlTextReaderClose(reader);
30317: desret_int(ret_val);
30318: call_tests++;
30319: des_xmlTextReaderPtr(n_reader, reader, 0);
30320: xmlResetLastError();
30321: if (mem_base != xmlMemBlocks()) {
30322: printf("Leak of %d blocks found in xmlTextReaderClose",
30323: xmlMemBlocks() - mem_base);
30324: test_ret++;
30325: printf(" %d", n_reader);
30326: printf("\n");
30327: }
30328: }
30329: function_tests++;
30330: #endif
30331:
30332: return(test_ret);
30333: }
30334:
30335:
30336: static int
30337: test_xmlTextReaderConstBaseUri(void) {
30338: int test_ret = 0;
30339:
30340: #if defined(LIBXML_READER_ENABLED)
30341: int mem_base;
30342: const xmlChar * ret_val;
30343: xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30344: int n_reader;
30345:
30346: for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30347: mem_base = xmlMemBlocks();
30348: reader = gen_xmlTextReaderPtr(n_reader, 0);
30349:
30350: ret_val = xmlTextReaderConstBaseUri(reader);
30351: desret_const_xmlChar_ptr(ret_val);
30352: call_tests++;
30353: des_xmlTextReaderPtr(n_reader, reader, 0);
30354: xmlResetLastError();
30355: if (mem_base != xmlMemBlocks()) {
30356: printf("Leak of %d blocks found in xmlTextReaderConstBaseUri",
30357: xmlMemBlocks() - mem_base);
30358: test_ret++;
30359: printf(" %d", n_reader);
30360: printf("\n");
30361: }
30362: }
30363: function_tests++;
30364: #endif
30365:
30366: return(test_ret);
30367: }
30368:
30369:
30370: static int
30371: test_xmlTextReaderConstEncoding(void) {
30372: int test_ret = 0;
30373:
30374: #if defined(LIBXML_READER_ENABLED)
30375: int mem_base;
30376: const xmlChar * ret_val;
30377: xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30378: int n_reader;
30379:
30380: for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30381: mem_base = xmlMemBlocks();
30382: reader = gen_xmlTextReaderPtr(n_reader, 0);
30383:
30384: ret_val = xmlTextReaderConstEncoding(reader);
30385: desret_const_xmlChar_ptr(ret_val);
30386: call_tests++;
30387: des_xmlTextReaderPtr(n_reader, reader, 0);
30388: xmlResetLastError();
30389: if (mem_base != xmlMemBlocks()) {
30390: printf("Leak of %d blocks found in xmlTextReaderConstEncoding",
30391: xmlMemBlocks() - mem_base);
30392: test_ret++;
30393: printf(" %d", n_reader);
30394: printf("\n");
30395: }
30396: }
30397: function_tests++;
30398: #endif
30399:
30400: return(test_ret);
30401: }
30402:
30403:
30404: static int
30405: test_xmlTextReaderConstLocalName(void) {
30406: int test_ret = 0;
30407:
30408: #if defined(LIBXML_READER_ENABLED)
30409: int mem_base;
30410: const xmlChar * ret_val;
30411: xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30412: int n_reader;
30413:
30414: for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30415: mem_base = xmlMemBlocks();
30416: reader = gen_xmlTextReaderPtr(n_reader, 0);
30417:
30418: ret_val = xmlTextReaderConstLocalName(reader);
30419: desret_const_xmlChar_ptr(ret_val);
30420: call_tests++;
30421: des_xmlTextReaderPtr(n_reader, reader, 0);
30422: xmlResetLastError();
30423: if (mem_base != xmlMemBlocks()) {
30424: printf("Leak of %d blocks found in xmlTextReaderConstLocalName",
30425: xmlMemBlocks() - mem_base);
30426: test_ret++;
30427: printf(" %d", n_reader);
30428: printf("\n");
30429: }
30430: }
30431: function_tests++;
30432: #endif
30433:
30434: return(test_ret);
30435: }
30436:
30437:
30438: static int
30439: test_xmlTextReaderConstName(void) {
30440: int test_ret = 0;
30441:
30442: #if defined(LIBXML_READER_ENABLED)
30443: int mem_base;
30444: const xmlChar * ret_val;
30445: xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30446: int n_reader;
30447:
30448: for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30449: mem_base = xmlMemBlocks();
30450: reader = gen_xmlTextReaderPtr(n_reader, 0);
30451:
30452: ret_val = xmlTextReaderConstName(reader);
30453: desret_const_xmlChar_ptr(ret_val);
30454: call_tests++;
30455: des_xmlTextReaderPtr(n_reader, reader, 0);
30456: xmlResetLastError();
30457: if (mem_base != xmlMemBlocks()) {
30458: printf("Leak of %d blocks found in xmlTextReaderConstName",
30459: xmlMemBlocks() - mem_base);
30460: test_ret++;
30461: printf(" %d", n_reader);
30462: printf("\n");
30463: }
30464: }
30465: function_tests++;
30466: #endif
30467:
30468: return(test_ret);
30469: }
30470:
30471:
30472: static int
30473: test_xmlTextReaderConstNamespaceUri(void) {
30474: int test_ret = 0;
30475:
30476: #if defined(LIBXML_READER_ENABLED)
30477: int mem_base;
30478: const xmlChar * ret_val;
30479: xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30480: int n_reader;
30481:
30482: for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30483: mem_base = xmlMemBlocks();
30484: reader = gen_xmlTextReaderPtr(n_reader, 0);
30485:
30486: ret_val = xmlTextReaderConstNamespaceUri(reader);
30487: desret_const_xmlChar_ptr(ret_val);
30488: call_tests++;
30489: des_xmlTextReaderPtr(n_reader, reader, 0);
30490: xmlResetLastError();
30491: if (mem_base != xmlMemBlocks()) {
30492: printf("Leak of %d blocks found in xmlTextReaderConstNamespaceUri",
30493: xmlMemBlocks() - mem_base);
30494: test_ret++;
30495: printf(" %d", n_reader);
30496: printf("\n");
30497: }
30498: }
30499: function_tests++;
30500: #endif
30501:
30502: return(test_ret);
30503: }
30504:
30505:
30506: static int
30507: test_xmlTextReaderConstPrefix(void) {
30508: int test_ret = 0;
30509:
30510: #if defined(LIBXML_READER_ENABLED)
30511: int mem_base;
30512: const xmlChar * ret_val;
30513: xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30514: int n_reader;
30515:
30516: for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30517: mem_base = xmlMemBlocks();
30518: reader = gen_xmlTextReaderPtr(n_reader, 0);
30519:
30520: ret_val = xmlTextReaderConstPrefix(reader);
30521: desret_const_xmlChar_ptr(ret_val);
30522: call_tests++;
30523: des_xmlTextReaderPtr(n_reader, reader, 0);
30524: xmlResetLastError();
30525: if (mem_base != xmlMemBlocks()) {
30526: printf("Leak of %d blocks found in xmlTextReaderConstPrefix",
30527: xmlMemBlocks() - mem_base);
30528: test_ret++;
30529: printf(" %d", n_reader);
30530: printf("\n");
30531: }
30532: }
30533: function_tests++;
30534: #endif
30535:
30536: return(test_ret);
30537: }
30538:
30539:
30540: static int
30541: test_xmlTextReaderConstString(void) {
30542: int test_ret = 0;
30543:
30544: #if defined(LIBXML_READER_ENABLED)
30545: int mem_base;
30546: const xmlChar * ret_val;
30547: xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30548: int n_reader;
30549: xmlChar * str; /* the string to intern. */
30550: int n_str;
30551:
30552: for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30553: for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
30554: mem_base = xmlMemBlocks();
30555: reader = gen_xmlTextReaderPtr(n_reader, 0);
30556: str = gen_const_xmlChar_ptr(n_str, 1);
30557:
30558: ret_val = xmlTextReaderConstString(reader, (const xmlChar *)str);
30559: desret_const_xmlChar_ptr(ret_val);
30560: call_tests++;
30561: des_xmlTextReaderPtr(n_reader, reader, 0);
30562: des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
30563: xmlResetLastError();
30564: if (mem_base != xmlMemBlocks()) {
30565: printf("Leak of %d blocks found in xmlTextReaderConstString",
30566: xmlMemBlocks() - mem_base);
30567: test_ret++;
30568: printf(" %d", n_reader);
30569: printf(" %d", n_str);
30570: printf("\n");
30571: }
30572: }
30573: }
30574: function_tests++;
30575: #endif
30576:
30577: return(test_ret);
30578: }
30579:
30580:
30581: static int
30582: test_xmlTextReaderConstValue(void) {
30583: int test_ret = 0;
30584:
30585: #if defined(LIBXML_READER_ENABLED)
30586: int mem_base;
30587: const xmlChar * ret_val;
30588: xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30589: int n_reader;
30590:
30591: for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30592: mem_base = xmlMemBlocks();
30593: reader = gen_xmlTextReaderPtr(n_reader, 0);
30594:
30595: ret_val = xmlTextReaderConstValue(reader);
30596: desret_const_xmlChar_ptr(ret_val);
30597: call_tests++;
30598: des_xmlTextReaderPtr(n_reader, reader, 0);
30599: xmlResetLastError();
30600: if (mem_base != xmlMemBlocks()) {
30601: printf("Leak of %d blocks found in xmlTextReaderConstValue",
30602: xmlMemBlocks() - mem_base);
30603: test_ret++;
30604: printf(" %d", n_reader);
30605: printf("\n");
30606: }
30607: }
30608: function_tests++;
30609: #endif
30610:
30611: return(test_ret);
30612: }
30613:
30614:
30615: static int
30616: test_xmlTextReaderConstXmlLang(void) {
30617: int test_ret = 0;
30618:
30619: #if defined(LIBXML_READER_ENABLED)
30620: int mem_base;
30621: const xmlChar * ret_val;
30622: xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30623: int n_reader;
30624:
30625: for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30626: mem_base = xmlMemBlocks();
30627: reader = gen_xmlTextReaderPtr(n_reader, 0);
30628:
30629: ret_val = xmlTextReaderConstXmlLang(reader);
30630: desret_const_xmlChar_ptr(ret_val);
30631: call_tests++;
30632: des_xmlTextReaderPtr(n_reader, reader, 0);
30633: xmlResetLastError();
30634: if (mem_base != xmlMemBlocks()) {
30635: printf("Leak of %d blocks found in xmlTextReaderConstXmlLang",
30636: xmlMemBlocks() - mem_base);
30637: test_ret++;
30638: printf(" %d", n_reader);
30639: printf("\n");
30640: }
30641: }
30642: function_tests++;
30643: #endif
30644:
30645: return(test_ret);
30646: }
30647:
30648:
30649: static int
30650: test_xmlTextReaderConstXmlVersion(void) {
30651: int test_ret = 0;
30652:
30653: #if defined(LIBXML_READER_ENABLED)
30654: int mem_base;
30655: const xmlChar * ret_val;
30656: xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30657: int n_reader;
30658:
30659: for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30660: mem_base = xmlMemBlocks();
30661: reader = gen_xmlTextReaderPtr(n_reader, 0);
30662:
30663: ret_val = xmlTextReaderConstXmlVersion(reader);
30664: desret_const_xmlChar_ptr(ret_val);
30665: call_tests++;
30666: des_xmlTextReaderPtr(n_reader, reader, 0);
30667: xmlResetLastError();
30668: if (mem_base != xmlMemBlocks()) {
30669: printf("Leak of %d blocks found in xmlTextReaderConstXmlVersion",
30670: xmlMemBlocks() - mem_base);
30671: test_ret++;
30672: printf(" %d", n_reader);
30673: printf("\n");
30674: }
30675: }
30676: function_tests++;
30677: #endif
30678:
30679: return(test_ret);
30680: }
30681:
30682:
30683: static int
30684: test_xmlTextReaderCurrentDoc(void) {
30685: int test_ret = 0;
30686:
30687: #if defined(LIBXML_READER_ENABLED)
30688: int mem_base;
30689: xmlDocPtr ret_val;
30690: xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30691: int n_reader;
30692:
30693: for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30694: mem_base = xmlMemBlocks();
30695: reader = gen_xmlTextReaderPtr(n_reader, 0);
30696:
30697: ret_val = xmlTextReaderCurrentDoc(reader);
30698: desret_xmlDocPtr(ret_val);
30699: call_tests++;
30700: des_xmlTextReaderPtr(n_reader, reader, 0);
30701: xmlResetLastError();
30702: if (mem_base != xmlMemBlocks()) {
30703: printf("Leak of %d blocks found in xmlTextReaderCurrentDoc",
30704: xmlMemBlocks() - mem_base);
30705: test_ret++;
30706: printf(" %d", n_reader);
30707: printf("\n");
30708: }
30709: }
30710: function_tests++;
30711: #endif
30712:
30713: return(test_ret);
30714: }
30715:
30716:
30717: static int
30718: test_xmlTextReaderCurrentNode(void) {
30719: int test_ret = 0;
30720:
30721: #if defined(LIBXML_READER_ENABLED)
30722: int mem_base;
30723: xmlNodePtr ret_val;
30724: xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30725: int n_reader;
30726:
30727: for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30728: mem_base = xmlMemBlocks();
30729: reader = gen_xmlTextReaderPtr(n_reader, 0);
30730:
30731: ret_val = xmlTextReaderCurrentNode(reader);
30732: desret_xmlNodePtr(ret_val);
30733: call_tests++;
30734: des_xmlTextReaderPtr(n_reader, reader, 0);
30735: xmlResetLastError();
30736: if (mem_base != xmlMemBlocks()) {
30737: printf("Leak of %d blocks found in xmlTextReaderCurrentNode",
30738: xmlMemBlocks() - mem_base);
30739: test_ret++;
30740: printf(" %d", n_reader);
30741: printf("\n");
30742: }
30743: }
30744: function_tests++;
30745: #endif
30746:
30747: return(test_ret);
30748: }
30749:
30750:
30751: static int
30752: test_xmlTextReaderDepth(void) {
30753: int test_ret = 0;
30754:
30755: #if defined(LIBXML_READER_ENABLED)
30756: int mem_base;
30757: int ret_val;
30758: xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30759: int n_reader;
30760:
30761: for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30762: mem_base = xmlMemBlocks();
30763: reader = gen_xmlTextReaderPtr(n_reader, 0);
30764:
30765: ret_val = xmlTextReaderDepth(reader);
30766: desret_int(ret_val);
30767: call_tests++;
30768: des_xmlTextReaderPtr(n_reader, reader, 0);
30769: xmlResetLastError();
30770: if (mem_base != xmlMemBlocks()) {
30771: printf("Leak of %d blocks found in xmlTextReaderDepth",
30772: xmlMemBlocks() - mem_base);
30773: test_ret++;
30774: printf(" %d", n_reader);
30775: printf("\n");
30776: }
30777: }
30778: function_tests++;
30779: #endif
30780:
30781: return(test_ret);
30782: }
30783:
30784:
30785: static int
30786: test_xmlTextReaderExpand(void) {
30787: int test_ret = 0;
30788:
30789: #if defined(LIBXML_READER_ENABLED)
30790: int mem_base;
30791: xmlNodePtr ret_val;
30792: xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30793: int n_reader;
30794:
30795: for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30796: mem_base = xmlMemBlocks();
30797: reader = gen_xmlTextReaderPtr(n_reader, 0);
30798:
30799: ret_val = xmlTextReaderExpand(reader);
30800: desret_xmlNodePtr(ret_val);
30801: call_tests++;
30802: des_xmlTextReaderPtr(n_reader, reader, 0);
30803: xmlResetLastError();
30804: if (mem_base != xmlMemBlocks()) {
30805: printf("Leak of %d blocks found in xmlTextReaderExpand",
30806: xmlMemBlocks() - mem_base);
30807: test_ret++;
30808: printf(" %d", n_reader);
30809: printf("\n");
30810: }
30811: }
30812: function_tests++;
30813: #endif
30814:
30815: return(test_ret);
30816: }
30817:
30818:
30819: static int
30820: test_xmlTextReaderGetAttribute(void) {
30821: int test_ret = 0;
30822:
30823: #if defined(LIBXML_READER_ENABLED)
30824: int mem_base;
30825: xmlChar * ret_val;
30826: xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30827: int n_reader;
30828: xmlChar * name; /* the qualified name of the attribute. */
30829: int n_name;
30830:
30831: for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30832: for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
30833: mem_base = xmlMemBlocks();
30834: reader = gen_xmlTextReaderPtr(n_reader, 0);
30835: name = gen_const_xmlChar_ptr(n_name, 1);
30836:
30837: ret_val = xmlTextReaderGetAttribute(reader, (const xmlChar *)name);
30838: desret_xmlChar_ptr(ret_val);
30839: call_tests++;
30840: des_xmlTextReaderPtr(n_reader, reader, 0);
30841: des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
30842: xmlResetLastError();
30843: if (mem_base != xmlMemBlocks()) {
30844: printf("Leak of %d blocks found in xmlTextReaderGetAttribute",
30845: xmlMemBlocks() - mem_base);
30846: test_ret++;
30847: printf(" %d", n_reader);
30848: printf(" %d", n_name);
30849: printf("\n");
30850: }
30851: }
30852: }
30853: function_tests++;
30854: #endif
30855:
30856: return(test_ret);
30857: }
30858:
30859:
30860: static int
30861: test_xmlTextReaderGetAttributeNo(void) {
30862: int test_ret = 0;
30863:
30864: #if defined(LIBXML_READER_ENABLED)
30865: int mem_base;
30866: xmlChar * ret_val;
30867: xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30868: int n_reader;
30869: int no; /* the zero-based index of the attribute relative to the containing element */
30870: int n_no;
30871:
30872: for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30873: for (n_no = 0;n_no < gen_nb_int;n_no++) {
30874: mem_base = xmlMemBlocks();
30875: reader = gen_xmlTextReaderPtr(n_reader, 0);
30876: no = gen_int(n_no, 1);
30877:
30878: ret_val = xmlTextReaderGetAttributeNo(reader, no);
30879: desret_xmlChar_ptr(ret_val);
30880: call_tests++;
30881: des_xmlTextReaderPtr(n_reader, reader, 0);
30882: des_int(n_no, no, 1);
30883: xmlResetLastError();
30884: if (mem_base != xmlMemBlocks()) {
30885: printf("Leak of %d blocks found in xmlTextReaderGetAttributeNo",
30886: xmlMemBlocks() - mem_base);
30887: test_ret++;
30888: printf(" %d", n_reader);
30889: printf(" %d", n_no);
30890: printf("\n");
30891: }
30892: }
30893: }
30894: function_tests++;
30895: #endif
30896:
30897: return(test_ret);
30898: }
30899:
30900:
30901: static int
30902: test_xmlTextReaderGetAttributeNs(void) {
30903: int test_ret = 0;
30904:
30905: #if defined(LIBXML_READER_ENABLED)
30906: int mem_base;
30907: xmlChar * ret_val;
30908: xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30909: int n_reader;
30910: xmlChar * localName; /* the local name of the attribute. */
30911: int n_localName;
30912: xmlChar * namespaceURI; /* the namespace URI of the attribute. */
30913: int n_namespaceURI;
30914:
30915: for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30916: for (n_localName = 0;n_localName < gen_nb_const_xmlChar_ptr;n_localName++) {
30917: for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
30918: mem_base = xmlMemBlocks();
30919: reader = gen_xmlTextReaderPtr(n_reader, 0);
30920: localName = gen_const_xmlChar_ptr(n_localName, 1);
30921: namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 2);
30922:
30923: ret_val = xmlTextReaderGetAttributeNs(reader, (const xmlChar *)localName, (const xmlChar *)namespaceURI);
30924: desret_xmlChar_ptr(ret_val);
30925: call_tests++;
30926: des_xmlTextReaderPtr(n_reader, reader, 0);
30927: des_const_xmlChar_ptr(n_localName, (const xmlChar *)localName, 1);
30928: des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 2);
30929: xmlResetLastError();
30930: if (mem_base != xmlMemBlocks()) {
30931: printf("Leak of %d blocks found in xmlTextReaderGetAttributeNs",
30932: xmlMemBlocks() - mem_base);
30933: test_ret++;
30934: printf(" %d", n_reader);
30935: printf(" %d", n_localName);
30936: printf(" %d", n_namespaceURI);
30937: printf("\n");
30938: }
30939: }
30940: }
30941: }
30942: function_tests++;
30943: #endif
30944:
30945: return(test_ret);
30946: }
30947:
30948: #ifdef LIBXML_READER_ENABLED
30949:
30950: #define gen_nb_xmlTextReaderErrorFunc_ptr 1
30951: static xmlTextReaderErrorFunc * gen_xmlTextReaderErrorFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
30952: return(NULL);
30953: }
30954: static void des_xmlTextReaderErrorFunc_ptr(int no ATTRIBUTE_UNUSED, xmlTextReaderErrorFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
30955: }
30956: #endif
30957:
30958:
30959: static int
30960: test_xmlTextReaderGetErrorHandler(void) {
30961: int test_ret = 0;
30962:
30963: #if defined(LIBXML_READER_ENABLED)
30964: int mem_base;
30965: xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30966: int n_reader;
30967: xmlTextReaderErrorFunc * f; /* the callback function or NULL is no callback has been registered */
30968: int n_f;
30969: void ** arg; /* a user argument */
30970: int n_arg;
30971:
30972: for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30973: for (n_f = 0;n_f < gen_nb_xmlTextReaderErrorFunc_ptr;n_f++) {
30974: for (n_arg = 0;n_arg < gen_nb_void_ptr_ptr;n_arg++) {
30975: mem_base = xmlMemBlocks();
30976: reader = gen_xmlTextReaderPtr(n_reader, 0);
30977: f = gen_xmlTextReaderErrorFunc_ptr(n_f, 1);
30978: arg = gen_void_ptr_ptr(n_arg, 2);
30979:
30980: xmlTextReaderGetErrorHandler(reader, f, arg);
30981: call_tests++;
30982: des_xmlTextReaderPtr(n_reader, reader, 0);
30983: des_xmlTextReaderErrorFunc_ptr(n_f, f, 1);
30984: des_void_ptr_ptr(n_arg, arg, 2);
30985: xmlResetLastError();
30986: if (mem_base != xmlMemBlocks()) {
30987: printf("Leak of %d blocks found in xmlTextReaderGetErrorHandler",
30988: xmlMemBlocks() - mem_base);
30989: test_ret++;
30990: printf(" %d", n_reader);
30991: printf(" %d", n_f);
30992: printf(" %d", n_arg);
30993: printf("\n");
30994: }
30995: }
30996: }
30997: }
30998: function_tests++;
30999: #endif
31000:
31001: return(test_ret);
31002: }
31003:
31004:
31005: static int
31006: test_xmlTextReaderGetParserColumnNumber(void) {
31007: int test_ret = 0;
31008:
31009: #if defined(LIBXML_READER_ENABLED)
31010: int mem_base;
31011: int ret_val;
31012: xmlTextReaderPtr reader; /* the user data (XML reader context) */
31013: int n_reader;
31014:
31015: for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31016: mem_base = xmlMemBlocks();
31017: reader = gen_xmlTextReaderPtr(n_reader, 0);
31018:
31019: ret_val = xmlTextReaderGetParserColumnNumber(reader);
31020: desret_int(ret_val);
31021: call_tests++;
31022: des_xmlTextReaderPtr(n_reader, reader, 0);
31023: xmlResetLastError();
31024: if (mem_base != xmlMemBlocks()) {
31025: printf("Leak of %d blocks found in xmlTextReaderGetParserColumnNumber",
31026: xmlMemBlocks() - mem_base);
31027: test_ret++;
31028: printf(" %d", n_reader);
31029: printf("\n");
31030: }
31031: }
31032: function_tests++;
31033: #endif
31034:
31035: return(test_ret);
31036: }
31037:
31038:
31039: static int
31040: test_xmlTextReaderGetParserLineNumber(void) {
31041: int test_ret = 0;
31042:
31043: #if defined(LIBXML_READER_ENABLED)
31044: int mem_base;
31045: int ret_val;
31046: xmlTextReaderPtr reader; /* the user data (XML reader context) */
31047: int n_reader;
31048:
31049: for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31050: mem_base = xmlMemBlocks();
31051: reader = gen_xmlTextReaderPtr(n_reader, 0);
31052:
31053: ret_val = xmlTextReaderGetParserLineNumber(reader);
31054: desret_int(ret_val);
31055: call_tests++;
31056: des_xmlTextReaderPtr(n_reader, reader, 0);
31057: xmlResetLastError();
31058: if (mem_base != xmlMemBlocks()) {
31059: printf("Leak of %d blocks found in xmlTextReaderGetParserLineNumber",
31060: xmlMemBlocks() - mem_base);
31061: test_ret++;
31062: printf(" %d", n_reader);
31063: printf("\n");
31064: }
31065: }
31066: function_tests++;
31067: #endif
31068:
31069: return(test_ret);
31070: }
31071:
31072:
31073: static int
31074: test_xmlTextReaderGetParserProp(void) {
31075: int test_ret = 0;
31076:
31077: #if defined(LIBXML_READER_ENABLED)
31078: int mem_base;
31079: int ret_val;
31080: xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31081: int n_reader;
31082: int prop; /* the xmlParserProperties to get */
31083: int n_prop;
31084:
31085: for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31086: for (n_prop = 0;n_prop < gen_nb_int;n_prop++) {
31087: mem_base = xmlMemBlocks();
31088: reader = gen_xmlTextReaderPtr(n_reader, 0);
31089: prop = gen_int(n_prop, 1);
31090:
31091: ret_val = xmlTextReaderGetParserProp(reader, prop);
31092: desret_int(ret_val);
31093: call_tests++;
31094: des_xmlTextReaderPtr(n_reader, reader, 0);
31095: des_int(n_prop, prop, 1);
31096: xmlResetLastError();
31097: if (mem_base != xmlMemBlocks()) {
31098: printf("Leak of %d blocks found in xmlTextReaderGetParserProp",
31099: xmlMemBlocks() - mem_base);
31100: test_ret++;
31101: printf(" %d", n_reader);
31102: printf(" %d", n_prop);
31103: printf("\n");
31104: }
31105: }
31106: }
31107: function_tests++;
31108: #endif
31109:
31110: return(test_ret);
31111: }
31112:
31113:
31114: static int
31115: test_xmlTextReaderGetRemainder(void) {
31116: int test_ret = 0;
31117:
31118: #if defined(LIBXML_READER_ENABLED)
31119: int mem_base;
31120: xmlParserInputBufferPtr ret_val;
31121: xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31122: int n_reader;
31123:
31124: for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31125: mem_base = xmlMemBlocks();
31126: reader = gen_xmlTextReaderPtr(n_reader, 0);
31127:
31128: ret_val = xmlTextReaderGetRemainder(reader);
31129: desret_xmlParserInputBufferPtr(ret_val);
31130: call_tests++;
31131: des_xmlTextReaderPtr(n_reader, reader, 0);
31132: xmlResetLastError();
31133: if (mem_base != xmlMemBlocks()) {
31134: printf("Leak of %d blocks found in xmlTextReaderGetRemainder",
31135: xmlMemBlocks() - mem_base);
31136: test_ret++;
31137: printf(" %d", n_reader);
31138: printf("\n");
31139: }
31140: }
31141: function_tests++;
31142: #endif
31143:
31144: return(test_ret);
31145: }
31146:
31147:
31148: static int
31149: test_xmlTextReaderHasAttributes(void) {
31150: int test_ret = 0;
31151:
31152: #if defined(LIBXML_READER_ENABLED)
31153: int mem_base;
31154: int ret_val;
31155: xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31156: int n_reader;
31157:
31158: for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31159: mem_base = xmlMemBlocks();
31160: reader = gen_xmlTextReaderPtr(n_reader, 0);
31161:
31162: ret_val = xmlTextReaderHasAttributes(reader);
31163: desret_int(ret_val);
31164: call_tests++;
31165: des_xmlTextReaderPtr(n_reader, reader, 0);
31166: xmlResetLastError();
31167: if (mem_base != xmlMemBlocks()) {
31168: printf("Leak of %d blocks found in xmlTextReaderHasAttributes",
31169: xmlMemBlocks() - mem_base);
31170: test_ret++;
31171: printf(" %d", n_reader);
31172: printf("\n");
31173: }
31174: }
31175: function_tests++;
31176: #endif
31177:
31178: return(test_ret);
31179: }
31180:
31181:
31182: static int
31183: test_xmlTextReaderHasValue(void) {
31184: int test_ret = 0;
31185:
31186: #if defined(LIBXML_READER_ENABLED)
31187: int mem_base;
31188: int ret_val;
31189: xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31190: int n_reader;
31191:
31192: for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31193: mem_base = xmlMemBlocks();
31194: reader = gen_xmlTextReaderPtr(n_reader, 0);
31195:
31196: ret_val = xmlTextReaderHasValue(reader);
31197: desret_int(ret_val);
31198: call_tests++;
31199: des_xmlTextReaderPtr(n_reader, reader, 0);
31200: xmlResetLastError();
31201: if (mem_base != xmlMemBlocks()) {
31202: printf("Leak of %d blocks found in xmlTextReaderHasValue",
31203: xmlMemBlocks() - mem_base);
31204: test_ret++;
31205: printf(" %d", n_reader);
31206: printf("\n");
31207: }
31208: }
31209: function_tests++;
31210: #endif
31211:
31212: return(test_ret);
31213: }
31214:
31215:
31216: static int
31217: test_xmlTextReaderIsDefault(void) {
31218: int test_ret = 0;
31219:
31220: #if defined(LIBXML_READER_ENABLED)
31221: int mem_base;
31222: int ret_val;
31223: xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31224: int n_reader;
31225:
31226: for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31227: mem_base = xmlMemBlocks();
31228: reader = gen_xmlTextReaderPtr(n_reader, 0);
31229:
31230: ret_val = xmlTextReaderIsDefault(reader);
31231: desret_int(ret_val);
31232: call_tests++;
31233: des_xmlTextReaderPtr(n_reader, reader, 0);
31234: xmlResetLastError();
31235: if (mem_base != xmlMemBlocks()) {
31236: printf("Leak of %d blocks found in xmlTextReaderIsDefault",
31237: xmlMemBlocks() - mem_base);
31238: test_ret++;
31239: printf(" %d", n_reader);
31240: printf("\n");
31241: }
31242: }
31243: function_tests++;
31244: #endif
31245:
31246: return(test_ret);
31247: }
31248:
31249:
31250: static int
31251: test_xmlTextReaderIsEmptyElement(void) {
31252: int test_ret = 0;
31253:
31254: #if defined(LIBXML_READER_ENABLED)
31255: int mem_base;
31256: int ret_val;
31257: xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31258: int n_reader;
31259:
31260: for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31261: mem_base = xmlMemBlocks();
31262: reader = gen_xmlTextReaderPtr(n_reader, 0);
31263:
31264: ret_val = xmlTextReaderIsEmptyElement(reader);
31265: desret_int(ret_val);
31266: call_tests++;
31267: des_xmlTextReaderPtr(n_reader, reader, 0);
31268: xmlResetLastError();
31269: if (mem_base != xmlMemBlocks()) {
31270: printf("Leak of %d blocks found in xmlTextReaderIsEmptyElement",
31271: xmlMemBlocks() - mem_base);
31272: test_ret++;
31273: printf(" %d", n_reader);
31274: printf("\n");
31275: }
31276: }
31277: function_tests++;
31278: #endif
31279:
31280: return(test_ret);
31281: }
31282:
31283:
31284: static int
31285: test_xmlTextReaderIsNamespaceDecl(void) {
31286: int test_ret = 0;
31287:
31288: #if defined(LIBXML_READER_ENABLED)
31289: int mem_base;
31290: int ret_val;
31291: xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31292: int n_reader;
31293:
31294: for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31295: mem_base = xmlMemBlocks();
31296: reader = gen_xmlTextReaderPtr(n_reader, 0);
31297:
31298: ret_val = xmlTextReaderIsNamespaceDecl(reader);
31299: desret_int(ret_val);
31300: call_tests++;
31301: des_xmlTextReaderPtr(n_reader, reader, 0);
31302: xmlResetLastError();
31303: if (mem_base != xmlMemBlocks()) {
31304: printf("Leak of %d blocks found in xmlTextReaderIsNamespaceDecl",
31305: xmlMemBlocks() - mem_base);
31306: test_ret++;
31307: printf(" %d", n_reader);
31308: printf("\n");
31309: }
31310: }
31311: function_tests++;
31312: #endif
31313:
31314: return(test_ret);
31315: }
31316:
31317:
31318: static int
31319: test_xmlTextReaderIsValid(void) {
31320: int test_ret = 0;
31321:
31322: #if defined(LIBXML_READER_ENABLED)
31323: int mem_base;
31324: int ret_val;
31325: xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31326: int n_reader;
31327:
31328: for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31329: mem_base = xmlMemBlocks();
31330: reader = gen_xmlTextReaderPtr(n_reader, 0);
31331:
31332: ret_val = xmlTextReaderIsValid(reader);
31333: desret_int(ret_val);
31334: call_tests++;
31335: des_xmlTextReaderPtr(n_reader, reader, 0);
31336: xmlResetLastError();
31337: if (mem_base != xmlMemBlocks()) {
31338: printf("Leak of %d blocks found in xmlTextReaderIsValid",
31339: xmlMemBlocks() - mem_base);
31340: test_ret++;
31341: printf(" %d", n_reader);
31342: printf("\n");
31343: }
31344: }
31345: function_tests++;
31346: #endif
31347:
31348: return(test_ret);
31349: }
31350:
31351:
31352: static int
31353: test_xmlTextReaderLocalName(void) {
31354: int test_ret = 0;
31355:
31356: #if defined(LIBXML_READER_ENABLED)
31357: int mem_base;
31358: xmlChar * ret_val;
31359: xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31360: int n_reader;
31361:
31362: for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31363: mem_base = xmlMemBlocks();
31364: reader = gen_xmlTextReaderPtr(n_reader, 0);
31365:
31366: ret_val = xmlTextReaderLocalName(reader);
31367: desret_xmlChar_ptr(ret_val);
31368: call_tests++;
31369: des_xmlTextReaderPtr(n_reader, reader, 0);
31370: xmlResetLastError();
31371: if (mem_base != xmlMemBlocks()) {
31372: printf("Leak of %d blocks found in xmlTextReaderLocalName",
31373: xmlMemBlocks() - mem_base);
31374: test_ret++;
31375: printf(" %d", n_reader);
31376: printf("\n");
31377: }
31378: }
31379: function_tests++;
31380: #endif
31381:
31382: return(test_ret);
31383: }
31384:
31385: #ifdef LIBXML_READER_ENABLED
31386:
31387: #define gen_nb_xmlTextReaderLocatorPtr 1
31388: static xmlTextReaderLocatorPtr gen_xmlTextReaderLocatorPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
31389: return(NULL);
31390: }
31391: static void des_xmlTextReaderLocatorPtr(int no ATTRIBUTE_UNUSED, xmlTextReaderLocatorPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
31392: }
31393: #endif
31394:
31395:
31396: static int
31397: test_xmlTextReaderLocatorBaseURI(void) {
31398: int test_ret = 0;
31399:
31400: #if defined(LIBXML_READER_ENABLED)
31401: int mem_base;
31402: xmlChar * ret_val;
31403: xmlTextReaderLocatorPtr locator; /* the xmlTextReaderLocatorPtr used */
31404: int n_locator;
31405:
31406: for (n_locator = 0;n_locator < gen_nb_xmlTextReaderLocatorPtr;n_locator++) {
31407: mem_base = xmlMemBlocks();
31408: locator = gen_xmlTextReaderLocatorPtr(n_locator, 0);
31409:
31410: ret_val = xmlTextReaderLocatorBaseURI(locator);
31411: desret_xmlChar_ptr(ret_val);
31412: call_tests++;
31413: des_xmlTextReaderLocatorPtr(n_locator, locator, 0);
31414: xmlResetLastError();
31415: if (mem_base != xmlMemBlocks()) {
31416: printf("Leak of %d blocks found in xmlTextReaderLocatorBaseURI",
31417: xmlMemBlocks() - mem_base);
31418: test_ret++;
31419: printf(" %d", n_locator);
31420: printf("\n");
31421: }
31422: }
31423: function_tests++;
31424: #endif
31425:
31426: return(test_ret);
31427: }
31428:
31429:
31430: static int
31431: test_xmlTextReaderLocatorLineNumber(void) {
31432: int test_ret = 0;
31433:
31434: #if defined(LIBXML_READER_ENABLED)
31435: int mem_base;
31436: int ret_val;
31437: xmlTextReaderLocatorPtr locator; /* the xmlTextReaderLocatorPtr used */
31438: int n_locator;
31439:
31440: for (n_locator = 0;n_locator < gen_nb_xmlTextReaderLocatorPtr;n_locator++) {
31441: mem_base = xmlMemBlocks();
31442: locator = gen_xmlTextReaderLocatorPtr(n_locator, 0);
31443:
31444: ret_val = xmlTextReaderLocatorLineNumber(locator);
31445: desret_int(ret_val);
31446: call_tests++;
31447: des_xmlTextReaderLocatorPtr(n_locator, locator, 0);
31448: xmlResetLastError();
31449: if (mem_base != xmlMemBlocks()) {
31450: printf("Leak of %d blocks found in xmlTextReaderLocatorLineNumber",
31451: xmlMemBlocks() - mem_base);
31452: test_ret++;
31453: printf(" %d", n_locator);
31454: printf("\n");
31455: }
31456: }
31457: function_tests++;
31458: #endif
31459:
31460: return(test_ret);
31461: }
31462:
31463:
31464: static int
31465: test_xmlTextReaderLookupNamespace(void) {
31466: int test_ret = 0;
31467:
31468: #if defined(LIBXML_READER_ENABLED)
31469: int mem_base;
31470: xmlChar * ret_val;
31471: xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31472: int n_reader;
31473: xmlChar * prefix; /* the prefix whose namespace URI is to be resolved. To return the default namespace, specify NULL */
31474: int n_prefix;
31475:
31476: for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31477: for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
31478: mem_base = xmlMemBlocks();
31479: reader = gen_xmlTextReaderPtr(n_reader, 0);
31480: prefix = gen_const_xmlChar_ptr(n_prefix, 1);
31481:
31482: ret_val = xmlTextReaderLookupNamespace(reader, (const xmlChar *)prefix);
31483: desret_xmlChar_ptr(ret_val);
31484: call_tests++;
31485: des_xmlTextReaderPtr(n_reader, reader, 0);
31486: des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
31487: xmlResetLastError();
31488: if (mem_base != xmlMemBlocks()) {
31489: printf("Leak of %d blocks found in xmlTextReaderLookupNamespace",
31490: xmlMemBlocks() - mem_base);
31491: test_ret++;
31492: printf(" %d", n_reader);
31493: printf(" %d", n_prefix);
31494: printf("\n");
31495: }
31496: }
31497: }
31498: function_tests++;
31499: #endif
31500:
31501: return(test_ret);
31502: }
31503:
31504:
31505: static int
31506: test_xmlTextReaderMoveToAttribute(void) {
31507: int test_ret = 0;
31508:
31509: #if defined(LIBXML_READER_ENABLED)
31510: int mem_base;
31511: int ret_val;
31512: xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31513: int n_reader;
31514: xmlChar * name; /* the qualified name of the attribute. */
31515: int n_name;
31516:
31517: for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31518: for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
31519: mem_base = xmlMemBlocks();
31520: reader = gen_xmlTextReaderPtr(n_reader, 0);
31521: name = gen_const_xmlChar_ptr(n_name, 1);
31522:
31523: ret_val = xmlTextReaderMoveToAttribute(reader, (const xmlChar *)name);
31524: desret_int(ret_val);
31525: call_tests++;
31526: des_xmlTextReaderPtr(n_reader, reader, 0);
31527: des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
31528: xmlResetLastError();
31529: if (mem_base != xmlMemBlocks()) {
31530: printf("Leak of %d blocks found in xmlTextReaderMoveToAttribute",
31531: xmlMemBlocks() - mem_base);
31532: test_ret++;
31533: printf(" %d", n_reader);
31534: printf(" %d", n_name);
31535: printf("\n");
31536: }
31537: }
31538: }
31539: function_tests++;
31540: #endif
31541:
31542: return(test_ret);
31543: }
31544:
31545:
31546: static int
31547: test_xmlTextReaderMoveToAttributeNo(void) {
31548: int test_ret = 0;
31549:
31550: #if defined(LIBXML_READER_ENABLED)
31551: int mem_base;
31552: int ret_val;
31553: xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31554: int n_reader;
31555: int no; /* the zero-based index of the attribute relative to the containing element. */
31556: int n_no;
31557:
31558: for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31559: for (n_no = 0;n_no < gen_nb_int;n_no++) {
31560: mem_base = xmlMemBlocks();
31561: reader = gen_xmlTextReaderPtr(n_reader, 0);
31562: no = gen_int(n_no, 1);
31563:
31564: ret_val = xmlTextReaderMoveToAttributeNo(reader, no);
31565: desret_int(ret_val);
31566: call_tests++;
31567: des_xmlTextReaderPtr(n_reader, reader, 0);
31568: des_int(n_no, no, 1);
31569: xmlResetLastError();
31570: if (mem_base != xmlMemBlocks()) {
31571: printf("Leak of %d blocks found in xmlTextReaderMoveToAttributeNo",
31572: xmlMemBlocks() - mem_base);
31573: test_ret++;
31574: printf(" %d", n_reader);
31575: printf(" %d", n_no);
31576: printf("\n");
31577: }
31578: }
31579: }
31580: function_tests++;
31581: #endif
31582:
31583: return(test_ret);
31584: }
31585:
31586:
31587: static int
31588: test_xmlTextReaderMoveToAttributeNs(void) {
31589: int test_ret = 0;
31590:
31591: #if defined(LIBXML_READER_ENABLED)
31592: int mem_base;
31593: int ret_val;
31594: xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31595: int n_reader;
31596: xmlChar * localName; /* the local name of the attribute. */
31597: int n_localName;
31598: xmlChar * namespaceURI; /* the namespace URI of the attribute. */
31599: int n_namespaceURI;
31600:
31601: for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31602: for (n_localName = 0;n_localName < gen_nb_const_xmlChar_ptr;n_localName++) {
31603: for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
31604: mem_base = xmlMemBlocks();
31605: reader = gen_xmlTextReaderPtr(n_reader, 0);
31606: localName = gen_const_xmlChar_ptr(n_localName, 1);
31607: namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 2);
31608:
31609: ret_val = xmlTextReaderMoveToAttributeNs(reader, (const xmlChar *)localName, (const xmlChar *)namespaceURI);
31610: desret_int(ret_val);
31611: call_tests++;
31612: des_xmlTextReaderPtr(n_reader, reader, 0);
31613: des_const_xmlChar_ptr(n_localName, (const xmlChar *)localName, 1);
31614: des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 2);
31615: xmlResetLastError();
31616: if (mem_base != xmlMemBlocks()) {
31617: printf("Leak of %d blocks found in xmlTextReaderMoveToAttributeNs",
31618: xmlMemBlocks() - mem_base);
31619: test_ret++;
31620: printf(" %d", n_reader);
31621: printf(" %d", n_localName);
31622: printf(" %d", n_namespaceURI);
31623: printf("\n");
31624: }
31625: }
31626: }
31627: }
31628: function_tests++;
31629: #endif
31630:
31631: return(test_ret);
31632: }
31633:
31634:
31635: static int
31636: test_xmlTextReaderMoveToElement(void) {
31637: int test_ret = 0;
31638:
31639: #if defined(LIBXML_READER_ENABLED)
31640: int mem_base;
31641: int ret_val;
31642: xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31643: int n_reader;
31644:
31645: for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31646: mem_base = xmlMemBlocks();
31647: reader = gen_xmlTextReaderPtr(n_reader, 0);
31648:
31649: ret_val = xmlTextReaderMoveToElement(reader);
31650: desret_int(ret_val);
31651: call_tests++;
31652: des_xmlTextReaderPtr(n_reader, reader, 0);
31653: xmlResetLastError();
31654: if (mem_base != xmlMemBlocks()) {
31655: printf("Leak of %d blocks found in xmlTextReaderMoveToElement",
31656: xmlMemBlocks() - mem_base);
31657: test_ret++;
31658: printf(" %d", n_reader);
31659: printf("\n");
31660: }
31661: }
31662: function_tests++;
31663: #endif
31664:
31665: return(test_ret);
31666: }
31667:
31668:
31669: static int
31670: test_xmlTextReaderMoveToFirstAttribute(void) {
31671: int test_ret = 0;
31672:
31673: #if defined(LIBXML_READER_ENABLED)
31674: int mem_base;
31675: int ret_val;
31676: xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31677: int n_reader;
31678:
31679: for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31680: mem_base = xmlMemBlocks();
31681: reader = gen_xmlTextReaderPtr(n_reader, 0);
31682:
31683: ret_val = xmlTextReaderMoveToFirstAttribute(reader);
31684: desret_int(ret_val);
31685: call_tests++;
31686: des_xmlTextReaderPtr(n_reader, reader, 0);
31687: xmlResetLastError();
31688: if (mem_base != xmlMemBlocks()) {
31689: printf("Leak of %d blocks found in xmlTextReaderMoveToFirstAttribute",
31690: xmlMemBlocks() - mem_base);
31691: test_ret++;
31692: printf(" %d", n_reader);
31693: printf("\n");
31694: }
31695: }
31696: function_tests++;
31697: #endif
31698:
31699: return(test_ret);
31700: }
31701:
31702:
31703: static int
31704: test_xmlTextReaderMoveToNextAttribute(void) {
31705: int test_ret = 0;
31706:
31707: #if defined(LIBXML_READER_ENABLED)
31708: int mem_base;
31709: int ret_val;
31710: xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31711: int n_reader;
31712:
31713: for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31714: mem_base = xmlMemBlocks();
31715: reader = gen_xmlTextReaderPtr(n_reader, 0);
31716:
31717: ret_val = xmlTextReaderMoveToNextAttribute(reader);
31718: desret_int(ret_val);
31719: call_tests++;
31720: des_xmlTextReaderPtr(n_reader, reader, 0);
31721: xmlResetLastError();
31722: if (mem_base != xmlMemBlocks()) {
31723: printf("Leak of %d blocks found in xmlTextReaderMoveToNextAttribute",
31724: xmlMemBlocks() - mem_base);
31725: test_ret++;
31726: printf(" %d", n_reader);
31727: printf("\n");
31728: }
31729: }
31730: function_tests++;
31731: #endif
31732:
31733: return(test_ret);
31734: }
31735:
31736:
31737: static int
31738: test_xmlTextReaderName(void) {
31739: int test_ret = 0;
31740:
31741: #if defined(LIBXML_READER_ENABLED)
31742: int mem_base;
31743: xmlChar * ret_val;
31744: xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31745: int n_reader;
31746:
31747: for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31748: mem_base = xmlMemBlocks();
31749: reader = gen_xmlTextReaderPtr(n_reader, 0);
31750:
31751: ret_val = xmlTextReaderName(reader);
31752: desret_xmlChar_ptr(ret_val);
31753: call_tests++;
31754: des_xmlTextReaderPtr(n_reader, reader, 0);
31755: xmlResetLastError();
31756: if (mem_base != xmlMemBlocks()) {
31757: printf("Leak of %d blocks found in xmlTextReaderName",
31758: xmlMemBlocks() - mem_base);
31759: test_ret++;
31760: printf(" %d", n_reader);
31761: printf("\n");
31762: }
31763: }
31764: function_tests++;
31765: #endif
31766:
31767: return(test_ret);
31768: }
31769:
31770:
31771: static int
31772: test_xmlTextReaderNamespaceUri(void) {
31773: int test_ret = 0;
31774:
31775: #if defined(LIBXML_READER_ENABLED)
31776: int mem_base;
31777: xmlChar * ret_val;
31778: xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31779: int n_reader;
31780:
31781: for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31782: mem_base = xmlMemBlocks();
31783: reader = gen_xmlTextReaderPtr(n_reader, 0);
31784:
31785: ret_val = xmlTextReaderNamespaceUri(reader);
31786: desret_xmlChar_ptr(ret_val);
31787: call_tests++;
31788: des_xmlTextReaderPtr(n_reader, reader, 0);
31789: xmlResetLastError();
31790: if (mem_base != xmlMemBlocks()) {
31791: printf("Leak of %d blocks found in xmlTextReaderNamespaceUri",
31792: xmlMemBlocks() - mem_base);
31793: test_ret++;
31794: printf(" %d", n_reader);
31795: printf("\n");
31796: }
31797: }
31798: function_tests++;
31799: #endif
31800:
31801: return(test_ret);
31802: }
31803:
31804:
31805: static int
31806: test_xmlTextReaderNext(void) {
31807: int test_ret = 0;
31808:
31809: #if defined(LIBXML_READER_ENABLED)
31810: int mem_base;
31811: int ret_val;
31812: xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31813: int n_reader;
31814:
31815: for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31816: mem_base = xmlMemBlocks();
31817: reader = gen_xmlTextReaderPtr(n_reader, 0);
31818:
31819: ret_val = xmlTextReaderNext(reader);
31820: desret_int(ret_val);
31821: call_tests++;
31822: des_xmlTextReaderPtr(n_reader, reader, 0);
31823: xmlResetLastError();
31824: if (mem_base != xmlMemBlocks()) {
31825: printf("Leak of %d blocks found in xmlTextReaderNext",
31826: xmlMemBlocks() - mem_base);
31827: test_ret++;
31828: printf(" %d", n_reader);
31829: printf("\n");
31830: }
31831: }
31832: function_tests++;
31833: #endif
31834:
31835: return(test_ret);
31836: }
31837:
31838:
31839: static int
31840: test_xmlTextReaderNextSibling(void) {
31841: int test_ret = 0;
31842:
31843: #if defined(LIBXML_READER_ENABLED)
31844: int mem_base;
31845: int ret_val;
31846: xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31847: int n_reader;
31848:
31849: for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31850: mem_base = xmlMemBlocks();
31851: reader = gen_xmlTextReaderPtr(n_reader, 0);
31852:
31853: ret_val = xmlTextReaderNextSibling(reader);
31854: desret_int(ret_val);
31855: call_tests++;
31856: des_xmlTextReaderPtr(n_reader, reader, 0);
31857: xmlResetLastError();
31858: if (mem_base != xmlMemBlocks()) {
31859: printf("Leak of %d blocks found in xmlTextReaderNextSibling",
31860: xmlMemBlocks() - mem_base);
31861: test_ret++;
31862: printf(" %d", n_reader);
31863: printf("\n");
31864: }
31865: }
31866: function_tests++;
31867: #endif
31868:
31869: return(test_ret);
31870: }
31871:
31872:
31873: static int
31874: test_xmlTextReaderNodeType(void) {
31875: int test_ret = 0;
31876:
31877: #if defined(LIBXML_READER_ENABLED)
31878: int mem_base;
31879: int ret_val;
31880: xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31881: int n_reader;
31882:
31883: for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31884: mem_base = xmlMemBlocks();
31885: reader = gen_xmlTextReaderPtr(n_reader, 0);
31886:
31887: ret_val = xmlTextReaderNodeType(reader);
31888: desret_int(ret_val);
31889: call_tests++;
31890: des_xmlTextReaderPtr(n_reader, reader, 0);
31891: xmlResetLastError();
31892: if (mem_base != xmlMemBlocks()) {
31893: printf("Leak of %d blocks found in xmlTextReaderNodeType",
31894: xmlMemBlocks() - mem_base);
31895: test_ret++;
31896: printf(" %d", n_reader);
31897: printf("\n");
31898: }
31899: }
31900: function_tests++;
31901: #endif
31902:
31903: return(test_ret);
31904: }
31905:
31906:
31907: static int
31908: test_xmlTextReaderNormalization(void) {
31909: int test_ret = 0;
31910:
31911: #if defined(LIBXML_READER_ENABLED)
31912: int mem_base;
31913: int ret_val;
31914: xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31915: int n_reader;
31916:
31917: for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31918: mem_base = xmlMemBlocks();
31919: reader = gen_xmlTextReaderPtr(n_reader, 0);
31920:
31921: ret_val = xmlTextReaderNormalization(reader);
31922: desret_int(ret_val);
31923: call_tests++;
31924: des_xmlTextReaderPtr(n_reader, reader, 0);
31925: xmlResetLastError();
31926: if (mem_base != xmlMemBlocks()) {
31927: printf("Leak of %d blocks found in xmlTextReaderNormalization",
31928: xmlMemBlocks() - mem_base);
31929: test_ret++;
31930: printf(" %d", n_reader);
31931: printf("\n");
31932: }
31933: }
31934: function_tests++;
31935: #endif
31936:
31937: return(test_ret);
31938: }
31939:
31940:
31941: static int
31942: test_xmlTextReaderPrefix(void) {
31943: int test_ret = 0;
31944:
31945: #if defined(LIBXML_READER_ENABLED)
31946: int mem_base;
31947: xmlChar * ret_val;
31948: xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31949: int n_reader;
31950:
31951: for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31952: mem_base = xmlMemBlocks();
31953: reader = gen_xmlTextReaderPtr(n_reader, 0);
31954:
31955: ret_val = xmlTextReaderPrefix(reader);
31956: desret_xmlChar_ptr(ret_val);
31957: call_tests++;
31958: des_xmlTextReaderPtr(n_reader, reader, 0);
31959: xmlResetLastError();
31960: if (mem_base != xmlMemBlocks()) {
31961: printf("Leak of %d blocks found in xmlTextReaderPrefix",
31962: xmlMemBlocks() - mem_base);
31963: test_ret++;
31964: printf(" %d", n_reader);
31965: printf("\n");
31966: }
31967: }
31968: function_tests++;
31969: #endif
31970:
31971: return(test_ret);
31972: }
31973:
31974:
31975: static int
31976: test_xmlTextReaderPreserve(void) {
31977: int test_ret = 0;
31978:
31979: #if defined(LIBXML_READER_ENABLED)
31980: int mem_base;
31981: xmlNodePtr ret_val;
31982: xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31983: int n_reader;
31984:
31985: for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31986: mem_base = xmlMemBlocks();
31987: reader = gen_xmlTextReaderPtr(n_reader, 0);
31988:
31989: ret_val = xmlTextReaderPreserve(reader);
31990: desret_xmlNodePtr(ret_val);
31991: call_tests++;
31992: des_xmlTextReaderPtr(n_reader, reader, 0);
31993: xmlResetLastError();
31994: if (mem_base != xmlMemBlocks()) {
31995: printf("Leak of %d blocks found in xmlTextReaderPreserve",
31996: xmlMemBlocks() - mem_base);
31997: test_ret++;
31998: printf(" %d", n_reader);
31999: printf("\n");
32000: }
32001: }
32002: function_tests++;
32003: #endif
32004:
32005: return(test_ret);
32006: }
32007:
32008:
32009: static int
32010: test_xmlTextReaderPreservePattern(void) {
32011: int test_ret = 0;
32012:
32013: #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_PATTERN_ENABLED)
32014: #ifdef LIBXML_PATTERN_ENABLED
32015: int mem_base;
32016: int ret_val;
32017: xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32018: int n_reader;
32019: xmlChar * pattern; /* an XPath subset pattern */
32020: int n_pattern;
32021: xmlChar ** namespaces; /* the prefix definitions, array of [URI, prefix] or NULL */
32022: int n_namespaces;
32023:
32024: for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32025: for (n_pattern = 0;n_pattern < gen_nb_const_xmlChar_ptr;n_pattern++) {
32026: for (n_namespaces = 0;n_namespaces < gen_nb_const_xmlChar_ptr_ptr;n_namespaces++) {
32027: mem_base = xmlMemBlocks();
32028: reader = gen_xmlTextReaderPtr(n_reader, 0);
32029: pattern = gen_const_xmlChar_ptr(n_pattern, 1);
32030: namespaces = gen_const_xmlChar_ptr_ptr(n_namespaces, 2);
32031:
32032: ret_val = xmlTextReaderPreservePattern(reader, (const xmlChar *)pattern, (const xmlChar **)namespaces);
32033: desret_int(ret_val);
32034: call_tests++;
32035: des_xmlTextReaderPtr(n_reader, reader, 0);
32036: des_const_xmlChar_ptr(n_pattern, (const xmlChar *)pattern, 1);
32037: des_const_xmlChar_ptr_ptr(n_namespaces, (const xmlChar **)namespaces, 2);
32038: xmlResetLastError();
32039: if (mem_base != xmlMemBlocks()) {
32040: printf("Leak of %d blocks found in xmlTextReaderPreservePattern",
32041: xmlMemBlocks() - mem_base);
32042: test_ret++;
32043: printf(" %d", n_reader);
32044: printf(" %d", n_pattern);
32045: printf(" %d", n_namespaces);
32046: printf("\n");
32047: }
32048: }
32049: }
32050: }
32051: function_tests++;
32052: #endif
32053: #endif
32054:
32055: return(test_ret);
32056: }
32057:
32058:
32059: static int
32060: test_xmlTextReaderQuoteChar(void) {
32061: int test_ret = 0;
32062:
32063: #if defined(LIBXML_READER_ENABLED)
32064: int mem_base;
32065: int ret_val;
32066: xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32067: int n_reader;
32068:
32069: for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32070: mem_base = xmlMemBlocks();
32071: reader = gen_xmlTextReaderPtr(n_reader, 0);
32072:
32073: ret_val = xmlTextReaderQuoteChar(reader);
32074: desret_int(ret_val);
32075: call_tests++;
32076: des_xmlTextReaderPtr(n_reader, reader, 0);
32077: xmlResetLastError();
32078: if (mem_base != xmlMemBlocks()) {
32079: printf("Leak of %d blocks found in xmlTextReaderQuoteChar",
32080: xmlMemBlocks() - mem_base);
32081: test_ret++;
32082: printf(" %d", n_reader);
32083: printf("\n");
32084: }
32085: }
32086: function_tests++;
32087: #endif
32088:
32089: return(test_ret);
32090: }
32091:
32092:
32093: static int
32094: test_xmlTextReaderRead(void) {
32095: int test_ret = 0;
32096:
32097: #if defined(LIBXML_READER_ENABLED)
32098: int mem_base;
32099: int ret_val;
32100: xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32101: int n_reader;
32102:
32103: for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32104: mem_base = xmlMemBlocks();
32105: reader = gen_xmlTextReaderPtr(n_reader, 0);
32106:
32107: ret_val = xmlTextReaderRead(reader);
32108: desret_int(ret_val);
32109: call_tests++;
32110: des_xmlTextReaderPtr(n_reader, reader, 0);
32111: xmlResetLastError();
32112: if (mem_base != xmlMemBlocks()) {
32113: printf("Leak of %d blocks found in xmlTextReaderRead",
32114: xmlMemBlocks() - mem_base);
32115: test_ret++;
32116: printf(" %d", n_reader);
32117: printf("\n");
32118: }
32119: }
32120: function_tests++;
32121: #endif
32122:
32123: return(test_ret);
32124: }
32125:
32126:
32127: static int
32128: test_xmlTextReaderReadAttributeValue(void) {
32129: int test_ret = 0;
32130:
32131: #if defined(LIBXML_READER_ENABLED)
32132: int mem_base;
32133: int ret_val;
32134: xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32135: int n_reader;
32136:
32137: for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32138: mem_base = xmlMemBlocks();
32139: reader = gen_xmlTextReaderPtr(n_reader, 0);
32140:
32141: ret_val = xmlTextReaderReadAttributeValue(reader);
32142: desret_int(ret_val);
32143: call_tests++;
32144: des_xmlTextReaderPtr(n_reader, reader, 0);
32145: xmlResetLastError();
32146: if (mem_base != xmlMemBlocks()) {
32147: printf("Leak of %d blocks found in xmlTextReaderReadAttributeValue",
32148: xmlMemBlocks() - mem_base);
32149: test_ret++;
32150: printf(" %d", n_reader);
32151: printf("\n");
32152: }
32153: }
32154: function_tests++;
32155: #endif
32156:
32157: return(test_ret);
32158: }
32159:
32160:
32161: static int
32162: test_xmlTextReaderReadState(void) {
32163: int test_ret = 0;
32164:
32165: #if defined(LIBXML_READER_ENABLED)
32166: int mem_base;
32167: int ret_val;
32168: xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32169: int n_reader;
32170:
32171: for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32172: mem_base = xmlMemBlocks();
32173: reader = gen_xmlTextReaderPtr(n_reader, 0);
32174:
32175: ret_val = xmlTextReaderReadState(reader);
32176: desret_int(ret_val);
32177: call_tests++;
32178: des_xmlTextReaderPtr(n_reader, reader, 0);
32179: xmlResetLastError();
32180: if (mem_base != xmlMemBlocks()) {
32181: printf("Leak of %d blocks found in xmlTextReaderReadState",
32182: xmlMemBlocks() - mem_base);
32183: test_ret++;
32184: printf(" %d", n_reader);
32185: printf("\n");
32186: }
32187: }
32188: function_tests++;
32189: #endif
32190:
32191: return(test_ret);
32192: }
32193:
32194:
32195: static int
32196: test_xmlTextReaderRelaxNGSetSchema(void) {
32197: int test_ret = 0;
32198:
32199: #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
32200: int mem_base;
32201: int ret_val;
32202: xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32203: int n_reader;
32204: xmlRelaxNGPtr schema; /* a precompiled RelaxNG schema */
32205: int n_schema;
32206:
32207: for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32208: for (n_schema = 0;n_schema < gen_nb_xmlRelaxNGPtr;n_schema++) {
32209: mem_base = xmlMemBlocks();
32210: reader = gen_xmlTextReaderPtr(n_reader, 0);
32211: schema = gen_xmlRelaxNGPtr(n_schema, 1);
32212:
32213: ret_val = xmlTextReaderRelaxNGSetSchema(reader, schema);
32214: desret_int(ret_val);
32215: call_tests++;
32216: des_xmlTextReaderPtr(n_reader, reader, 0);
32217: des_xmlRelaxNGPtr(n_schema, schema, 1);
32218: xmlResetLastError();
32219: if (mem_base != xmlMemBlocks()) {
32220: printf("Leak of %d blocks found in xmlTextReaderRelaxNGSetSchema",
32221: xmlMemBlocks() - mem_base);
32222: test_ret++;
32223: printf(" %d", n_reader);
32224: printf(" %d", n_schema);
32225: printf("\n");
32226: }
32227: }
32228: }
32229: function_tests++;
32230: #endif
32231:
32232: return(test_ret);
32233: }
32234:
32235:
32236: static int
32237: test_xmlTextReaderRelaxNGValidate(void) {
32238: int test_ret = 0;
32239:
32240: #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
32241: int mem_base;
32242: int ret_val;
32243: xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32244: int n_reader;
32245: char * rng; /* the path to a RelaxNG schema or NULL */
32246: int n_rng;
32247:
32248: for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32249: for (n_rng = 0;n_rng < gen_nb_const_char_ptr;n_rng++) {
32250: mem_base = xmlMemBlocks();
32251: reader = gen_xmlTextReaderPtr(n_reader, 0);
32252: rng = gen_const_char_ptr(n_rng, 1);
32253:
32254: ret_val = xmlTextReaderRelaxNGValidate(reader, (const char *)rng);
32255: desret_int(ret_val);
32256: call_tests++;
32257: des_xmlTextReaderPtr(n_reader, reader, 0);
32258: des_const_char_ptr(n_rng, (const char *)rng, 1);
32259: xmlResetLastError();
32260: if (mem_base != xmlMemBlocks()) {
32261: printf("Leak of %d blocks found in xmlTextReaderRelaxNGValidate",
32262: xmlMemBlocks() - mem_base);
32263: test_ret++;
32264: printf(" %d", n_reader);
32265: printf(" %d", n_rng);
32266: printf("\n");
32267: }
32268: }
32269: }
32270: function_tests++;
32271: #endif
32272:
32273: return(test_ret);
32274: }
32275:
32276:
32277: static int
32278: test_xmlTextReaderSchemaValidate(void) {
32279: int test_ret = 0;
32280:
32281: #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
32282: int ret_val;
32283: xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32284: int n_reader;
32285: char * xsd; /* the path to a W3C XSD schema or NULL */
32286: int n_xsd;
32287:
32288: for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32289: for (n_xsd = 0;n_xsd < gen_nb_const_char_ptr;n_xsd++) {
32290: reader = gen_xmlTextReaderPtr(n_reader, 0);
32291: xsd = gen_const_char_ptr(n_xsd, 1);
32292:
32293: ret_val = xmlTextReaderSchemaValidate(reader, (const char *)xsd);
32294: desret_int(ret_val);
32295: call_tests++;
32296: des_xmlTextReaderPtr(n_reader, reader, 0);
32297: des_const_char_ptr(n_xsd, (const char *)xsd, 1);
32298: xmlResetLastError();
32299: }
32300: }
32301: function_tests++;
32302: #endif
32303:
32304: return(test_ret);
32305: }
32306:
32307:
32308: static int
32309: test_xmlTextReaderSchemaValidateCtxt(void) {
32310: int test_ret = 0;
32311:
32312: #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
32313: int mem_base;
32314: int ret_val;
32315: xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32316: int n_reader;
32317: xmlSchemaValidCtxtPtr ctxt; /* the XML Schema validation context or NULL */
32318: int n_ctxt;
32319: int options; /* options (not used yet) */
32320: int n_options;
32321:
32322: for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32323: for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
32324: for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
32325: mem_base = xmlMemBlocks();
32326: reader = gen_xmlTextReaderPtr(n_reader, 0);
32327: ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 1);
32328: options = gen_parseroptions(n_options, 2);
32329:
32330: ret_val = xmlTextReaderSchemaValidateCtxt(reader, ctxt, options);
32331: desret_int(ret_val);
32332: call_tests++;
32333: des_xmlTextReaderPtr(n_reader, reader, 0);
32334: des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 1);
32335: des_parseroptions(n_options, options, 2);
32336: xmlResetLastError();
32337: if (mem_base != xmlMemBlocks()) {
32338: printf("Leak of %d blocks found in xmlTextReaderSchemaValidateCtxt",
32339: xmlMemBlocks() - mem_base);
32340: test_ret++;
32341: printf(" %d", n_reader);
32342: printf(" %d", n_ctxt);
32343: printf(" %d", n_options);
32344: printf("\n");
32345: }
32346: }
32347: }
32348: }
32349: function_tests++;
32350: #endif
32351:
32352: return(test_ret);
32353: }
32354:
32355:
32356: static int
32357: test_xmlTextReaderSetErrorHandler(void) {
32358: int test_ret = 0;
32359:
32360:
32361: /* missing type support */
32362: return(test_ret);
32363: }
32364:
32365:
32366: static int
32367: test_xmlTextReaderSetParserProp(void) {
32368: int test_ret = 0;
32369:
32370: #if defined(LIBXML_READER_ENABLED)
32371: int mem_base;
32372: int ret_val;
32373: xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32374: int n_reader;
32375: int prop; /* the xmlParserProperties to set */
32376: int n_prop;
32377: int value; /* usually 0 or 1 to (de)activate it */
32378: int n_value;
32379:
32380: for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32381: for (n_prop = 0;n_prop < gen_nb_int;n_prop++) {
32382: for (n_value = 0;n_value < gen_nb_int;n_value++) {
32383: mem_base = xmlMemBlocks();
32384: reader = gen_xmlTextReaderPtr(n_reader, 0);
32385: prop = gen_int(n_prop, 1);
32386: value = gen_int(n_value, 2);
32387:
32388: ret_val = xmlTextReaderSetParserProp(reader, prop, value);
32389: desret_int(ret_val);
32390: call_tests++;
32391: des_xmlTextReaderPtr(n_reader, reader, 0);
32392: des_int(n_prop, prop, 1);
32393: des_int(n_value, value, 2);
32394: xmlResetLastError();
32395: if (mem_base != xmlMemBlocks()) {
32396: printf("Leak of %d blocks found in xmlTextReaderSetParserProp",
32397: xmlMemBlocks() - mem_base);
32398: test_ret++;
32399: printf(" %d", n_reader);
32400: printf(" %d", n_prop);
32401: printf(" %d", n_value);
32402: printf("\n");
32403: }
32404: }
32405: }
32406: }
32407: function_tests++;
32408: #endif
32409:
32410: return(test_ret);
32411: }
32412:
32413:
32414: static int
32415: test_xmlTextReaderSetSchema(void) {
32416: int test_ret = 0;
32417:
32418: #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
32419: int mem_base;
32420: int ret_val;
32421: xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32422: int n_reader;
32423: xmlSchemaPtr schema; /* a precompiled Schema schema */
32424: int n_schema;
32425:
32426: for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32427: for (n_schema = 0;n_schema < gen_nb_xmlSchemaPtr;n_schema++) {
32428: mem_base = xmlMemBlocks();
32429: reader = gen_xmlTextReaderPtr(n_reader, 0);
32430: schema = gen_xmlSchemaPtr(n_schema, 1);
32431:
32432: ret_val = xmlTextReaderSetSchema(reader, schema);
32433: desret_int(ret_val);
32434: call_tests++;
32435: des_xmlTextReaderPtr(n_reader, reader, 0);
32436: des_xmlSchemaPtr(n_schema, schema, 1);
32437: xmlResetLastError();
32438: if (mem_base != xmlMemBlocks()) {
32439: printf("Leak of %d blocks found in xmlTextReaderSetSchema",
32440: xmlMemBlocks() - mem_base);
32441: test_ret++;
32442: printf(" %d", n_reader);
32443: printf(" %d", n_schema);
32444: printf("\n");
32445: }
32446: }
32447: }
32448: function_tests++;
32449: #endif
32450:
32451: return(test_ret);
32452: }
32453:
32454:
32455: static int
32456: test_xmlTextReaderSetStructuredErrorHandler(void) {
32457: int test_ret = 0;
32458:
32459:
32460: /* missing type support */
32461: return(test_ret);
32462: }
32463:
32464:
32465: static int
32466: test_xmlTextReaderSetup(void) {
32467: int test_ret = 0;
32468:
32469: #if defined(LIBXML_READER_ENABLED)
32470: int mem_base;
32471: int ret_val;
32472: xmlTextReaderPtr reader; /* an XML reader */
32473: int n_reader;
32474: xmlParserInputBufferPtr input; /* xmlParserInputBufferPtr used to feed the reader, will be destroyed with it. */
32475: int n_input;
32476: const char * URL; /* the base URL to use for the document */
32477: int n_URL;
32478: char * encoding; /* the document encoding, or NULL */
32479: int n_encoding;
32480: int options; /* a combination of xmlParserOption */
32481: int n_options;
32482:
32483: for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32484: for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
32485: for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
32486: for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
32487: for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
32488: mem_base = xmlMemBlocks();
32489: reader = gen_xmlTextReaderPtr(n_reader, 0);
32490: input = gen_xmlParserInputBufferPtr(n_input, 1);
32491: URL = gen_filepath(n_URL, 2);
32492: encoding = gen_const_char_ptr(n_encoding, 3);
32493: options = gen_parseroptions(n_options, 4);
32494:
32495: ret_val = xmlTextReaderSetup(reader, input, URL, (const char *)encoding, options);
32496: desret_int(ret_val);
32497: call_tests++;
32498: des_xmlTextReaderPtr(n_reader, reader, 0);
32499: des_filepath(n_URL, URL, 2);
32500: des_const_char_ptr(n_encoding, (const char *)encoding, 3);
32501: des_parseroptions(n_options, options, 4);
32502: xmlResetLastError();
32503: if (mem_base != xmlMemBlocks()) {
32504: printf("Leak of %d blocks found in xmlTextReaderSetup",
32505: xmlMemBlocks() - mem_base);
32506: test_ret++;
32507: printf(" %d", n_reader);
32508: printf(" %d", n_input);
32509: printf(" %d", n_URL);
32510: printf(" %d", n_encoding);
32511: printf(" %d", n_options);
32512: printf("\n");
32513: }
32514: }
32515: }
32516: }
32517: }
32518: }
32519: function_tests++;
32520: #endif
32521:
32522: return(test_ret);
32523: }
32524:
32525:
32526: static int
32527: test_xmlTextReaderStandalone(void) {
32528: int test_ret = 0;
32529:
32530: #if defined(LIBXML_READER_ENABLED)
32531: int mem_base;
32532: int ret_val;
32533: xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32534: int n_reader;
32535:
32536: for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32537: mem_base = xmlMemBlocks();
32538: reader = gen_xmlTextReaderPtr(n_reader, 0);
32539:
32540: ret_val = xmlTextReaderStandalone(reader);
32541: desret_int(ret_val);
32542: call_tests++;
32543: des_xmlTextReaderPtr(n_reader, reader, 0);
32544: xmlResetLastError();
32545: if (mem_base != xmlMemBlocks()) {
32546: printf("Leak of %d blocks found in xmlTextReaderStandalone",
32547: xmlMemBlocks() - mem_base);
32548: test_ret++;
32549: printf(" %d", n_reader);
32550: printf("\n");
32551: }
32552: }
32553: function_tests++;
32554: #endif
32555:
32556: return(test_ret);
32557: }
32558:
32559:
32560: static int
32561: test_xmlTextReaderValue(void) {
32562: int test_ret = 0;
32563:
32564: #if defined(LIBXML_READER_ENABLED)
32565: int mem_base;
32566: xmlChar * ret_val;
32567: xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32568: int n_reader;
32569:
32570: for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32571: mem_base = xmlMemBlocks();
32572: reader = gen_xmlTextReaderPtr(n_reader, 0);
32573:
32574: ret_val = xmlTextReaderValue(reader);
32575: desret_xmlChar_ptr(ret_val);
32576: call_tests++;
32577: des_xmlTextReaderPtr(n_reader, reader, 0);
32578: xmlResetLastError();
32579: if (mem_base != xmlMemBlocks()) {
32580: printf("Leak of %d blocks found in xmlTextReaderValue",
32581: xmlMemBlocks() - mem_base);
32582: test_ret++;
32583: printf(" %d", n_reader);
32584: printf("\n");
32585: }
32586: }
32587: function_tests++;
32588: #endif
32589:
32590: return(test_ret);
32591: }
32592:
32593:
32594: static int
32595: test_xmlTextReaderXmlLang(void) {
32596: int test_ret = 0;
32597:
32598: #if defined(LIBXML_READER_ENABLED)
32599: int mem_base;
32600: xmlChar * ret_val;
32601: xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32602: int n_reader;
32603:
32604: for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32605: mem_base = xmlMemBlocks();
32606: reader = gen_xmlTextReaderPtr(n_reader, 0);
32607:
32608: ret_val = xmlTextReaderXmlLang(reader);
32609: desret_xmlChar_ptr(ret_val);
32610: call_tests++;
32611: des_xmlTextReaderPtr(n_reader, reader, 0);
32612: xmlResetLastError();
32613: if (mem_base != xmlMemBlocks()) {
32614: printf("Leak of %d blocks found in xmlTextReaderXmlLang",
32615: xmlMemBlocks() - mem_base);
32616: test_ret++;
32617: printf(" %d", n_reader);
32618: printf("\n");
32619: }
32620: }
32621: function_tests++;
32622: #endif
32623:
32624: return(test_ret);
32625: }
32626:
32627: static int
32628: test_xmlreader(void) {
32629: int test_ret = 0;
32630:
32631: if (quiet == 0) printf("Testing xmlreader : 75 of 85 functions ...\n");
32632: test_ret += test_xmlNewTextReader();
32633: test_ret += test_xmlNewTextReaderFilename();
32634: test_ret += test_xmlReaderForDoc();
32635: test_ret += test_xmlReaderForFile();
32636: test_ret += test_xmlReaderForMemory();
32637: test_ret += test_xmlReaderNewDoc();
32638: test_ret += test_xmlReaderNewFile();
32639: test_ret += test_xmlReaderNewMemory();
32640: test_ret += test_xmlReaderNewWalker();
32641: test_ret += test_xmlReaderWalker();
32642: test_ret += test_xmlTextReaderAttributeCount();
32643: test_ret += test_xmlTextReaderBaseUri();
32644: test_ret += test_xmlTextReaderByteConsumed();
32645: test_ret += test_xmlTextReaderClose();
32646: test_ret += test_xmlTextReaderConstBaseUri();
32647: test_ret += test_xmlTextReaderConstEncoding();
32648: test_ret += test_xmlTextReaderConstLocalName();
32649: test_ret += test_xmlTextReaderConstName();
32650: test_ret += test_xmlTextReaderConstNamespaceUri();
32651: test_ret += test_xmlTextReaderConstPrefix();
32652: test_ret += test_xmlTextReaderConstString();
32653: test_ret += test_xmlTextReaderConstValue();
32654: test_ret += test_xmlTextReaderConstXmlLang();
32655: test_ret += test_xmlTextReaderConstXmlVersion();
32656: test_ret += test_xmlTextReaderCurrentDoc();
32657: test_ret += test_xmlTextReaderCurrentNode();
32658: test_ret += test_xmlTextReaderDepth();
32659: test_ret += test_xmlTextReaderExpand();
32660: test_ret += test_xmlTextReaderGetAttribute();
32661: test_ret += test_xmlTextReaderGetAttributeNo();
32662: test_ret += test_xmlTextReaderGetAttributeNs();
32663: test_ret += test_xmlTextReaderGetErrorHandler();
32664: test_ret += test_xmlTextReaderGetParserColumnNumber();
32665: test_ret += test_xmlTextReaderGetParserLineNumber();
32666: test_ret += test_xmlTextReaderGetParserProp();
32667: test_ret += test_xmlTextReaderGetRemainder();
32668: test_ret += test_xmlTextReaderHasAttributes();
32669: test_ret += test_xmlTextReaderHasValue();
32670: test_ret += test_xmlTextReaderIsDefault();
32671: test_ret += test_xmlTextReaderIsEmptyElement();
32672: test_ret += test_xmlTextReaderIsNamespaceDecl();
32673: test_ret += test_xmlTextReaderIsValid();
32674: test_ret += test_xmlTextReaderLocalName();
32675: test_ret += test_xmlTextReaderLocatorBaseURI();
32676: test_ret += test_xmlTextReaderLocatorLineNumber();
32677: test_ret += test_xmlTextReaderLookupNamespace();
32678: test_ret += test_xmlTextReaderMoveToAttribute();
32679: test_ret += test_xmlTextReaderMoveToAttributeNo();
32680: test_ret += test_xmlTextReaderMoveToAttributeNs();
32681: test_ret += test_xmlTextReaderMoveToElement();
32682: test_ret += test_xmlTextReaderMoveToFirstAttribute();
32683: test_ret += test_xmlTextReaderMoveToNextAttribute();
32684: test_ret += test_xmlTextReaderName();
32685: test_ret += test_xmlTextReaderNamespaceUri();
32686: test_ret += test_xmlTextReaderNext();
32687: test_ret += test_xmlTextReaderNextSibling();
32688: test_ret += test_xmlTextReaderNodeType();
32689: test_ret += test_xmlTextReaderNormalization();
32690: test_ret += test_xmlTextReaderPrefix();
32691: test_ret += test_xmlTextReaderPreserve();
32692: test_ret += test_xmlTextReaderPreservePattern();
32693: test_ret += test_xmlTextReaderQuoteChar();
32694: test_ret += test_xmlTextReaderRead();
32695: test_ret += test_xmlTextReaderReadAttributeValue();
32696: test_ret += test_xmlTextReaderReadState();
32697: test_ret += test_xmlTextReaderRelaxNGSetSchema();
32698: test_ret += test_xmlTextReaderRelaxNGValidate();
32699: test_ret += test_xmlTextReaderSchemaValidate();
32700: test_ret += test_xmlTextReaderSchemaValidateCtxt();
32701: test_ret += test_xmlTextReaderSetErrorHandler();
32702: test_ret += test_xmlTextReaderSetParserProp();
32703: test_ret += test_xmlTextReaderSetSchema();
32704: test_ret += test_xmlTextReaderSetStructuredErrorHandler();
32705: test_ret += test_xmlTextReaderSetup();
32706: test_ret += test_xmlTextReaderStandalone();
32707: test_ret += test_xmlTextReaderValue();
32708: test_ret += test_xmlTextReaderXmlLang();
32709:
32710: if (test_ret != 0)
32711: printf("Module xmlreader: %d errors\n", test_ret);
32712: return(test_ret);
32713: }
32714:
32715: static int
32716: test_xmlExpCtxtNbCons(void) {
32717: int test_ret = 0;
32718:
32719: #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
32720: int mem_base;
32721: int ret_val;
32722: xmlExpCtxtPtr ctxt; /* an expression context */
32723: int n_ctxt;
32724:
32725: for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
32726: mem_base = xmlMemBlocks();
32727: ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
32728:
32729: ret_val = xmlExpCtxtNbCons(ctxt);
32730: desret_int(ret_val);
32731: call_tests++;
32732: des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
32733: xmlResetLastError();
32734: if (mem_base != xmlMemBlocks()) {
32735: printf("Leak of %d blocks found in xmlExpCtxtNbCons",
32736: xmlMemBlocks() - mem_base);
32737: test_ret++;
32738: printf(" %d", n_ctxt);
32739: printf("\n");
32740: }
32741: }
32742: function_tests++;
32743: #endif
32744:
32745: return(test_ret);
32746: }
32747:
32748:
32749: static int
32750: test_xmlExpCtxtNbNodes(void) {
32751: int test_ret = 0;
32752:
32753: #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
32754: int mem_base;
32755: int ret_val;
32756: xmlExpCtxtPtr ctxt; /* an expression context */
32757: int n_ctxt;
32758:
32759: for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
32760: mem_base = xmlMemBlocks();
32761: ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
32762:
32763: ret_val = xmlExpCtxtNbNodes(ctxt);
32764: desret_int(ret_val);
32765: call_tests++;
32766: des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
32767: xmlResetLastError();
32768: if (mem_base != xmlMemBlocks()) {
32769: printf("Leak of %d blocks found in xmlExpCtxtNbNodes",
32770: xmlMemBlocks() - mem_base);
32771: test_ret++;
32772: printf(" %d", n_ctxt);
32773: printf("\n");
32774: }
32775: }
32776: function_tests++;
32777: #endif
32778:
32779: return(test_ret);
32780: }
32781:
32782:
32783: static int
32784: test_xmlExpDump(void) {
32785: int test_ret = 0;
32786:
32787: #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
32788: int mem_base;
32789: xmlBufferPtr buf; /* a buffer to receive the output */
32790: int n_buf;
32791: xmlExpNodePtr expr; /* the compiled expression */
32792: int n_expr;
32793:
32794: for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
32795: for (n_expr = 0;n_expr < gen_nb_xmlExpNodePtr;n_expr++) {
32796: mem_base = xmlMemBlocks();
32797: buf = gen_xmlBufferPtr(n_buf, 0);
32798: expr = gen_xmlExpNodePtr(n_expr, 1);
32799:
32800: xmlExpDump(buf, expr);
32801: call_tests++;
32802: des_xmlBufferPtr(n_buf, buf, 0);
32803: des_xmlExpNodePtr(n_expr, expr, 1);
32804: xmlResetLastError();
32805: if (mem_base != xmlMemBlocks()) {
32806: printf("Leak of %d blocks found in xmlExpDump",
32807: xmlMemBlocks() - mem_base);
32808: test_ret++;
32809: printf(" %d", n_buf);
32810: printf(" %d", n_expr);
32811: printf("\n");
32812: }
32813: }
32814: }
32815: function_tests++;
32816: #endif
32817:
32818: return(test_ret);
32819: }
32820:
32821:
32822: static int
32823: test_xmlExpExpDerive(void) {
32824: int test_ret = 0;
32825:
32826:
32827: /* missing type support */
32828: return(test_ret);
32829: }
32830:
32831:
32832: static int
32833: test_xmlExpGetLanguage(void) {
32834: int test_ret = 0;
32835:
32836: #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
32837: int mem_base;
32838: int ret_val;
32839: xmlExpCtxtPtr ctxt; /* the expression context */
32840: int n_ctxt;
32841: xmlExpNodePtr exp; /* the expression */
32842: int n_exp;
32843: xmlChar ** langList; /* where to store the tokens */
32844: int n_langList;
32845: int len; /* the allocated lenght of @list */
32846: int n_len;
32847:
32848: for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
32849: for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
32850: for (n_langList = 0;n_langList < gen_nb_const_xmlChar_ptr_ptr;n_langList++) {
32851: for (n_len = 0;n_len < gen_nb_int;n_len++) {
32852: mem_base = xmlMemBlocks();
32853: ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
32854: exp = gen_xmlExpNodePtr(n_exp, 1);
32855: langList = gen_const_xmlChar_ptr_ptr(n_langList, 2);
32856: len = gen_int(n_len, 3);
32857:
32858: ret_val = xmlExpGetLanguage(ctxt, exp, (const xmlChar **)langList, len);
32859: desret_int(ret_val);
32860: call_tests++;
32861: des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
32862: des_xmlExpNodePtr(n_exp, exp, 1);
32863: des_const_xmlChar_ptr_ptr(n_langList, (const xmlChar **)langList, 2);
32864: des_int(n_len, len, 3);
32865: xmlResetLastError();
32866: if (mem_base != xmlMemBlocks()) {
32867: printf("Leak of %d blocks found in xmlExpGetLanguage",
32868: xmlMemBlocks() - mem_base);
32869: test_ret++;
32870: printf(" %d", n_ctxt);
32871: printf(" %d", n_exp);
32872: printf(" %d", n_langList);
32873: printf(" %d", n_len);
32874: printf("\n");
32875: }
32876: }
32877: }
32878: }
32879: }
32880: function_tests++;
32881: #endif
32882:
32883: return(test_ret);
32884: }
32885:
32886:
32887: static int
32888: test_xmlExpGetStart(void) {
32889: int test_ret = 0;
32890:
32891: #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
32892: int mem_base;
32893: int ret_val;
32894: xmlExpCtxtPtr ctxt; /* the expression context */
32895: int n_ctxt;
32896: xmlExpNodePtr exp; /* the expression */
32897: int n_exp;
32898: xmlChar ** tokList; /* where to store the tokens */
32899: int n_tokList;
32900: int len; /* the allocated lenght of @list */
32901: int n_len;
32902:
32903: for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
32904: for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
32905: for (n_tokList = 0;n_tokList < gen_nb_const_xmlChar_ptr_ptr;n_tokList++) {
32906: for (n_len = 0;n_len < gen_nb_int;n_len++) {
32907: mem_base = xmlMemBlocks();
32908: ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
32909: exp = gen_xmlExpNodePtr(n_exp, 1);
32910: tokList = gen_const_xmlChar_ptr_ptr(n_tokList, 2);
32911: len = gen_int(n_len, 3);
32912:
32913: ret_val = xmlExpGetStart(ctxt, exp, (const xmlChar **)tokList, len);
32914: desret_int(ret_val);
32915: call_tests++;
32916: des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
32917: des_xmlExpNodePtr(n_exp, exp, 1);
32918: des_const_xmlChar_ptr_ptr(n_tokList, (const xmlChar **)tokList, 2);
32919: des_int(n_len, len, 3);
32920: xmlResetLastError();
32921: if (mem_base != xmlMemBlocks()) {
32922: printf("Leak of %d blocks found in xmlExpGetStart",
32923: xmlMemBlocks() - mem_base);
32924: test_ret++;
32925: printf(" %d", n_ctxt);
32926: printf(" %d", n_exp);
32927: printf(" %d", n_tokList);
32928: printf(" %d", n_len);
32929: printf("\n");
32930: }
32931: }
32932: }
32933: }
32934: }
32935: function_tests++;
32936: #endif
32937:
32938: return(test_ret);
32939: }
32940:
32941:
32942: static int
32943: test_xmlExpIsNillable(void) {
32944: int test_ret = 0;
32945:
32946: #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
32947: int mem_base;
32948: int ret_val;
32949: xmlExpNodePtr exp; /* the expression */
32950: int n_exp;
32951:
32952: for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
32953: mem_base = xmlMemBlocks();
32954: exp = gen_xmlExpNodePtr(n_exp, 0);
32955:
32956: ret_val = xmlExpIsNillable(exp);
32957: desret_int(ret_val);
32958: call_tests++;
32959: des_xmlExpNodePtr(n_exp, exp, 0);
32960: xmlResetLastError();
32961: if (mem_base != xmlMemBlocks()) {
32962: printf("Leak of %d blocks found in xmlExpIsNillable",
32963: xmlMemBlocks() - mem_base);
32964: test_ret++;
32965: printf(" %d", n_exp);
32966: printf("\n");
32967: }
32968: }
32969: function_tests++;
32970: #endif
32971:
32972: return(test_ret);
32973: }
32974:
32975:
32976: static int
32977: test_xmlExpMaxToken(void) {
32978: int test_ret = 0;
32979:
32980: #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
32981: int mem_base;
32982: int ret_val;
32983: xmlExpNodePtr expr; /* a compiled expression */
32984: int n_expr;
32985:
32986: for (n_expr = 0;n_expr < gen_nb_xmlExpNodePtr;n_expr++) {
32987: mem_base = xmlMemBlocks();
32988: expr = gen_xmlExpNodePtr(n_expr, 0);
32989:
32990: ret_val = xmlExpMaxToken(expr);
32991: desret_int(ret_val);
32992: call_tests++;
32993: des_xmlExpNodePtr(n_expr, expr, 0);
32994: xmlResetLastError();
32995: if (mem_base != xmlMemBlocks()) {
32996: printf("Leak of %d blocks found in xmlExpMaxToken",
32997: xmlMemBlocks() - mem_base);
32998: test_ret++;
32999: printf(" %d", n_expr);
33000: printf("\n");
33001: }
33002: }
33003: function_tests++;
33004: #endif
33005:
33006: return(test_ret);
33007: }
33008:
33009:
33010: static int
33011: test_xmlExpNewAtom(void) {
33012: int test_ret = 0;
33013:
33014:
33015: /* missing type support */
33016: return(test_ret);
33017: }
33018:
33019:
33020: static int
33021: test_xmlExpNewCtxt(void) {
33022: int test_ret = 0;
33023:
33024:
33025: /* missing type support */
33026: return(test_ret);
33027: }
33028:
33029:
33030: static int
33031: test_xmlExpNewOr(void) {
33032: int test_ret = 0;
33033:
33034:
33035: /* missing type support */
33036: return(test_ret);
33037: }
33038:
33039:
33040: static int
33041: test_xmlExpNewRange(void) {
33042: int test_ret = 0;
33043:
33044:
33045: /* missing type support */
33046: return(test_ret);
33047: }
33048:
33049:
33050: static int
33051: test_xmlExpNewSeq(void) {
33052: int test_ret = 0;
33053:
33054:
33055: /* missing type support */
33056: return(test_ret);
33057: }
33058:
33059:
33060: static int
33061: test_xmlExpParse(void) {
33062: int test_ret = 0;
33063:
33064:
33065: /* missing type support */
33066: return(test_ret);
33067: }
33068:
33069:
33070: static int
33071: test_xmlExpRef(void) {
33072: int test_ret = 0;
33073:
33074: #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
33075: int mem_base;
33076: xmlExpNodePtr exp; /* the expression */
33077: int n_exp;
33078:
33079: for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
33080: mem_base = xmlMemBlocks();
33081: exp = gen_xmlExpNodePtr(n_exp, 0);
33082:
33083: xmlExpRef(exp);
33084: call_tests++;
33085: des_xmlExpNodePtr(n_exp, exp, 0);
33086: xmlResetLastError();
33087: if (mem_base != xmlMemBlocks()) {
33088: printf("Leak of %d blocks found in xmlExpRef",
33089: xmlMemBlocks() - mem_base);
33090: test_ret++;
33091: printf(" %d", n_exp);
33092: printf("\n");
33093: }
33094: }
33095: function_tests++;
33096: #endif
33097:
33098: return(test_ret);
33099: }
33100:
33101:
33102: static int
33103: test_xmlExpStringDerive(void) {
33104: int test_ret = 0;
33105:
33106:
33107: /* missing type support */
33108: return(test_ret);
33109: }
33110:
33111:
33112: static int
33113: test_xmlExpSubsume(void) {
33114: int test_ret = 0;
33115:
33116: #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
33117: int mem_base;
33118: int ret_val;
33119: xmlExpCtxtPtr ctxt; /* the expressions context */
33120: int n_ctxt;
33121: xmlExpNodePtr exp; /* the englobing expression */
33122: int n_exp;
33123: xmlExpNodePtr sub; /* the subexpression */
33124: int n_sub;
33125:
33126: for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
33127: for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
33128: for (n_sub = 0;n_sub < gen_nb_xmlExpNodePtr;n_sub++) {
33129: mem_base = xmlMemBlocks();
33130: ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
33131: exp = gen_xmlExpNodePtr(n_exp, 1);
33132: sub = gen_xmlExpNodePtr(n_sub, 2);
33133:
33134: ret_val = xmlExpSubsume(ctxt, exp, sub);
33135: desret_int(ret_val);
33136: call_tests++;
33137: des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
33138: des_xmlExpNodePtr(n_exp, exp, 1);
33139: des_xmlExpNodePtr(n_sub, sub, 2);
33140: xmlResetLastError();
33141: if (mem_base != xmlMemBlocks()) {
33142: printf("Leak of %d blocks found in xmlExpSubsume",
33143: xmlMemBlocks() - mem_base);
33144: test_ret++;
33145: printf(" %d", n_ctxt);
33146: printf(" %d", n_exp);
33147: printf(" %d", n_sub);
33148: printf("\n");
33149: }
33150: }
33151: }
33152: }
33153: function_tests++;
33154: #endif
33155:
33156: return(test_ret);
33157: }
33158:
33159: #ifdef LIBXML_REGEXP_ENABLED
33160:
33161: #define gen_nb_xmlRegExecCtxtPtr 1
33162: static xmlRegExecCtxtPtr gen_xmlRegExecCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33163: return(NULL);
33164: }
33165: static void des_xmlRegExecCtxtPtr(int no ATTRIBUTE_UNUSED, xmlRegExecCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33166: }
33167: #endif
33168:
33169:
33170: static int
33171: test_xmlRegExecErrInfo(void) {
33172: int test_ret = 0;
33173:
33174: #if defined(LIBXML_REGEXP_ENABLED)
33175: int mem_base;
33176: int ret_val;
33177: xmlRegExecCtxtPtr exec; /* a regexp execution context generating an error */
33178: int n_exec;
33179: xmlChar ** string; /* return value for the error string */
33180: int n_string;
33181: int * nbval; /* pointer to the number of accepted values IN/OUT */
33182: int n_nbval;
33183: int * nbneg; /* return number of negative transitions */
33184: int n_nbneg;
33185: xmlChar ** values; /* pointer to the array of acceptable values */
33186: int n_values;
33187: int * terminal; /* return value if this was a terminal state */
33188: int n_terminal;
33189:
33190: for (n_exec = 0;n_exec < gen_nb_xmlRegExecCtxtPtr;n_exec++) {
33191: for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr_ptr;n_string++) {
33192: for (n_nbval = 0;n_nbval < gen_nb_int_ptr;n_nbval++) {
33193: for (n_nbneg = 0;n_nbneg < gen_nb_int_ptr;n_nbneg++) {
33194: for (n_values = 0;n_values < gen_nb_xmlChar_ptr_ptr;n_values++) {
33195: for (n_terminal = 0;n_terminal < gen_nb_int_ptr;n_terminal++) {
33196: mem_base = xmlMemBlocks();
33197: exec = gen_xmlRegExecCtxtPtr(n_exec, 0);
33198: string = gen_const_xmlChar_ptr_ptr(n_string, 1);
33199: nbval = gen_int_ptr(n_nbval, 2);
33200: nbneg = gen_int_ptr(n_nbneg, 3);
33201: values = gen_xmlChar_ptr_ptr(n_values, 4);
33202: terminal = gen_int_ptr(n_terminal, 5);
33203:
33204: ret_val = xmlRegExecErrInfo(exec, (const xmlChar **)string, nbval, nbneg, values, terminal);
33205: desret_int(ret_val);
33206: call_tests++;
33207: des_xmlRegExecCtxtPtr(n_exec, exec, 0);
33208: des_const_xmlChar_ptr_ptr(n_string, (const xmlChar **)string, 1);
33209: des_int_ptr(n_nbval, nbval, 2);
33210: des_int_ptr(n_nbneg, nbneg, 3);
33211: des_xmlChar_ptr_ptr(n_values, values, 4);
33212: des_int_ptr(n_terminal, terminal, 5);
33213: xmlResetLastError();
33214: if (mem_base != xmlMemBlocks()) {
33215: printf("Leak of %d blocks found in xmlRegExecErrInfo",
33216: xmlMemBlocks() - mem_base);
33217: test_ret++;
33218: printf(" %d", n_exec);
33219: printf(" %d", n_string);
33220: printf(" %d", n_nbval);
33221: printf(" %d", n_nbneg);
33222: printf(" %d", n_values);
33223: printf(" %d", n_terminal);
33224: printf("\n");
33225: }
33226: }
33227: }
33228: }
33229: }
33230: }
33231: }
33232: function_tests++;
33233: #endif
33234:
33235: return(test_ret);
33236: }
33237:
33238:
33239: static int
33240: test_xmlRegExecNextValues(void) {
33241: int test_ret = 0;
33242:
33243: #if defined(LIBXML_REGEXP_ENABLED)
33244: int mem_base;
33245: int ret_val;
33246: xmlRegExecCtxtPtr exec; /* a regexp execution context */
33247: int n_exec;
33248: int * nbval; /* pointer to the number of accepted values IN/OUT */
33249: int n_nbval;
33250: int * nbneg; /* return number of negative transitions */
33251: int n_nbneg;
33252: xmlChar ** values; /* pointer to the array of acceptable values */
33253: int n_values;
33254: int * terminal; /* return value if this was a terminal state */
33255: int n_terminal;
33256:
33257: for (n_exec = 0;n_exec < gen_nb_xmlRegExecCtxtPtr;n_exec++) {
33258: for (n_nbval = 0;n_nbval < gen_nb_int_ptr;n_nbval++) {
33259: for (n_nbneg = 0;n_nbneg < gen_nb_int_ptr;n_nbneg++) {
33260: for (n_values = 0;n_values < gen_nb_xmlChar_ptr_ptr;n_values++) {
33261: for (n_terminal = 0;n_terminal < gen_nb_int_ptr;n_terminal++) {
33262: mem_base = xmlMemBlocks();
33263: exec = gen_xmlRegExecCtxtPtr(n_exec, 0);
33264: nbval = gen_int_ptr(n_nbval, 1);
33265: nbneg = gen_int_ptr(n_nbneg, 2);
33266: values = gen_xmlChar_ptr_ptr(n_values, 3);
33267: terminal = gen_int_ptr(n_terminal, 4);
33268:
33269: ret_val = xmlRegExecNextValues(exec, nbval, nbneg, values, terminal);
33270: desret_int(ret_val);
33271: call_tests++;
33272: des_xmlRegExecCtxtPtr(n_exec, exec, 0);
33273: des_int_ptr(n_nbval, nbval, 1);
33274: des_int_ptr(n_nbneg, nbneg, 2);
33275: des_xmlChar_ptr_ptr(n_values, values, 3);
33276: des_int_ptr(n_terminal, terminal, 4);
33277: xmlResetLastError();
33278: if (mem_base != xmlMemBlocks()) {
33279: printf("Leak of %d blocks found in xmlRegExecNextValues",
33280: xmlMemBlocks() - mem_base);
33281: test_ret++;
33282: printf(" %d", n_exec);
33283: printf(" %d", n_nbval);
33284: printf(" %d", n_nbneg);
33285: printf(" %d", n_values);
33286: printf(" %d", n_terminal);
33287: printf("\n");
33288: }
33289: }
33290: }
33291: }
33292: }
33293: }
33294: function_tests++;
33295: #endif
33296:
33297: return(test_ret);
33298: }
33299:
33300:
33301: static int
33302: test_xmlRegExecPushString(void) {
33303: int test_ret = 0;
33304:
33305: #if defined(LIBXML_REGEXP_ENABLED)
33306: int mem_base;
33307: int ret_val;
33308: xmlRegExecCtxtPtr exec; /* a regexp execution context or NULL to indicate the end */
33309: int n_exec;
33310: xmlChar * value; /* a string token input */
33311: int n_value;
33312: void * data; /* data associated to the token to reuse in callbacks */
33313: int n_data;
33314:
33315: for (n_exec = 0;n_exec < gen_nb_xmlRegExecCtxtPtr;n_exec++) {
33316: for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
33317: for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
33318: mem_base = xmlMemBlocks();
33319: exec = gen_xmlRegExecCtxtPtr(n_exec, 0);
33320: value = gen_const_xmlChar_ptr(n_value, 1);
33321: data = gen_userdata(n_data, 2);
33322:
33323: ret_val = xmlRegExecPushString(exec, (const xmlChar *)value, data);
33324: desret_int(ret_val);
33325: call_tests++;
33326: des_xmlRegExecCtxtPtr(n_exec, exec, 0);
33327: des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
33328: des_userdata(n_data, data, 2);
33329: xmlResetLastError();
33330: if (mem_base != xmlMemBlocks()) {
33331: printf("Leak of %d blocks found in xmlRegExecPushString",
33332: xmlMemBlocks() - mem_base);
33333: test_ret++;
33334: printf(" %d", n_exec);
33335: printf(" %d", n_value);
33336: printf(" %d", n_data);
33337: printf("\n");
33338: }
33339: }
33340: }
33341: }
33342: function_tests++;
33343: #endif
33344:
33345: return(test_ret);
33346: }
33347:
33348:
33349: static int
33350: test_xmlRegExecPushString2(void) {
33351: int test_ret = 0;
33352:
33353: #if defined(LIBXML_REGEXP_ENABLED)
33354: int mem_base;
33355: int ret_val;
33356: xmlRegExecCtxtPtr exec; /* a regexp execution context or NULL to indicate the end */
33357: int n_exec;
33358: xmlChar * value; /* the first string token input */
33359: int n_value;
33360: xmlChar * value2; /* the second string token input */
33361: int n_value2;
33362: void * data; /* data associated to the token to reuse in callbacks */
33363: int n_data;
33364:
33365: for (n_exec = 0;n_exec < gen_nb_xmlRegExecCtxtPtr;n_exec++) {
33366: for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
33367: for (n_value2 = 0;n_value2 < gen_nb_const_xmlChar_ptr;n_value2++) {
33368: for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
33369: mem_base = xmlMemBlocks();
33370: exec = gen_xmlRegExecCtxtPtr(n_exec, 0);
33371: value = gen_const_xmlChar_ptr(n_value, 1);
33372: value2 = gen_const_xmlChar_ptr(n_value2, 2);
33373: data = gen_userdata(n_data, 3);
33374:
33375: ret_val = xmlRegExecPushString2(exec, (const xmlChar *)value, (const xmlChar *)value2, data);
33376: desret_int(ret_val);
33377: call_tests++;
33378: des_xmlRegExecCtxtPtr(n_exec, exec, 0);
33379: des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
33380: des_const_xmlChar_ptr(n_value2, (const xmlChar *)value2, 2);
33381: des_userdata(n_data, data, 3);
33382: xmlResetLastError();
33383: if (mem_base != xmlMemBlocks()) {
33384: printf("Leak of %d blocks found in xmlRegExecPushString2",
33385: xmlMemBlocks() - mem_base);
33386: test_ret++;
33387: printf(" %d", n_exec);
33388: printf(" %d", n_value);
33389: printf(" %d", n_value2);
33390: printf(" %d", n_data);
33391: printf("\n");
33392: }
33393: }
33394: }
33395: }
33396: }
33397: function_tests++;
33398: #endif
33399:
33400: return(test_ret);
33401: }
33402:
33403: #ifdef LIBXML_REGEXP_ENABLED
33404:
33405: #define gen_nb_xmlRegexpPtr 1
33406: static xmlRegexpPtr gen_xmlRegexpPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33407: return(NULL);
33408: }
33409: static void des_xmlRegexpPtr(int no ATTRIBUTE_UNUSED, xmlRegexpPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33410: }
33411: #endif
33412:
33413:
33414: static int
33415: test_xmlRegNewExecCtxt(void) {
33416: int test_ret = 0;
33417:
33418:
33419: /* missing type support */
33420: return(test_ret);
33421: }
33422:
33423:
33424: static int
33425: test_xmlRegexpCompile(void) {
33426: int test_ret = 0;
33427:
33428:
33429: /* missing type support */
33430: return(test_ret);
33431: }
33432:
33433:
33434: static int
33435: test_xmlRegexpExec(void) {
33436: int test_ret = 0;
33437:
33438: #if defined(LIBXML_REGEXP_ENABLED)
33439: int mem_base;
33440: int ret_val;
33441: xmlRegexpPtr comp; /* the compiled regular expression */
33442: int n_comp;
33443: xmlChar * content; /* the value to check against the regular expression */
33444: int n_content;
33445:
33446: for (n_comp = 0;n_comp < gen_nb_xmlRegexpPtr;n_comp++) {
33447: for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
33448: mem_base = xmlMemBlocks();
33449: comp = gen_xmlRegexpPtr(n_comp, 0);
33450: content = gen_const_xmlChar_ptr(n_content, 1);
33451:
33452: ret_val = xmlRegexpExec(comp, (const xmlChar *)content);
33453: desret_int(ret_val);
33454: call_tests++;
33455: des_xmlRegexpPtr(n_comp, comp, 0);
33456: des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
33457: xmlResetLastError();
33458: if (mem_base != xmlMemBlocks()) {
33459: printf("Leak of %d blocks found in xmlRegexpExec",
33460: xmlMemBlocks() - mem_base);
33461: test_ret++;
33462: printf(" %d", n_comp);
33463: printf(" %d", n_content);
33464: printf("\n");
33465: }
33466: }
33467: }
33468: function_tests++;
33469: #endif
33470:
33471: return(test_ret);
33472: }
33473:
33474:
33475: static int
33476: test_xmlRegexpIsDeterminist(void) {
33477: int test_ret = 0;
33478:
33479: #if defined(LIBXML_REGEXP_ENABLED)
33480: int mem_base;
33481: int ret_val;
33482: xmlRegexpPtr comp; /* the compiled regular expression */
33483: int n_comp;
33484:
33485: for (n_comp = 0;n_comp < gen_nb_xmlRegexpPtr;n_comp++) {
33486: mem_base = xmlMemBlocks();
33487: comp = gen_xmlRegexpPtr(n_comp, 0);
33488:
33489: ret_val = xmlRegexpIsDeterminist(comp);
33490: desret_int(ret_val);
33491: call_tests++;
33492: des_xmlRegexpPtr(n_comp, comp, 0);
33493: xmlResetLastError();
33494: if (mem_base != xmlMemBlocks()) {
33495: printf("Leak of %d blocks found in xmlRegexpIsDeterminist",
33496: xmlMemBlocks() - mem_base);
33497: test_ret++;
33498: printf(" %d", n_comp);
33499: printf("\n");
33500: }
33501: }
33502: function_tests++;
33503: #endif
33504:
33505: return(test_ret);
33506: }
33507:
33508:
33509: static int
33510: test_xmlRegexpPrint(void) {
33511: int test_ret = 0;
33512:
33513: #if defined(LIBXML_REGEXP_ENABLED)
33514: int mem_base;
33515: FILE * output; /* the file for the output debug */
33516: int n_output;
33517: xmlRegexpPtr regexp; /* the compiled regexp */
33518: int n_regexp;
33519:
33520: for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
33521: for (n_regexp = 0;n_regexp < gen_nb_xmlRegexpPtr;n_regexp++) {
33522: mem_base = xmlMemBlocks();
33523: output = gen_FILE_ptr(n_output, 0);
33524: regexp = gen_xmlRegexpPtr(n_regexp, 1);
33525:
33526: xmlRegexpPrint(output, regexp);
33527: call_tests++;
33528: des_FILE_ptr(n_output, output, 0);
33529: des_xmlRegexpPtr(n_regexp, regexp, 1);
33530: xmlResetLastError();
33531: if (mem_base != xmlMemBlocks()) {
33532: printf("Leak of %d blocks found in xmlRegexpPrint",
33533: xmlMemBlocks() - mem_base);
33534: test_ret++;
33535: printf(" %d", n_output);
33536: printf(" %d", n_regexp);
33537: printf("\n");
33538: }
33539: }
33540: }
33541: function_tests++;
33542: #endif
33543:
33544: return(test_ret);
33545: }
33546:
33547: static int
33548: test_xmlregexp(void) {
33549: int test_ret = 0;
33550:
33551: if (quiet == 0) printf("Testing xmlregexp : 16 of 30 functions ...\n");
33552: test_ret += test_xmlExpCtxtNbCons();
33553: test_ret += test_xmlExpCtxtNbNodes();
33554: test_ret += test_xmlExpDump();
33555: test_ret += test_xmlExpExpDerive();
33556: test_ret += test_xmlExpGetLanguage();
33557: test_ret += test_xmlExpGetStart();
33558: test_ret += test_xmlExpIsNillable();
33559: test_ret += test_xmlExpMaxToken();
33560: test_ret += test_xmlExpNewAtom();
33561: test_ret += test_xmlExpNewCtxt();
33562: test_ret += test_xmlExpNewOr();
33563: test_ret += test_xmlExpNewRange();
33564: test_ret += test_xmlExpNewSeq();
33565: test_ret += test_xmlExpParse();
33566: test_ret += test_xmlExpRef();
33567: test_ret += test_xmlExpStringDerive();
33568: test_ret += test_xmlExpSubsume();
33569: test_ret += test_xmlRegExecErrInfo();
33570: test_ret += test_xmlRegExecNextValues();
33571: test_ret += test_xmlRegExecPushString();
33572: test_ret += test_xmlRegExecPushString2();
33573: test_ret += test_xmlRegNewExecCtxt();
33574: test_ret += test_xmlRegexpCompile();
33575: test_ret += test_xmlRegexpExec();
33576: test_ret += test_xmlRegexpIsDeterminist();
33577: test_ret += test_xmlRegexpPrint();
33578:
33579: if (test_ret != 0)
33580: printf("Module xmlregexp: %d errors\n", test_ret);
33581: return(test_ret);
33582: }
33583: #ifdef LIBXML_OUTPUT_ENABLED
33584:
33585: #define gen_nb_xmlSaveCtxtPtr 1
33586: static xmlSaveCtxtPtr gen_xmlSaveCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33587: return(NULL);
33588: }
33589: static void des_xmlSaveCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSaveCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33590: }
33591: #endif
33592:
33593:
33594: static int
33595: test_xmlSaveClose(void) {
33596: int test_ret = 0;
33597:
33598: #if defined(LIBXML_OUTPUT_ENABLED)
33599: int mem_base;
33600: int ret_val;
33601: xmlSaveCtxtPtr ctxt; /* a document saving context */
33602: int n_ctxt;
33603:
33604: for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) {
33605: mem_base = xmlMemBlocks();
33606: ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0);
33607:
33608: ret_val = xmlSaveClose(ctxt);
33609: desret_int(ret_val);
33610: call_tests++;
33611: des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0);
33612: xmlResetLastError();
33613: if (mem_base != xmlMemBlocks()) {
33614: printf("Leak of %d blocks found in xmlSaveClose",
33615: xmlMemBlocks() - mem_base);
33616: test_ret++;
33617: printf(" %d", n_ctxt);
33618: printf("\n");
33619: }
33620: }
33621: function_tests++;
33622: #endif
33623:
33624: return(test_ret);
33625: }
33626:
33627:
33628: static int
33629: test_xmlSaveDoc(void) {
33630: int test_ret = 0;
33631:
33632: #if defined(LIBXML_OUTPUT_ENABLED)
33633: int mem_base;
33634: long ret_val;
33635: xmlSaveCtxtPtr ctxt; /* a document saving context */
33636: int n_ctxt;
33637: xmlDocPtr doc; /* a document */
33638: int n_doc;
33639:
33640: for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) {
33641: for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
33642: mem_base = xmlMemBlocks();
33643: ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0);
33644: doc = gen_xmlDocPtr(n_doc, 1);
33645:
33646: ret_val = xmlSaveDoc(ctxt, doc);
33647: desret_long(ret_val);
33648: call_tests++;
33649: des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0);
33650: des_xmlDocPtr(n_doc, doc, 1);
33651: xmlResetLastError();
33652: if (mem_base != xmlMemBlocks()) {
33653: printf("Leak of %d blocks found in xmlSaveDoc",
33654: xmlMemBlocks() - mem_base);
33655: test_ret++;
33656: printf(" %d", n_ctxt);
33657: printf(" %d", n_doc);
33658: printf("\n");
33659: }
33660: }
33661: }
33662: function_tests++;
33663: #endif
33664:
33665: return(test_ret);
33666: }
33667:
33668:
33669: static int
33670: test_xmlSaveFlush(void) {
33671: int test_ret = 0;
33672:
33673: #if defined(LIBXML_OUTPUT_ENABLED)
33674: int mem_base;
33675: int ret_val;
33676: xmlSaveCtxtPtr ctxt; /* a document saving context */
33677: int n_ctxt;
33678:
33679: for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) {
33680: mem_base = xmlMemBlocks();
33681: ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0);
33682:
33683: ret_val = xmlSaveFlush(ctxt);
33684: desret_int(ret_val);
33685: call_tests++;
33686: des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0);
33687: xmlResetLastError();
33688: if (mem_base != xmlMemBlocks()) {
33689: printf("Leak of %d blocks found in xmlSaveFlush",
33690: xmlMemBlocks() - mem_base);
33691: test_ret++;
33692: printf(" %d", n_ctxt);
33693: printf("\n");
33694: }
33695: }
33696: function_tests++;
33697: #endif
33698:
33699: return(test_ret);
33700: }
33701:
33702:
33703: static int
33704: test_xmlSaveSetAttrEscape(void) {
33705: int test_ret = 0;
33706:
33707:
33708: /* missing type support */
33709: return(test_ret);
33710: }
33711:
33712:
33713: static int
33714: test_xmlSaveSetEscape(void) {
33715: int test_ret = 0;
33716:
33717:
33718: /* missing type support */
33719: return(test_ret);
33720: }
33721:
33722:
33723: static int
33724: test_xmlSaveToBuffer(void) {
33725: int test_ret = 0;
33726:
33727:
33728: /* missing type support */
33729: return(test_ret);
33730: }
33731:
33732:
33733: static int
33734: test_xmlSaveToFd(void) {
33735: int test_ret = 0;
33736:
33737:
33738: /* missing type support */
33739: return(test_ret);
33740: }
33741:
33742:
33743: static int
33744: test_xmlSaveToFilename(void) {
33745: int test_ret = 0;
33746:
33747:
33748: /* missing type support */
33749: return(test_ret);
33750: }
33751:
33752:
33753: static int
33754: test_xmlSaveTree(void) {
33755: int test_ret = 0;
33756:
33757: #if defined(LIBXML_OUTPUT_ENABLED)
33758: int mem_base;
33759: long ret_val;
33760: xmlSaveCtxtPtr ctxt; /* a document saving context */
33761: int n_ctxt;
33762: xmlNodePtr node; /* the top node of the subtree to save */
33763: int n_node;
33764:
33765: for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) {
33766: for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
33767: mem_base = xmlMemBlocks();
33768: ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0);
33769: node = gen_xmlNodePtr(n_node, 1);
33770:
33771: ret_val = xmlSaveTree(ctxt, node);
33772: desret_long(ret_val);
33773: call_tests++;
33774: des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0);
33775: des_xmlNodePtr(n_node, node, 1);
33776: xmlResetLastError();
33777: if (mem_base != xmlMemBlocks()) {
33778: printf("Leak of %d blocks found in xmlSaveTree",
33779: xmlMemBlocks() - mem_base);
33780: test_ret++;
33781: printf(" %d", n_ctxt);
33782: printf(" %d", n_node);
33783: printf("\n");
33784: }
33785: }
33786: }
33787: function_tests++;
33788: #endif
33789:
33790: return(test_ret);
33791: }
33792:
33793: static int
33794: test_xmlsave(void) {
33795: int test_ret = 0;
33796:
33797: if (quiet == 0) printf("Testing xmlsave : 4 of 10 functions ...\n");
33798: test_ret += test_xmlSaveClose();
33799: test_ret += test_xmlSaveDoc();
33800: test_ret += test_xmlSaveFlush();
33801: test_ret += test_xmlSaveSetAttrEscape();
33802: test_ret += test_xmlSaveSetEscape();
33803: test_ret += test_xmlSaveToBuffer();
33804: test_ret += test_xmlSaveToFd();
33805: test_ret += test_xmlSaveToFilename();
33806: test_ret += test_xmlSaveTree();
33807:
33808: if (test_ret != 0)
33809: printf("Module xmlsave: %d errors\n", test_ret);
33810: return(test_ret);
33811: }
33812:
33813: static int
33814: test_xmlSchemaDump(void) {
33815: int test_ret = 0;
33816:
33817: #if defined(LIBXML_SCHEMAS_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
33818: int mem_base;
33819: FILE * output; /* the file output */
33820: int n_output;
33821: xmlSchemaPtr schema; /* a schema structure */
33822: int n_schema;
33823:
33824: for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
33825: for (n_schema = 0;n_schema < gen_nb_xmlSchemaPtr;n_schema++) {
33826: mem_base = xmlMemBlocks();
33827: output = gen_FILE_ptr(n_output, 0);
33828: schema = gen_xmlSchemaPtr(n_schema, 1);
33829:
33830: xmlSchemaDump(output, schema);
33831: call_tests++;
33832: des_FILE_ptr(n_output, output, 0);
33833: des_xmlSchemaPtr(n_schema, schema, 1);
33834: xmlResetLastError();
33835: if (mem_base != xmlMemBlocks()) {
33836: printf("Leak of %d blocks found in xmlSchemaDump",
33837: xmlMemBlocks() - mem_base);
33838: test_ret++;
33839: printf(" %d", n_output);
33840: printf(" %d", n_schema);
33841: printf("\n");
33842: }
33843: }
33844: }
33845: function_tests++;
33846: #endif
33847:
33848: return(test_ret);
33849: }
33850:
33851: #ifdef LIBXML_SCHEMAS_ENABLED
33852:
33853: #define gen_nb_xmlSchemaParserCtxtPtr 1
33854: static xmlSchemaParserCtxtPtr gen_xmlSchemaParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33855: return(NULL);
33856: }
33857: static void des_xmlSchemaParserCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSchemaParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33858: }
33859: #endif
33860:
33861: #ifdef LIBXML_SCHEMAS_ENABLED
33862:
33863: #define gen_nb_xmlSchemaValidityErrorFunc_ptr 1
33864: static xmlSchemaValidityErrorFunc * gen_xmlSchemaValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33865: return(NULL);
33866: }
33867: static void des_xmlSchemaValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED, xmlSchemaValidityErrorFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33868: }
33869: #endif
33870:
33871: #ifdef LIBXML_SCHEMAS_ENABLED
33872:
33873: #define gen_nb_xmlSchemaValidityWarningFunc_ptr 1
33874: static xmlSchemaValidityWarningFunc * gen_xmlSchemaValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33875: return(NULL);
33876: }
33877: static void des_xmlSchemaValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED, xmlSchemaValidityWarningFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33878: }
33879: #endif
33880:
33881:
33882: static int
33883: test_xmlSchemaGetParserErrors(void) {
33884: int test_ret = 0;
33885:
33886: #if defined(LIBXML_SCHEMAS_ENABLED)
33887: int mem_base;
33888: int ret_val;
33889: xmlSchemaParserCtxtPtr ctxt; /* a XMl-Schema parser context */
33890: int n_ctxt;
33891: xmlSchemaValidityErrorFunc * err; /* the error callback result */
33892: int n_err;
33893: xmlSchemaValidityWarningFunc * warn; /* the warning callback result */
33894: int n_warn;
33895: void ** ctx; /* contextual data for the callbacks result */
33896: int n_ctx;
33897:
33898: for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaParserCtxtPtr;n_ctxt++) {
33899: for (n_err = 0;n_err < gen_nb_xmlSchemaValidityErrorFunc_ptr;n_err++) {
33900: for (n_warn = 0;n_warn < gen_nb_xmlSchemaValidityWarningFunc_ptr;n_warn++) {
33901: for (n_ctx = 0;n_ctx < gen_nb_void_ptr_ptr;n_ctx++) {
33902: mem_base = xmlMemBlocks();
33903: ctxt = gen_xmlSchemaParserCtxtPtr(n_ctxt, 0);
33904: err = gen_xmlSchemaValidityErrorFunc_ptr(n_err, 1);
33905: warn = gen_xmlSchemaValidityWarningFunc_ptr(n_warn, 2);
33906: ctx = gen_void_ptr_ptr(n_ctx, 3);
33907:
33908: ret_val = xmlSchemaGetParserErrors(ctxt, err, warn, ctx);
33909: desret_int(ret_val);
33910: call_tests++;
33911: des_xmlSchemaParserCtxtPtr(n_ctxt, ctxt, 0);
33912: des_xmlSchemaValidityErrorFunc_ptr(n_err, err, 1);
33913: des_xmlSchemaValidityWarningFunc_ptr(n_warn, warn, 2);
33914: des_void_ptr_ptr(n_ctx, ctx, 3);
33915: xmlResetLastError();
33916: if (mem_base != xmlMemBlocks()) {
33917: printf("Leak of %d blocks found in xmlSchemaGetParserErrors",
33918: xmlMemBlocks() - mem_base);
33919: test_ret++;
33920: printf(" %d", n_ctxt);
33921: printf(" %d", n_err);
33922: printf(" %d", n_warn);
33923: printf(" %d", n_ctx);
33924: printf("\n");
33925: }
33926: }
33927: }
33928: }
33929: }
33930: function_tests++;
33931: #endif
33932:
33933: return(test_ret);
33934: }
33935:
33936:
33937: static int
33938: test_xmlSchemaGetValidErrors(void) {
33939: int test_ret = 0;
33940:
33941: #if defined(LIBXML_SCHEMAS_ENABLED)
33942: int mem_base;
33943: int ret_val;
33944: xmlSchemaValidCtxtPtr ctxt; /* a XML-Schema validation context */
33945: int n_ctxt;
33946: xmlSchemaValidityErrorFunc * err; /* the error function result */
33947: int n_err;
33948: xmlSchemaValidityWarningFunc * warn; /* the warning function result */
33949: int n_warn;
33950: void ** ctx; /* the functions context result */
33951: int n_ctx;
33952:
33953: for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
33954: for (n_err = 0;n_err < gen_nb_xmlSchemaValidityErrorFunc_ptr;n_err++) {
33955: for (n_warn = 0;n_warn < gen_nb_xmlSchemaValidityWarningFunc_ptr;n_warn++) {
33956: for (n_ctx = 0;n_ctx < gen_nb_void_ptr_ptr;n_ctx++) {
33957: mem_base = xmlMemBlocks();
33958: ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
33959: err = gen_xmlSchemaValidityErrorFunc_ptr(n_err, 1);
33960: warn = gen_xmlSchemaValidityWarningFunc_ptr(n_warn, 2);
33961: ctx = gen_void_ptr_ptr(n_ctx, 3);
33962:
33963: ret_val = xmlSchemaGetValidErrors(ctxt, err, warn, ctx);
33964: desret_int(ret_val);
33965: call_tests++;
33966: des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
33967: des_xmlSchemaValidityErrorFunc_ptr(n_err, err, 1);
33968: des_xmlSchemaValidityWarningFunc_ptr(n_warn, warn, 2);
33969: des_void_ptr_ptr(n_ctx, ctx, 3);
33970: xmlResetLastError();
33971: if (mem_base != xmlMemBlocks()) {
33972: printf("Leak of %d blocks found in xmlSchemaGetValidErrors",
33973: xmlMemBlocks() - mem_base);
33974: test_ret++;
33975: printf(" %d", n_ctxt);
33976: printf(" %d", n_err);
33977: printf(" %d", n_warn);
33978: printf(" %d", n_ctx);
33979: printf("\n");
33980: }
33981: }
33982: }
33983: }
33984: }
33985: function_tests++;
33986: #endif
33987:
33988: return(test_ret);
33989: }
33990:
33991:
33992: static int
33993: test_xmlSchemaIsValid(void) {
33994: int test_ret = 0;
33995:
33996: #if defined(LIBXML_SCHEMAS_ENABLED)
33997: int mem_base;
33998: int ret_val;
33999: xmlSchemaValidCtxtPtr ctxt; /* the schema validation context */
34000: int n_ctxt;
34001:
34002: for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34003: mem_base = xmlMemBlocks();
34004: ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34005:
34006: ret_val = xmlSchemaIsValid(ctxt);
34007: desret_int(ret_val);
34008: call_tests++;
34009: des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34010: xmlResetLastError();
34011: if (mem_base != xmlMemBlocks()) {
34012: printf("Leak of %d blocks found in xmlSchemaIsValid",
34013: xmlMemBlocks() - mem_base);
34014: test_ret++;
34015: printf(" %d", n_ctxt);
34016: printf("\n");
34017: }
34018: }
34019: function_tests++;
34020: #endif
34021:
34022: return(test_ret);
34023: }
34024:
34025:
34026: static int
34027: test_xmlSchemaNewDocParserCtxt(void) {
34028: int test_ret = 0;
34029:
34030: #if defined(LIBXML_SCHEMAS_ENABLED)
34031: int mem_base;
34032: xmlSchemaParserCtxtPtr ret_val;
34033: xmlDocPtr doc; /* a preparsed document tree */
34034: int n_doc;
34035:
34036: for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
34037: mem_base = xmlMemBlocks();
34038: doc = gen_xmlDocPtr(n_doc, 0);
34039:
34040: ret_val = xmlSchemaNewDocParserCtxt(doc);
34041: desret_xmlSchemaParserCtxtPtr(ret_val);
34042: call_tests++;
34043: des_xmlDocPtr(n_doc, doc, 0);
34044: xmlResetLastError();
34045: if (mem_base != xmlMemBlocks()) {
34046: printf("Leak of %d blocks found in xmlSchemaNewDocParserCtxt",
34047: xmlMemBlocks() - mem_base);
34048: test_ret++;
34049: printf(" %d", n_doc);
34050: printf("\n");
34051: }
34052: }
34053: function_tests++;
34054: #endif
34055:
34056: return(test_ret);
34057: }
34058:
34059:
34060: static int
34061: test_xmlSchemaNewMemParserCtxt(void) {
34062: int test_ret = 0;
34063:
34064: #if defined(LIBXML_SCHEMAS_ENABLED)
34065: int mem_base;
34066: xmlSchemaParserCtxtPtr ret_val;
34067: char * buffer; /* a pointer to a char array containing the schemas */
34068: int n_buffer;
34069: int size; /* the size of the array */
34070: int n_size;
34071:
34072: for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
34073: for (n_size = 0;n_size < gen_nb_int;n_size++) {
34074: mem_base = xmlMemBlocks();
34075: buffer = gen_const_char_ptr(n_buffer, 0);
34076: size = gen_int(n_size, 1);
34077:
34078: ret_val = xmlSchemaNewMemParserCtxt((const char *)buffer, size);
34079: desret_xmlSchemaParserCtxtPtr(ret_val);
34080: call_tests++;
34081: des_const_char_ptr(n_buffer, (const char *)buffer, 0);
34082: des_int(n_size, size, 1);
34083: xmlResetLastError();
34084: if (mem_base != xmlMemBlocks()) {
34085: printf("Leak of %d blocks found in xmlSchemaNewMemParserCtxt",
34086: xmlMemBlocks() - mem_base);
34087: test_ret++;
34088: printf(" %d", n_buffer);
34089: printf(" %d", n_size);
34090: printf("\n");
34091: }
34092: }
34093: }
34094: function_tests++;
34095: #endif
34096:
34097: return(test_ret);
34098: }
34099:
34100:
34101: static int
34102: test_xmlSchemaNewParserCtxt(void) {
34103: int test_ret = 0;
34104:
34105: #if defined(LIBXML_SCHEMAS_ENABLED)
34106: int mem_base;
34107: xmlSchemaParserCtxtPtr ret_val;
34108: char * URL; /* the location of the schema */
34109: int n_URL;
34110:
34111: for (n_URL = 0;n_URL < gen_nb_const_char_ptr;n_URL++) {
34112: mem_base = xmlMemBlocks();
34113: URL = gen_const_char_ptr(n_URL, 0);
34114:
34115: ret_val = xmlSchemaNewParserCtxt((const char *)URL);
34116: desret_xmlSchemaParserCtxtPtr(ret_val);
34117: call_tests++;
34118: des_const_char_ptr(n_URL, (const char *)URL, 0);
34119: xmlResetLastError();
34120: if (mem_base != xmlMemBlocks()) {
34121: printf("Leak of %d blocks found in xmlSchemaNewParserCtxt",
34122: xmlMemBlocks() - mem_base);
34123: test_ret++;
34124: printf(" %d", n_URL);
34125: printf("\n");
34126: }
34127: }
34128: function_tests++;
34129: #endif
34130:
34131: return(test_ret);
34132: }
34133:
34134:
34135: static int
34136: test_xmlSchemaNewValidCtxt(void) {
34137: int test_ret = 0;
34138:
34139:
34140: /* missing type support */
34141: return(test_ret);
34142: }
34143:
34144:
34145: static int
34146: test_xmlSchemaParse(void) {
34147: int test_ret = 0;
34148:
34149:
34150: /* missing type support */
34151: return(test_ret);
34152: }
34153:
34154: #ifdef LIBXML_SCHEMAS_ENABLED
34155:
34156: #define gen_nb_xmlSAXHandlerPtr_ptr 1
34157: static xmlSAXHandlerPtr * gen_xmlSAXHandlerPtr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34158: return(NULL);
34159: }
34160: static void des_xmlSAXHandlerPtr_ptr(int no ATTRIBUTE_UNUSED, xmlSAXHandlerPtr * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34161: }
34162: #endif
34163:
34164:
34165: static int
34166: test_xmlSchemaSAXPlug(void) {
34167: int test_ret = 0;
34168:
34169:
34170: /* missing type support */
34171: return(test_ret);
34172: }
34173:
34174: #ifdef LIBXML_SCHEMAS_ENABLED
34175:
34176: #define gen_nb_xmlSchemaSAXPlugPtr 1
34177: static xmlSchemaSAXPlugPtr gen_xmlSchemaSAXPlugPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34178: return(NULL);
34179: }
34180: static void des_xmlSchemaSAXPlugPtr(int no ATTRIBUTE_UNUSED, xmlSchemaSAXPlugPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34181: }
34182: #endif
34183:
34184:
34185: static int
34186: test_xmlSchemaSAXUnplug(void) {
34187: int test_ret = 0;
34188:
34189: #if defined(LIBXML_SCHEMAS_ENABLED)
34190: int mem_base;
34191: int ret_val;
34192: xmlSchemaSAXPlugPtr plug; /* a data structure returned by xmlSchemaSAXPlug */
34193: int n_plug;
34194:
34195: for (n_plug = 0;n_plug < gen_nb_xmlSchemaSAXPlugPtr;n_plug++) {
34196: mem_base = xmlMemBlocks();
34197: plug = gen_xmlSchemaSAXPlugPtr(n_plug, 0);
34198:
34199: ret_val = xmlSchemaSAXUnplug(plug);
34200: desret_int(ret_val);
34201: call_tests++;
34202: des_xmlSchemaSAXPlugPtr(n_plug, plug, 0);
34203: xmlResetLastError();
34204: if (mem_base != xmlMemBlocks()) {
34205: printf("Leak of %d blocks found in xmlSchemaSAXUnplug",
34206: xmlMemBlocks() - mem_base);
34207: test_ret++;
34208: printf(" %d", n_plug);
34209: printf("\n");
34210: }
34211: }
34212: function_tests++;
34213: #endif
34214:
34215: return(test_ret);
34216: }
34217:
34218:
34219: static int
34220: test_xmlSchemaSetParserErrors(void) {
34221: int test_ret = 0;
34222:
34223:
34224: /* missing type support */
34225: return(test_ret);
34226: }
34227:
34228:
34229: static int
34230: test_xmlSchemaSetParserStructuredErrors(void) {
34231: int test_ret = 0;
34232:
34233:
34234: /* missing type support */
34235: return(test_ret);
34236: }
34237:
34238:
34239: static int
34240: test_xmlSchemaSetValidErrors(void) {
34241: int test_ret = 0;
34242:
34243:
34244: /* missing type support */
34245: return(test_ret);
34246: }
34247:
34248:
34249: static int
34250: test_xmlSchemaSetValidOptions(void) {
34251: int test_ret = 0;
34252:
34253: #if defined(LIBXML_SCHEMAS_ENABLED)
34254: int mem_base;
34255: int ret_val;
34256: xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
34257: int n_ctxt;
34258: int options; /* a combination of xmlSchemaValidOption */
34259: int n_options;
34260:
34261: for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34262: for (n_options = 0;n_options < gen_nb_int;n_options++) {
34263: mem_base = xmlMemBlocks();
34264: ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34265: options = gen_int(n_options, 1);
34266:
34267: ret_val = xmlSchemaSetValidOptions(ctxt, options);
34268: desret_int(ret_val);
34269: call_tests++;
34270: des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34271: des_int(n_options, options, 1);
34272: xmlResetLastError();
34273: if (mem_base != xmlMemBlocks()) {
34274: printf("Leak of %d blocks found in xmlSchemaSetValidOptions",
34275: xmlMemBlocks() - mem_base);
34276: test_ret++;
34277: printf(" %d", n_ctxt);
34278: printf(" %d", n_options);
34279: printf("\n");
34280: }
34281: }
34282: }
34283: function_tests++;
34284: #endif
34285:
34286: return(test_ret);
34287: }
34288:
34289:
34290: static int
34291: test_xmlSchemaSetValidStructuredErrors(void) {
34292: int test_ret = 0;
34293:
34294:
34295: /* missing type support */
34296: return(test_ret);
34297: }
34298:
34299:
34300: static int
34301: test_xmlSchemaValidCtxtGetOptions(void) {
34302: int test_ret = 0;
34303:
34304: #if defined(LIBXML_SCHEMAS_ENABLED)
34305: int mem_base;
34306: int ret_val;
34307: xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
34308: int n_ctxt;
34309:
34310: for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34311: mem_base = xmlMemBlocks();
34312: ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34313:
34314: ret_val = xmlSchemaValidCtxtGetOptions(ctxt);
34315: desret_int(ret_val);
34316: call_tests++;
34317: des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34318: xmlResetLastError();
34319: if (mem_base != xmlMemBlocks()) {
34320: printf("Leak of %d blocks found in xmlSchemaValidCtxtGetOptions",
34321: xmlMemBlocks() - mem_base);
34322: test_ret++;
34323: printf(" %d", n_ctxt);
34324: printf("\n");
34325: }
34326: }
34327: function_tests++;
34328: #endif
34329:
34330: return(test_ret);
34331: }
34332:
34333:
34334: static int
34335: test_xmlSchemaValidCtxtGetParserCtxt(void) {
34336: int test_ret = 0;
34337:
34338: #if defined(LIBXML_SCHEMAS_ENABLED)
34339: int mem_base;
34340: xmlParserCtxtPtr ret_val;
34341: xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
34342: int n_ctxt;
34343:
34344: for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34345: mem_base = xmlMemBlocks();
34346: ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34347:
34348: ret_val = xmlSchemaValidCtxtGetParserCtxt(ctxt);
34349: desret_xmlParserCtxtPtr(ret_val);
34350: call_tests++;
34351: des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34352: xmlResetLastError();
34353: if (mem_base != xmlMemBlocks()) {
34354: printf("Leak of %d blocks found in xmlSchemaValidCtxtGetParserCtxt",
34355: xmlMemBlocks() - mem_base);
34356: test_ret++;
34357: printf(" %d", n_ctxt);
34358: printf("\n");
34359: }
34360: }
34361: function_tests++;
34362: #endif
34363:
34364: return(test_ret);
34365: }
34366:
34367:
34368: static int
34369: test_xmlSchemaValidateDoc(void) {
34370: int test_ret = 0;
34371:
34372: #if defined(LIBXML_SCHEMAS_ENABLED)
34373: int mem_base;
34374: int ret_val;
34375: xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
34376: int n_ctxt;
34377: xmlDocPtr doc; /* a parsed document tree */
34378: int n_doc;
34379:
34380: for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34381: for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
34382: mem_base = xmlMemBlocks();
34383: ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34384: doc = gen_xmlDocPtr(n_doc, 1);
34385:
34386: ret_val = xmlSchemaValidateDoc(ctxt, doc);
34387: desret_int(ret_val);
34388: call_tests++;
34389: des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34390: des_xmlDocPtr(n_doc, doc, 1);
34391: xmlResetLastError();
34392: if (mem_base != xmlMemBlocks()) {
34393: printf("Leak of %d blocks found in xmlSchemaValidateDoc",
34394: xmlMemBlocks() - mem_base);
34395: test_ret++;
34396: printf(" %d", n_ctxt);
34397: printf(" %d", n_doc);
34398: printf("\n");
34399: }
34400: }
34401: }
34402: function_tests++;
34403: #endif
34404:
34405: return(test_ret);
34406: }
34407:
34408:
34409: static int
34410: test_xmlSchemaValidateFile(void) {
34411: int test_ret = 0;
34412:
34413: #if defined(LIBXML_SCHEMAS_ENABLED)
34414: int mem_base;
34415: int ret_val;
34416: xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
34417: int n_ctxt;
34418: const char * filename; /* the URI of the instance */
34419: int n_filename;
34420: int options; /* a future set of options, currently unused */
34421: int n_options;
34422:
34423: for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34424: for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
34425: for (n_options = 0;n_options < gen_nb_int;n_options++) {
34426: mem_base = xmlMemBlocks();
34427: ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34428: filename = gen_filepath(n_filename, 1);
34429: options = gen_int(n_options, 2);
34430:
34431: ret_val = xmlSchemaValidateFile(ctxt, filename, options);
34432: desret_int(ret_val);
34433: call_tests++;
34434: des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34435: des_filepath(n_filename, filename, 1);
34436: des_int(n_options, options, 2);
34437: xmlResetLastError();
34438: if (mem_base != xmlMemBlocks()) {
34439: printf("Leak of %d blocks found in xmlSchemaValidateFile",
34440: xmlMemBlocks() - mem_base);
34441: test_ret++;
34442: printf(" %d", n_ctxt);
34443: printf(" %d", n_filename);
34444: printf(" %d", n_options);
34445: printf("\n");
34446: }
34447: }
34448: }
34449: }
34450: function_tests++;
34451: #endif
34452:
34453: return(test_ret);
34454: }
34455:
34456:
34457: static int
34458: test_xmlSchemaValidateOneElement(void) {
34459: int test_ret = 0;
34460:
34461: #if defined(LIBXML_SCHEMAS_ENABLED)
34462: int mem_base;
34463: int ret_val;
34464: xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
34465: int n_ctxt;
34466: xmlNodePtr elem; /* an element node */
34467: int n_elem;
34468:
34469: for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34470: for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
34471: mem_base = xmlMemBlocks();
34472: ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34473: elem = gen_xmlNodePtr(n_elem, 1);
34474:
34475: ret_val = xmlSchemaValidateOneElement(ctxt, elem);
34476: desret_int(ret_val);
34477: call_tests++;
34478: des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34479: des_xmlNodePtr(n_elem, elem, 1);
34480: xmlResetLastError();
34481: if (mem_base != xmlMemBlocks()) {
34482: printf("Leak of %d blocks found in xmlSchemaValidateOneElement",
34483: xmlMemBlocks() - mem_base);
34484: test_ret++;
34485: printf(" %d", n_ctxt);
34486: printf(" %d", n_elem);
34487: printf("\n");
34488: }
34489: }
34490: }
34491: function_tests++;
34492: #endif
34493:
34494: return(test_ret);
34495: }
34496:
34497:
34498: static int
34499: test_xmlSchemaValidateStream(void) {
34500: int test_ret = 0;
34501:
34502: #if defined(LIBXML_SCHEMAS_ENABLED)
34503: int mem_base;
34504: int ret_val;
34505: xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
34506: int n_ctxt;
34507: xmlParserInputBufferPtr input; /* the input to use for reading the data */
34508: int n_input;
34509: xmlCharEncoding enc; /* an optional encoding information */
34510: int n_enc;
34511: xmlSAXHandlerPtr sax; /* a SAX handler for the resulting events */
34512: int n_sax;
34513: void * user_data; /* the context to provide to the SAX handler. */
34514: int n_user_data;
34515:
34516: for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34517: for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
34518: for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
34519: for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
34520: for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
34521: mem_base = xmlMemBlocks();
34522: ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34523: input = gen_xmlParserInputBufferPtr(n_input, 1);
34524: enc = gen_xmlCharEncoding(n_enc, 2);
34525: sax = gen_xmlSAXHandlerPtr(n_sax, 3);
34526: user_data = gen_userdata(n_user_data, 4);
34527:
34528: ret_val = xmlSchemaValidateStream(ctxt, input, enc, sax, user_data);
34529: desret_int(ret_val);
34530: call_tests++;
34531: des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34532: des_xmlParserInputBufferPtr(n_input, input, 1);
34533: des_xmlCharEncoding(n_enc, enc, 2);
34534: des_xmlSAXHandlerPtr(n_sax, sax, 3);
34535: des_userdata(n_user_data, user_data, 4);
34536: xmlResetLastError();
34537: if (mem_base != xmlMemBlocks()) {
34538: printf("Leak of %d blocks found in xmlSchemaValidateStream",
34539: xmlMemBlocks() - mem_base);
34540: test_ret++;
34541: printf(" %d", n_ctxt);
34542: printf(" %d", n_input);
34543: printf(" %d", n_enc);
34544: printf(" %d", n_sax);
34545: printf(" %d", n_user_data);
34546: printf("\n");
34547: }
34548: }
34549: }
34550: }
34551: }
34552: }
34553: function_tests++;
34554: #endif
34555:
34556: return(test_ret);
34557: }
34558:
34559: static int
34560: test_xmlschemas(void) {
34561: int test_ret = 0;
34562:
34563: if (quiet == 0) printf("Testing xmlschemas : 15 of 25 functions ...\n");
34564: test_ret += test_xmlSchemaDump();
34565: test_ret += test_xmlSchemaGetParserErrors();
34566: test_ret += test_xmlSchemaGetValidErrors();
34567: test_ret += test_xmlSchemaIsValid();
34568: test_ret += test_xmlSchemaNewDocParserCtxt();
34569: test_ret += test_xmlSchemaNewMemParserCtxt();
34570: test_ret += test_xmlSchemaNewParserCtxt();
34571: test_ret += test_xmlSchemaNewValidCtxt();
34572: test_ret += test_xmlSchemaParse();
34573: test_ret += test_xmlSchemaSAXPlug();
34574: test_ret += test_xmlSchemaSAXUnplug();
34575: test_ret += test_xmlSchemaSetParserErrors();
34576: test_ret += test_xmlSchemaSetParserStructuredErrors();
34577: test_ret += test_xmlSchemaSetValidErrors();
34578: test_ret += test_xmlSchemaSetValidOptions();
34579: test_ret += test_xmlSchemaSetValidStructuredErrors();
34580: test_ret += test_xmlSchemaValidCtxtGetOptions();
34581: test_ret += test_xmlSchemaValidCtxtGetParserCtxt();
34582: test_ret += test_xmlSchemaValidateDoc();
34583: test_ret += test_xmlSchemaValidateFile();
34584: test_ret += test_xmlSchemaValidateOneElement();
34585: test_ret += test_xmlSchemaValidateStream();
34586:
34587: if (test_ret != 0)
34588: printf("Module xmlschemas: %d errors\n", test_ret);
34589: return(test_ret);
34590: }
34591: #ifdef LIBXML_SCHEMAS_ENABLED
34592:
34593: #define gen_nb_xmlSchemaFacetPtr 1
34594: static xmlSchemaFacetPtr gen_xmlSchemaFacetPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34595: return(NULL);
34596: }
34597: static void des_xmlSchemaFacetPtr(int no ATTRIBUTE_UNUSED, xmlSchemaFacetPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34598: }
34599: #endif
34600:
34601: #ifdef LIBXML_SCHEMAS_ENABLED
34602:
34603: #define gen_nb_xmlSchemaTypePtr 1
34604: static xmlSchemaTypePtr gen_xmlSchemaTypePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34605: return(NULL);
34606: }
34607: static void des_xmlSchemaTypePtr(int no ATTRIBUTE_UNUSED, xmlSchemaTypePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34608: }
34609: #endif
34610:
34611:
34612: static int
34613: test_xmlSchemaCheckFacet(void) {
34614: int test_ret = 0;
34615:
34616: #if defined(LIBXML_SCHEMAS_ENABLED)
34617: int mem_base;
34618: int ret_val;
34619: xmlSchemaFacetPtr facet; /* the facet */
34620: int n_facet;
34621: xmlSchemaTypePtr typeDecl; /* the schema type definition */
34622: int n_typeDecl;
34623: xmlSchemaParserCtxtPtr pctxt; /* the schema parser context or NULL */
34624: int n_pctxt;
34625: xmlChar * name; /* the optional name of the type */
34626: int n_name;
34627:
34628: for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
34629: for (n_typeDecl = 0;n_typeDecl < gen_nb_xmlSchemaTypePtr;n_typeDecl++) {
34630: for (n_pctxt = 0;n_pctxt < gen_nb_xmlSchemaParserCtxtPtr;n_pctxt++) {
34631: for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
34632: mem_base = xmlMemBlocks();
34633: facet = gen_xmlSchemaFacetPtr(n_facet, 0);
34634: typeDecl = gen_xmlSchemaTypePtr(n_typeDecl, 1);
34635: pctxt = gen_xmlSchemaParserCtxtPtr(n_pctxt, 2);
34636: name = gen_const_xmlChar_ptr(n_name, 3);
34637:
34638: ret_val = xmlSchemaCheckFacet(facet, typeDecl, pctxt, (const xmlChar *)name);
34639: desret_int(ret_val);
34640: call_tests++;
34641: des_xmlSchemaFacetPtr(n_facet, facet, 0);
34642: des_xmlSchemaTypePtr(n_typeDecl, typeDecl, 1);
34643: des_xmlSchemaParserCtxtPtr(n_pctxt, pctxt, 2);
34644: des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 3);
34645: xmlResetLastError();
34646: if (mem_base != xmlMemBlocks()) {
34647: printf("Leak of %d blocks found in xmlSchemaCheckFacet",
34648: xmlMemBlocks() - mem_base);
34649: test_ret++;
34650: printf(" %d", n_facet);
34651: printf(" %d", n_typeDecl);
34652: printf(" %d", n_pctxt);
34653: printf(" %d", n_name);
34654: printf("\n");
34655: }
34656: }
34657: }
34658: }
34659: }
34660: function_tests++;
34661: #endif
34662:
34663: return(test_ret);
34664: }
34665:
34666:
34667: static int
34668: test_xmlSchemaCleanupTypes(void) {
34669: int test_ret = 0;
34670:
34671: #if defined(LIBXML_SCHEMAS_ENABLED)
34672:
34673:
34674: xmlSchemaCleanupTypes();
34675: call_tests++;
34676: xmlResetLastError();
34677: function_tests++;
34678: #endif
34679:
34680: return(test_ret);
34681: }
34682:
34683:
34684: static int
34685: test_xmlSchemaCollapseString(void) {
34686: int test_ret = 0;
34687:
34688: #if defined(LIBXML_SCHEMAS_ENABLED)
34689: int mem_base;
34690: xmlChar * ret_val;
34691: xmlChar * value; /* a value */
34692: int n_value;
34693:
34694: for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
34695: mem_base = xmlMemBlocks();
34696: value = gen_const_xmlChar_ptr(n_value, 0);
34697:
34698: ret_val = xmlSchemaCollapseString((const xmlChar *)value);
34699: desret_xmlChar_ptr(ret_val);
34700: call_tests++;
34701: des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
34702: xmlResetLastError();
34703: if (mem_base != xmlMemBlocks()) {
34704: printf("Leak of %d blocks found in xmlSchemaCollapseString",
34705: xmlMemBlocks() - mem_base);
34706: test_ret++;
34707: printf(" %d", n_value);
34708: printf("\n");
34709: }
34710: }
34711: function_tests++;
34712: #endif
34713:
34714: return(test_ret);
34715: }
34716:
34717: #ifdef LIBXML_SCHEMAS_ENABLED
34718:
34719: #define gen_nb_xmlSchemaValPtr 1
34720: static xmlSchemaValPtr gen_xmlSchemaValPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34721: return(NULL);
34722: }
34723: static void des_xmlSchemaValPtr(int no ATTRIBUTE_UNUSED, xmlSchemaValPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34724: }
34725: #endif
34726:
34727:
34728: static int
34729: test_xmlSchemaCompareValues(void) {
34730: int test_ret = 0;
34731:
34732: #if defined(LIBXML_SCHEMAS_ENABLED)
34733: int mem_base;
34734: int ret_val;
34735: xmlSchemaValPtr x; /* a first value */
34736: int n_x;
34737: xmlSchemaValPtr y; /* a second value */
34738: int n_y;
34739:
34740: for (n_x = 0;n_x < gen_nb_xmlSchemaValPtr;n_x++) {
34741: for (n_y = 0;n_y < gen_nb_xmlSchemaValPtr;n_y++) {
34742: mem_base = xmlMemBlocks();
34743: x = gen_xmlSchemaValPtr(n_x, 0);
34744: y = gen_xmlSchemaValPtr(n_y, 1);
34745:
34746: ret_val = xmlSchemaCompareValues(x, y);
34747: desret_int(ret_val);
34748: call_tests++;
34749: des_xmlSchemaValPtr(n_x, x, 0);
34750: des_xmlSchemaValPtr(n_y, y, 1);
34751: xmlResetLastError();
34752: if (mem_base != xmlMemBlocks()) {
34753: printf("Leak of %d blocks found in xmlSchemaCompareValues",
34754: xmlMemBlocks() - mem_base);
34755: test_ret++;
34756: printf(" %d", n_x);
34757: printf(" %d", n_y);
34758: printf("\n");
34759: }
34760: }
34761: }
34762: function_tests++;
34763: #endif
34764:
34765: return(test_ret);
34766: }
34767:
34768:
34769: static int
34770: test_xmlSchemaCompareValuesWhtsp(void) {
34771: int test_ret = 0;
34772:
34773: #if defined(LIBXML_SCHEMAS_ENABLED)
34774: int mem_base;
34775: int ret_val;
34776: xmlSchemaValPtr x; /* a first value */
34777: int n_x;
34778: xmlSchemaWhitespaceValueType xws; /* the whitespace value of x */
34779: int n_xws;
34780: xmlSchemaValPtr y; /* a second value */
34781: int n_y;
34782: xmlSchemaWhitespaceValueType yws; /* the whitespace value of y */
34783: int n_yws;
34784:
34785: for (n_x = 0;n_x < gen_nb_xmlSchemaValPtr;n_x++) {
34786: for (n_xws = 0;n_xws < gen_nb_xmlSchemaWhitespaceValueType;n_xws++) {
34787: for (n_y = 0;n_y < gen_nb_xmlSchemaValPtr;n_y++) {
34788: for (n_yws = 0;n_yws < gen_nb_xmlSchemaWhitespaceValueType;n_yws++) {
34789: mem_base = xmlMemBlocks();
34790: x = gen_xmlSchemaValPtr(n_x, 0);
34791: xws = gen_xmlSchemaWhitespaceValueType(n_xws, 1);
34792: y = gen_xmlSchemaValPtr(n_y, 2);
34793: yws = gen_xmlSchemaWhitespaceValueType(n_yws, 3);
34794:
34795: ret_val = xmlSchemaCompareValuesWhtsp(x, xws, y, yws);
34796: desret_int(ret_val);
34797: call_tests++;
34798: des_xmlSchemaValPtr(n_x, x, 0);
34799: des_xmlSchemaWhitespaceValueType(n_xws, xws, 1);
34800: des_xmlSchemaValPtr(n_y, y, 2);
34801: des_xmlSchemaWhitespaceValueType(n_yws, yws, 3);
34802: xmlResetLastError();
34803: if (mem_base != xmlMemBlocks()) {
34804: printf("Leak of %d blocks found in xmlSchemaCompareValuesWhtsp",
34805: xmlMemBlocks() - mem_base);
34806: test_ret++;
34807: printf(" %d", n_x);
34808: printf(" %d", n_xws);
34809: printf(" %d", n_y);
34810: printf(" %d", n_yws);
34811: printf("\n");
34812: }
34813: }
34814: }
34815: }
34816: }
34817: function_tests++;
34818: #endif
34819:
34820: return(test_ret);
34821: }
34822:
34823:
34824: static int
34825: test_xmlSchemaCopyValue(void) {
34826: int test_ret = 0;
34827:
34828:
34829: /* missing type support */
34830: return(test_ret);
34831: }
34832:
34833:
34834: static int
34835: test_xmlSchemaGetBuiltInListSimpleTypeItemType(void) {
34836: int test_ret = 0;
34837:
34838: #if defined(LIBXML_SCHEMAS_ENABLED)
34839: int mem_base;
34840: xmlSchemaTypePtr ret_val;
34841: xmlSchemaTypePtr type; /* the built-in simple type. */
34842: int n_type;
34843:
34844: for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
34845: mem_base = xmlMemBlocks();
34846: type = gen_xmlSchemaTypePtr(n_type, 0);
34847:
34848: ret_val = xmlSchemaGetBuiltInListSimpleTypeItemType(type);
34849: desret_xmlSchemaTypePtr(ret_val);
34850: call_tests++;
34851: des_xmlSchemaTypePtr(n_type, type, 0);
34852: xmlResetLastError();
34853: if (mem_base != xmlMemBlocks()) {
34854: printf("Leak of %d blocks found in xmlSchemaGetBuiltInListSimpleTypeItemType",
34855: xmlMemBlocks() - mem_base);
34856: test_ret++;
34857: printf(" %d", n_type);
34858: printf("\n");
34859: }
34860: }
34861: function_tests++;
34862: #endif
34863:
34864: return(test_ret);
34865: }
34866:
34867:
34868: static int
34869: test_xmlSchemaGetBuiltInType(void) {
34870: int test_ret = 0;
34871:
34872: #if defined(LIBXML_SCHEMAS_ENABLED)
34873: xmlSchemaTypePtr ret_val;
34874: xmlSchemaValType type; /* the type of the built in type */
34875: int n_type;
34876:
34877: for (n_type = 0;n_type < gen_nb_xmlSchemaValType;n_type++) {
34878: type = gen_xmlSchemaValType(n_type, 0);
34879:
34880: ret_val = xmlSchemaGetBuiltInType(type);
34881: desret_xmlSchemaTypePtr(ret_val);
34882: call_tests++;
34883: des_xmlSchemaValType(n_type, type, 0);
34884: xmlResetLastError();
34885: }
34886: function_tests++;
34887: #endif
34888:
34889: return(test_ret);
34890: }
34891:
34892:
34893: static int
34894: test_xmlSchemaGetCanonValue(void) {
34895: int test_ret = 0;
34896:
34897: #if defined(LIBXML_SCHEMAS_ENABLED)
34898: int mem_base;
34899: int ret_val;
34900: xmlSchemaValPtr val; /* the precomputed value */
34901: int n_val;
34902: xmlChar ** retValue; /* the returned value */
34903: int n_retValue;
34904:
34905: for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
34906: for (n_retValue = 0;n_retValue < gen_nb_const_xmlChar_ptr_ptr;n_retValue++) {
34907: mem_base = xmlMemBlocks();
34908: val = gen_xmlSchemaValPtr(n_val, 0);
34909: retValue = gen_const_xmlChar_ptr_ptr(n_retValue, 1);
34910:
34911: ret_val = xmlSchemaGetCanonValue(val, (const xmlChar **)retValue);
34912: desret_int(ret_val);
34913: call_tests++;
34914: des_xmlSchemaValPtr(n_val, val, 0);
34915: des_const_xmlChar_ptr_ptr(n_retValue, (const xmlChar **)retValue, 1);
34916: xmlResetLastError();
34917: if (mem_base != xmlMemBlocks()) {
34918: printf("Leak of %d blocks found in xmlSchemaGetCanonValue",
34919: xmlMemBlocks() - mem_base);
34920: test_ret++;
34921: printf(" %d", n_val);
34922: printf(" %d", n_retValue);
34923: printf("\n");
34924: }
34925: }
34926: }
34927: function_tests++;
34928: #endif
34929:
34930: return(test_ret);
34931: }
34932:
34933:
34934: static int
34935: test_xmlSchemaGetCanonValueWhtsp(void) {
34936: int test_ret = 0;
34937:
34938: #if defined(LIBXML_SCHEMAS_ENABLED)
34939: int mem_base;
34940: int ret_val;
34941: xmlSchemaValPtr val; /* the precomputed value */
34942: int n_val;
34943: xmlChar ** retValue; /* the returned value */
34944: int n_retValue;
34945: xmlSchemaWhitespaceValueType ws; /* the whitespace type of the value */
34946: int n_ws;
34947:
34948: for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
34949: for (n_retValue = 0;n_retValue < gen_nb_const_xmlChar_ptr_ptr;n_retValue++) {
34950: for (n_ws = 0;n_ws < gen_nb_xmlSchemaWhitespaceValueType;n_ws++) {
34951: mem_base = xmlMemBlocks();
34952: val = gen_xmlSchemaValPtr(n_val, 0);
34953: retValue = gen_const_xmlChar_ptr_ptr(n_retValue, 1);
34954: ws = gen_xmlSchemaWhitespaceValueType(n_ws, 2);
34955:
34956: ret_val = xmlSchemaGetCanonValueWhtsp(val, (const xmlChar **)retValue, ws);
34957: desret_int(ret_val);
34958: call_tests++;
34959: des_xmlSchemaValPtr(n_val, val, 0);
34960: des_const_xmlChar_ptr_ptr(n_retValue, (const xmlChar **)retValue, 1);
34961: des_xmlSchemaWhitespaceValueType(n_ws, ws, 2);
34962: xmlResetLastError();
34963: if (mem_base != xmlMemBlocks()) {
34964: printf("Leak of %d blocks found in xmlSchemaGetCanonValueWhtsp",
34965: xmlMemBlocks() - mem_base);
34966: test_ret++;
34967: printf(" %d", n_val);
34968: printf(" %d", n_retValue);
34969: printf(" %d", n_ws);
34970: printf("\n");
34971: }
34972: }
34973: }
34974: }
34975: function_tests++;
34976: #endif
34977:
34978: return(test_ret);
34979: }
34980:
34981:
34982: static int
34983: test_xmlSchemaGetFacetValueAsULong(void) {
34984: int test_ret = 0;
34985:
34986: #if defined(LIBXML_SCHEMAS_ENABLED)
34987: int mem_base;
34988: unsigned long ret_val;
34989: xmlSchemaFacetPtr facet; /* an schemas type facet */
34990: int n_facet;
34991:
34992: for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
34993: mem_base = xmlMemBlocks();
34994: facet = gen_xmlSchemaFacetPtr(n_facet, 0);
34995:
34996: ret_val = xmlSchemaGetFacetValueAsULong(facet);
34997: desret_unsigned_long(ret_val);
34998: call_tests++;
34999: des_xmlSchemaFacetPtr(n_facet, facet, 0);
35000: xmlResetLastError();
35001: if (mem_base != xmlMemBlocks()) {
35002: printf("Leak of %d blocks found in xmlSchemaGetFacetValueAsULong",
35003: xmlMemBlocks() - mem_base);
35004: test_ret++;
35005: printf(" %d", n_facet);
35006: printf("\n");
35007: }
35008: }
35009: function_tests++;
35010: #endif
35011:
35012: return(test_ret);
35013: }
35014:
35015:
35016: static int
35017: test_xmlSchemaGetPredefinedType(void) {
35018: int test_ret = 0;
35019:
35020: #if defined(LIBXML_SCHEMAS_ENABLED)
35021: int mem_base;
35022: xmlSchemaTypePtr ret_val;
35023: xmlChar * name; /* the type name */
35024: int n_name;
35025: xmlChar * ns; /* the URI of the namespace usually "http://www.w3.org/2001/XMLSchema" */
35026: int n_ns;
35027:
35028: for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
35029: for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
35030: mem_base = xmlMemBlocks();
35031: name = gen_const_xmlChar_ptr(n_name, 0);
35032: ns = gen_const_xmlChar_ptr(n_ns, 1);
35033:
35034: ret_val = xmlSchemaGetPredefinedType((const xmlChar *)name, (const xmlChar *)ns);
35035: desret_xmlSchemaTypePtr(ret_val);
35036: call_tests++;
35037: des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
35038: des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 1);
35039: xmlResetLastError();
35040: if (mem_base != xmlMemBlocks()) {
35041: printf("Leak of %d blocks found in xmlSchemaGetPredefinedType",
35042: xmlMemBlocks() - mem_base);
35043: test_ret++;
35044: printf(" %d", n_name);
35045: printf(" %d", n_ns);
35046: printf("\n");
35047: }
35048: }
35049: }
35050: function_tests++;
35051: #endif
35052:
35053: return(test_ret);
35054: }
35055:
35056:
35057: static int
35058: test_xmlSchemaGetValType(void) {
35059: int test_ret = 0;
35060:
35061: #if defined(LIBXML_SCHEMAS_ENABLED)
35062: int mem_base;
35063: xmlSchemaValType ret_val;
35064: xmlSchemaValPtr val; /* a schemas value */
35065: int n_val;
35066:
35067: for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35068: mem_base = xmlMemBlocks();
35069: val = gen_xmlSchemaValPtr(n_val, 0);
35070:
35071: ret_val = xmlSchemaGetValType(val);
35072: desret_xmlSchemaValType(ret_val);
35073: call_tests++;
35074: des_xmlSchemaValPtr(n_val, val, 0);
35075: xmlResetLastError();
35076: if (mem_base != xmlMemBlocks()) {
35077: printf("Leak of %d blocks found in xmlSchemaGetValType",
35078: xmlMemBlocks() - mem_base);
35079: test_ret++;
35080: printf(" %d", n_val);
35081: printf("\n");
35082: }
35083: }
35084: function_tests++;
35085: #endif
35086:
35087: return(test_ret);
35088: }
35089:
35090:
35091: static int
35092: test_xmlSchemaInitTypes(void) {
35093: int test_ret = 0;
35094:
35095: #if defined(LIBXML_SCHEMAS_ENABLED)
35096:
35097:
35098: xmlSchemaInitTypes();
35099: call_tests++;
35100: xmlResetLastError();
35101: function_tests++;
35102: #endif
35103:
35104: return(test_ret);
35105: }
35106:
35107:
35108: static int
35109: test_xmlSchemaIsBuiltInTypeFacet(void) {
35110: int test_ret = 0;
35111:
35112: #if defined(LIBXML_SCHEMAS_ENABLED)
35113: int mem_base;
35114: int ret_val;
35115: xmlSchemaTypePtr type; /* the built-in type */
35116: int n_type;
35117: int facetType; /* the facet type */
35118: int n_facetType;
35119:
35120: for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
35121: for (n_facetType = 0;n_facetType < gen_nb_int;n_facetType++) {
35122: mem_base = xmlMemBlocks();
35123: type = gen_xmlSchemaTypePtr(n_type, 0);
35124: facetType = gen_int(n_facetType, 1);
35125:
35126: ret_val = xmlSchemaIsBuiltInTypeFacet(type, facetType);
35127: desret_int(ret_val);
35128: call_tests++;
35129: des_xmlSchemaTypePtr(n_type, type, 0);
35130: des_int(n_facetType, facetType, 1);
35131: xmlResetLastError();
35132: if (mem_base != xmlMemBlocks()) {
35133: printf("Leak of %d blocks found in xmlSchemaIsBuiltInTypeFacet",
35134: xmlMemBlocks() - mem_base);
35135: test_ret++;
35136: printf(" %d", n_type);
35137: printf(" %d", n_facetType);
35138: printf("\n");
35139: }
35140: }
35141: }
35142: function_tests++;
35143: #endif
35144:
35145: return(test_ret);
35146: }
35147:
35148:
35149: static int
35150: test_xmlSchemaNewFacet(void) {
35151: int test_ret = 0;
35152:
35153:
35154: /* missing type support */
35155: return(test_ret);
35156: }
35157:
35158:
35159: static int
35160: test_xmlSchemaNewNOTATIONValue(void) {
35161: int test_ret = 0;
35162:
35163:
35164: /* missing type support */
35165: return(test_ret);
35166: }
35167:
35168:
35169: static int
35170: test_xmlSchemaNewQNameValue(void) {
35171: int test_ret = 0;
35172:
35173:
35174: /* missing type support */
35175: return(test_ret);
35176: }
35177:
35178:
35179: static int
35180: test_xmlSchemaNewStringValue(void) {
35181: int test_ret = 0;
35182:
35183:
35184: /* missing type support */
35185: return(test_ret);
35186: }
35187:
35188: #ifdef LIBXML_SCHEMAS_ENABLED
35189:
35190: #define gen_nb_xmlSchemaValPtr_ptr 1
35191: static xmlSchemaValPtr * gen_xmlSchemaValPtr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
35192: return(NULL);
35193: }
35194: static void des_xmlSchemaValPtr_ptr(int no ATTRIBUTE_UNUSED, xmlSchemaValPtr * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
35195: }
35196: #endif
35197:
35198:
35199: static int
35200: test_xmlSchemaValPredefTypeNode(void) {
35201: int test_ret = 0;
35202:
35203: #if defined(LIBXML_SCHEMAS_ENABLED)
35204: int mem_base;
35205: int ret_val;
35206: xmlSchemaTypePtr type; /* the predefined type */
35207: int n_type;
35208: xmlChar * value; /* the value to check */
35209: int n_value;
35210: xmlSchemaValPtr * val; /* the return computed value */
35211: int n_val;
35212: xmlNodePtr node; /* the node containing the value */
35213: int n_node;
35214:
35215: for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
35216: for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35217: for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr_ptr;n_val++) {
35218: for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
35219: mem_base = xmlMemBlocks();
35220: type = gen_xmlSchemaTypePtr(n_type, 0);
35221: value = gen_const_xmlChar_ptr(n_value, 1);
35222: val = gen_xmlSchemaValPtr_ptr(n_val, 2);
35223: node = gen_xmlNodePtr(n_node, 3);
35224:
35225: ret_val = xmlSchemaValPredefTypeNode(type, (const xmlChar *)value, val, node);
35226: desret_int(ret_val);
35227: call_tests++;
35228: des_xmlSchemaTypePtr(n_type, type, 0);
35229: des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
35230: des_xmlSchemaValPtr_ptr(n_val, val, 2);
35231: des_xmlNodePtr(n_node, node, 3);
35232: xmlResetLastError();
35233: if (mem_base != xmlMemBlocks()) {
35234: printf("Leak of %d blocks found in xmlSchemaValPredefTypeNode",
35235: xmlMemBlocks() - mem_base);
35236: test_ret++;
35237: printf(" %d", n_type);
35238: printf(" %d", n_value);
35239: printf(" %d", n_val);
35240: printf(" %d", n_node);
35241: printf("\n");
35242: }
35243: }
35244: }
35245: }
35246: }
35247: function_tests++;
35248: #endif
35249:
35250: return(test_ret);
35251: }
35252:
35253:
35254: static int
35255: test_xmlSchemaValPredefTypeNodeNoNorm(void) {
35256: int test_ret = 0;
35257:
35258: #if defined(LIBXML_SCHEMAS_ENABLED)
35259: int mem_base;
35260: int ret_val;
35261: xmlSchemaTypePtr type; /* the predefined type */
35262: int n_type;
35263: xmlChar * value; /* the value to check */
35264: int n_value;
35265: xmlSchemaValPtr * val; /* the return computed value */
35266: int n_val;
35267: xmlNodePtr node; /* the node containing the value */
35268: int n_node;
35269:
35270: for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
35271: for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35272: for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr_ptr;n_val++) {
35273: for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
35274: mem_base = xmlMemBlocks();
35275: type = gen_xmlSchemaTypePtr(n_type, 0);
35276: value = gen_const_xmlChar_ptr(n_value, 1);
35277: val = gen_xmlSchemaValPtr_ptr(n_val, 2);
35278: node = gen_xmlNodePtr(n_node, 3);
35279:
35280: ret_val = xmlSchemaValPredefTypeNodeNoNorm(type, (const xmlChar *)value, val, node);
35281: desret_int(ret_val);
35282: call_tests++;
35283: des_xmlSchemaTypePtr(n_type, type, 0);
35284: des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
35285: des_xmlSchemaValPtr_ptr(n_val, val, 2);
35286: des_xmlNodePtr(n_node, node, 3);
35287: xmlResetLastError();
35288: if (mem_base != xmlMemBlocks()) {
35289: printf("Leak of %d blocks found in xmlSchemaValPredefTypeNodeNoNorm",
35290: xmlMemBlocks() - mem_base);
35291: test_ret++;
35292: printf(" %d", n_type);
35293: printf(" %d", n_value);
35294: printf(" %d", n_val);
35295: printf(" %d", n_node);
35296: printf("\n");
35297: }
35298: }
35299: }
35300: }
35301: }
35302: function_tests++;
35303: #endif
35304:
35305: return(test_ret);
35306: }
35307:
35308:
35309: static int
35310: test_xmlSchemaValidateFacet(void) {
35311: int test_ret = 0;
35312:
35313: #if defined(LIBXML_SCHEMAS_ENABLED)
35314: int mem_base;
35315: int ret_val;
35316: xmlSchemaTypePtr base; /* the base type */
35317: int n_base;
35318: xmlSchemaFacetPtr facet; /* the facet to check */
35319: int n_facet;
35320: xmlChar * value; /* the lexical repr of the value to validate */
35321: int n_value;
35322: xmlSchemaValPtr val; /* the precomputed value */
35323: int n_val;
35324:
35325: for (n_base = 0;n_base < gen_nb_xmlSchemaTypePtr;n_base++) {
35326: for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
35327: for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35328: for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35329: mem_base = xmlMemBlocks();
35330: base = gen_xmlSchemaTypePtr(n_base, 0);
35331: facet = gen_xmlSchemaFacetPtr(n_facet, 1);
35332: value = gen_const_xmlChar_ptr(n_value, 2);
35333: val = gen_xmlSchemaValPtr(n_val, 3);
35334:
35335: ret_val = xmlSchemaValidateFacet(base, facet, (const xmlChar *)value, val);
35336: desret_int(ret_val);
35337: call_tests++;
35338: des_xmlSchemaTypePtr(n_base, base, 0);
35339: des_xmlSchemaFacetPtr(n_facet, facet, 1);
35340: des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
35341: des_xmlSchemaValPtr(n_val, val, 3);
35342: xmlResetLastError();
35343: if (mem_base != xmlMemBlocks()) {
35344: printf("Leak of %d blocks found in xmlSchemaValidateFacet",
35345: xmlMemBlocks() - mem_base);
35346: test_ret++;
35347: printf(" %d", n_base);
35348: printf(" %d", n_facet);
35349: printf(" %d", n_value);
35350: printf(" %d", n_val);
35351: printf("\n");
35352: }
35353: }
35354: }
35355: }
35356: }
35357: function_tests++;
35358: #endif
35359:
35360: return(test_ret);
35361: }
35362:
35363:
35364: static int
35365: test_xmlSchemaValidateFacetWhtsp(void) {
35366: int test_ret = 0;
35367:
35368: #if defined(LIBXML_SCHEMAS_ENABLED)
35369: int mem_base;
35370: int ret_val;
35371: xmlSchemaFacetPtr facet; /* the facet to check */
35372: int n_facet;
35373: xmlSchemaWhitespaceValueType fws; /* the whitespace type of the facet's value */
35374: int n_fws;
35375: xmlSchemaValType valType; /* the built-in type of the value */
35376: int n_valType;
35377: xmlChar * value; /* the lexical (or normalized for pattern) repr of the value to validate */
35378: int n_value;
35379: xmlSchemaValPtr val; /* the precomputed value */
35380: int n_val;
35381: xmlSchemaWhitespaceValueType ws; /* the whitespace type of the value */
35382: int n_ws;
35383:
35384: for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
35385: for (n_fws = 0;n_fws < gen_nb_xmlSchemaWhitespaceValueType;n_fws++) {
35386: for (n_valType = 0;n_valType < gen_nb_xmlSchemaValType;n_valType++) {
35387: for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35388: for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35389: for (n_ws = 0;n_ws < gen_nb_xmlSchemaWhitespaceValueType;n_ws++) {
35390: mem_base = xmlMemBlocks();
35391: facet = gen_xmlSchemaFacetPtr(n_facet, 0);
35392: fws = gen_xmlSchemaWhitespaceValueType(n_fws, 1);
35393: valType = gen_xmlSchemaValType(n_valType, 2);
35394: value = gen_const_xmlChar_ptr(n_value, 3);
35395: val = gen_xmlSchemaValPtr(n_val, 4);
35396: ws = gen_xmlSchemaWhitespaceValueType(n_ws, 5);
35397:
35398: ret_val = xmlSchemaValidateFacetWhtsp(facet, fws, valType, (const xmlChar *)value, val, ws);
35399: desret_int(ret_val);
35400: call_tests++;
35401: des_xmlSchemaFacetPtr(n_facet, facet, 0);
35402: des_xmlSchemaWhitespaceValueType(n_fws, fws, 1);
35403: des_xmlSchemaValType(n_valType, valType, 2);
35404: des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
35405: des_xmlSchemaValPtr(n_val, val, 4);
35406: des_xmlSchemaWhitespaceValueType(n_ws, ws, 5);
35407: xmlResetLastError();
35408: if (mem_base != xmlMemBlocks()) {
35409: printf("Leak of %d blocks found in xmlSchemaValidateFacetWhtsp",
35410: xmlMemBlocks() - mem_base);
35411: test_ret++;
35412: printf(" %d", n_facet);
35413: printf(" %d", n_fws);
35414: printf(" %d", n_valType);
35415: printf(" %d", n_value);
35416: printf(" %d", n_val);
35417: printf(" %d", n_ws);
35418: printf("\n");
35419: }
35420: }
35421: }
35422: }
35423: }
35424: }
35425: }
35426: function_tests++;
35427: #endif
35428:
35429: return(test_ret);
35430: }
35431:
35432:
35433: static int
35434: test_xmlSchemaValidateLengthFacet(void) {
35435: int test_ret = 0;
35436:
35437: #if defined(LIBXML_SCHEMAS_ENABLED)
35438: int mem_base;
35439: int ret_val;
35440: xmlSchemaTypePtr type; /* the built-in type */
35441: int n_type;
35442: xmlSchemaFacetPtr facet; /* the facet to check */
35443: int n_facet;
35444: xmlChar * value; /* the lexical repr. of the value to be validated */
35445: int n_value;
35446: xmlSchemaValPtr val; /* the precomputed value */
35447: int n_val;
35448: unsigned long * length; /* the actual length of the value */
35449: int n_length;
35450:
35451: for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
35452: for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
35453: for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35454: for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35455: for (n_length = 0;n_length < gen_nb_unsigned_long_ptr;n_length++) {
35456: mem_base = xmlMemBlocks();
35457: type = gen_xmlSchemaTypePtr(n_type, 0);
35458: facet = gen_xmlSchemaFacetPtr(n_facet, 1);
35459: value = gen_const_xmlChar_ptr(n_value, 2);
35460: val = gen_xmlSchemaValPtr(n_val, 3);
35461: length = gen_unsigned_long_ptr(n_length, 4);
35462:
35463: ret_val = xmlSchemaValidateLengthFacet(type, facet, (const xmlChar *)value, val, length);
35464: desret_int(ret_val);
35465: call_tests++;
35466: des_xmlSchemaTypePtr(n_type, type, 0);
35467: des_xmlSchemaFacetPtr(n_facet, facet, 1);
35468: des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
35469: des_xmlSchemaValPtr(n_val, val, 3);
35470: des_unsigned_long_ptr(n_length, length, 4);
35471: xmlResetLastError();
35472: if (mem_base != xmlMemBlocks()) {
35473: printf("Leak of %d blocks found in xmlSchemaValidateLengthFacet",
35474: xmlMemBlocks() - mem_base);
35475: test_ret++;
35476: printf(" %d", n_type);
35477: printf(" %d", n_facet);
35478: printf(" %d", n_value);
35479: printf(" %d", n_val);
35480: printf(" %d", n_length);
35481: printf("\n");
35482: }
35483: }
35484: }
35485: }
35486: }
35487: }
35488: function_tests++;
35489: #endif
35490:
35491: return(test_ret);
35492: }
35493:
35494:
35495: static int
35496: test_xmlSchemaValidateLengthFacetWhtsp(void) {
35497: int test_ret = 0;
35498:
35499: #if defined(LIBXML_SCHEMAS_ENABLED)
35500: int mem_base;
35501: int ret_val;
35502: xmlSchemaFacetPtr facet; /* the facet to check */
35503: int n_facet;
35504: xmlSchemaValType valType; /* the built-in type */
35505: int n_valType;
35506: xmlChar * value; /* the lexical repr. of the value to be validated */
35507: int n_value;
35508: xmlSchemaValPtr val; /* the precomputed value */
35509: int n_val;
35510: unsigned long * length; /* the actual length of the value */
35511: int n_length;
35512: xmlSchemaWhitespaceValueType ws; /* the whitespace type of the value */
35513: int n_ws;
35514:
35515: for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
35516: for (n_valType = 0;n_valType < gen_nb_xmlSchemaValType;n_valType++) {
35517: for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35518: for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35519: for (n_length = 0;n_length < gen_nb_unsigned_long_ptr;n_length++) {
35520: for (n_ws = 0;n_ws < gen_nb_xmlSchemaWhitespaceValueType;n_ws++) {
35521: mem_base = xmlMemBlocks();
35522: facet = gen_xmlSchemaFacetPtr(n_facet, 0);
35523: valType = gen_xmlSchemaValType(n_valType, 1);
35524: value = gen_const_xmlChar_ptr(n_value, 2);
35525: val = gen_xmlSchemaValPtr(n_val, 3);
35526: length = gen_unsigned_long_ptr(n_length, 4);
35527: ws = gen_xmlSchemaWhitespaceValueType(n_ws, 5);
35528:
35529: ret_val = xmlSchemaValidateLengthFacetWhtsp(facet, valType, (const xmlChar *)value, val, length, ws);
35530: desret_int(ret_val);
35531: call_tests++;
35532: des_xmlSchemaFacetPtr(n_facet, facet, 0);
35533: des_xmlSchemaValType(n_valType, valType, 1);
35534: des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
35535: des_xmlSchemaValPtr(n_val, val, 3);
35536: des_unsigned_long_ptr(n_length, length, 4);
35537: des_xmlSchemaWhitespaceValueType(n_ws, ws, 5);
35538: xmlResetLastError();
35539: if (mem_base != xmlMemBlocks()) {
35540: printf("Leak of %d blocks found in xmlSchemaValidateLengthFacetWhtsp",
35541: xmlMemBlocks() - mem_base);
35542: test_ret++;
35543: printf(" %d", n_facet);
35544: printf(" %d", n_valType);
35545: printf(" %d", n_value);
35546: printf(" %d", n_val);
35547: printf(" %d", n_length);
35548: printf(" %d", n_ws);
35549: printf("\n");
35550: }
35551: }
35552: }
35553: }
35554: }
35555: }
35556: }
35557: function_tests++;
35558: #endif
35559:
35560: return(test_ret);
35561: }
35562:
35563:
35564: static int
35565: test_xmlSchemaValidateListSimpleTypeFacet(void) {
35566: int test_ret = 0;
35567:
35568: #if defined(LIBXML_SCHEMAS_ENABLED)
35569: int mem_base;
35570: int ret_val;
35571: xmlSchemaFacetPtr facet; /* the facet to check */
35572: int n_facet;
35573: xmlChar * value; /* the lexical repr of the value to validate */
35574: int n_value;
35575: unsigned long actualLen; /* the number of list items */
35576: int n_actualLen;
35577: unsigned long * expectedLen; /* the resulting expected number of list items */
35578: int n_expectedLen;
35579:
35580: for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
35581: for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35582: for (n_actualLen = 0;n_actualLen < gen_nb_unsigned_long;n_actualLen++) {
35583: for (n_expectedLen = 0;n_expectedLen < gen_nb_unsigned_long_ptr;n_expectedLen++) {
35584: mem_base = xmlMemBlocks();
35585: facet = gen_xmlSchemaFacetPtr(n_facet, 0);
35586: value = gen_const_xmlChar_ptr(n_value, 1);
35587: actualLen = gen_unsigned_long(n_actualLen, 2);
35588: expectedLen = gen_unsigned_long_ptr(n_expectedLen, 3);
35589:
35590: ret_val = xmlSchemaValidateListSimpleTypeFacet(facet, (const xmlChar *)value, actualLen, expectedLen);
35591: desret_int(ret_val);
35592: call_tests++;
35593: des_xmlSchemaFacetPtr(n_facet, facet, 0);
35594: des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
35595: des_unsigned_long(n_actualLen, actualLen, 2);
35596: des_unsigned_long_ptr(n_expectedLen, expectedLen, 3);
35597: xmlResetLastError();
35598: if (mem_base != xmlMemBlocks()) {
35599: printf("Leak of %d blocks found in xmlSchemaValidateListSimpleTypeFacet",
35600: xmlMemBlocks() - mem_base);
35601: test_ret++;
35602: printf(" %d", n_facet);
35603: printf(" %d", n_value);
35604: printf(" %d", n_actualLen);
35605: printf(" %d", n_expectedLen);
35606: printf("\n");
35607: }
35608: }
35609: }
35610: }
35611: }
35612: function_tests++;
35613: #endif
35614:
35615: return(test_ret);
35616: }
35617:
35618:
35619: static int
35620: test_xmlSchemaValidatePredefinedType(void) {
35621: int test_ret = 0;
35622:
35623: #if defined(LIBXML_SCHEMAS_ENABLED)
35624: int mem_base;
35625: int ret_val;
35626: xmlSchemaTypePtr type; /* the predefined type */
35627: int n_type;
35628: xmlChar * value; /* the value to check */
35629: int n_value;
35630: xmlSchemaValPtr * val; /* the return computed value */
35631: int n_val;
35632:
35633: for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
35634: for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35635: for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr_ptr;n_val++) {
35636: mem_base = xmlMemBlocks();
35637: type = gen_xmlSchemaTypePtr(n_type, 0);
35638: value = gen_const_xmlChar_ptr(n_value, 1);
35639: val = gen_xmlSchemaValPtr_ptr(n_val, 2);
35640:
35641: ret_val = xmlSchemaValidatePredefinedType(type, (const xmlChar *)value, val);
35642: desret_int(ret_val);
35643: call_tests++;
35644: des_xmlSchemaTypePtr(n_type, type, 0);
35645: des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
35646: des_xmlSchemaValPtr_ptr(n_val, val, 2);
35647: xmlResetLastError();
35648: if (mem_base != xmlMemBlocks()) {
35649: printf("Leak of %d blocks found in xmlSchemaValidatePredefinedType",
35650: xmlMemBlocks() - mem_base);
35651: test_ret++;
35652: printf(" %d", n_type);
35653: printf(" %d", n_value);
35654: printf(" %d", n_val);
35655: printf("\n");
35656: }
35657: }
35658: }
35659: }
35660: function_tests++;
35661: #endif
35662:
35663: return(test_ret);
35664: }
35665:
35666:
35667: static int
35668: test_xmlSchemaValueAppend(void) {
35669: int test_ret = 0;
35670:
35671: #if defined(LIBXML_SCHEMAS_ENABLED)
35672: int mem_base;
35673: int ret_val;
35674: xmlSchemaValPtr prev; /* the value */
35675: int n_prev;
35676: xmlSchemaValPtr cur; /* the value to be appended */
35677: int n_cur;
35678:
35679: for (n_prev = 0;n_prev < gen_nb_xmlSchemaValPtr;n_prev++) {
35680: for (n_cur = 0;n_cur < gen_nb_xmlSchemaValPtr;n_cur++) {
35681: mem_base = xmlMemBlocks();
35682: prev = gen_xmlSchemaValPtr(n_prev, 0);
35683: cur = gen_xmlSchemaValPtr(n_cur, 1);
35684:
35685: ret_val = xmlSchemaValueAppend(prev, cur);
35686: desret_int(ret_val);
35687: call_tests++;
35688: des_xmlSchemaValPtr(n_prev, prev, 0);
35689: des_xmlSchemaValPtr(n_cur, cur, 1);
35690: xmlResetLastError();
35691: if (mem_base != xmlMemBlocks()) {
35692: printf("Leak of %d blocks found in xmlSchemaValueAppend",
35693: xmlMemBlocks() - mem_base);
35694: test_ret++;
35695: printf(" %d", n_prev);
35696: printf(" %d", n_cur);
35697: printf("\n");
35698: }
35699: }
35700: }
35701: function_tests++;
35702: #endif
35703:
35704: return(test_ret);
35705: }
35706:
35707:
35708: static int
35709: test_xmlSchemaValueGetAsBoolean(void) {
35710: int test_ret = 0;
35711:
35712: #if defined(LIBXML_SCHEMAS_ENABLED)
35713: int mem_base;
35714: int ret_val;
35715: xmlSchemaValPtr val; /* the value */
35716: int n_val;
35717:
35718: for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35719: mem_base = xmlMemBlocks();
35720: val = gen_xmlSchemaValPtr(n_val, 0);
35721:
35722: ret_val = xmlSchemaValueGetAsBoolean(val);
35723: desret_int(ret_val);
35724: call_tests++;
35725: des_xmlSchemaValPtr(n_val, val, 0);
35726: xmlResetLastError();
35727: if (mem_base != xmlMemBlocks()) {
35728: printf("Leak of %d blocks found in xmlSchemaValueGetAsBoolean",
35729: xmlMemBlocks() - mem_base);
35730: test_ret++;
35731: printf(" %d", n_val);
35732: printf("\n");
35733: }
35734: }
35735: function_tests++;
35736: #endif
35737:
35738: return(test_ret);
35739: }
35740:
35741:
35742: static int
35743: test_xmlSchemaValueGetAsString(void) {
35744: int test_ret = 0;
35745:
35746: #if defined(LIBXML_SCHEMAS_ENABLED)
35747: int mem_base;
35748: const xmlChar * ret_val;
35749: xmlSchemaValPtr val; /* the value */
35750: int n_val;
35751:
35752: for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35753: mem_base = xmlMemBlocks();
35754: val = gen_xmlSchemaValPtr(n_val, 0);
35755:
35756: ret_val = xmlSchemaValueGetAsString(val);
35757: desret_const_xmlChar_ptr(ret_val);
35758: call_tests++;
35759: des_xmlSchemaValPtr(n_val, val, 0);
35760: xmlResetLastError();
35761: if (mem_base != xmlMemBlocks()) {
35762: printf("Leak of %d blocks found in xmlSchemaValueGetAsString",
35763: xmlMemBlocks() - mem_base);
35764: test_ret++;
35765: printf(" %d", n_val);
35766: printf("\n");
35767: }
35768: }
35769: function_tests++;
35770: #endif
35771:
35772: return(test_ret);
35773: }
35774:
35775:
35776: static int
35777: test_xmlSchemaValueGetNext(void) {
35778: int test_ret = 0;
35779:
35780:
35781: /* missing type support */
35782: return(test_ret);
35783: }
35784:
35785:
35786: static int
35787: test_xmlSchemaWhiteSpaceReplace(void) {
35788: int test_ret = 0;
35789:
35790: #if defined(LIBXML_SCHEMAS_ENABLED)
35791: int mem_base;
35792: xmlChar * ret_val;
35793: xmlChar * value; /* a value */
35794: int n_value;
35795:
35796: for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35797: mem_base = xmlMemBlocks();
35798: value = gen_const_xmlChar_ptr(n_value, 0);
35799:
35800: ret_val = xmlSchemaWhiteSpaceReplace((const xmlChar *)value);
35801: desret_xmlChar_ptr(ret_val);
35802: call_tests++;
35803: des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
35804: xmlResetLastError();
35805: if (mem_base != xmlMemBlocks()) {
35806: printf("Leak of %d blocks found in xmlSchemaWhiteSpaceReplace",
35807: xmlMemBlocks() - mem_base);
35808: test_ret++;
35809: printf(" %d", n_value);
35810: printf("\n");
35811: }
35812: }
35813: function_tests++;
35814: #endif
35815:
35816: return(test_ret);
35817: }
35818:
35819: static int
35820: test_xmlschemastypes(void) {
35821: int test_ret = 0;
35822:
35823: if (quiet == 0) printf("Testing xmlschemastypes : 26 of 34 functions ...\n");
35824: test_ret += test_xmlSchemaCheckFacet();
35825: test_ret += test_xmlSchemaCleanupTypes();
35826: test_ret += test_xmlSchemaCollapseString();
35827: test_ret += test_xmlSchemaCompareValues();
35828: test_ret += test_xmlSchemaCompareValuesWhtsp();
35829: test_ret += test_xmlSchemaCopyValue();
35830: test_ret += test_xmlSchemaGetBuiltInListSimpleTypeItemType();
35831: test_ret += test_xmlSchemaGetBuiltInType();
35832: test_ret += test_xmlSchemaGetCanonValue();
35833: test_ret += test_xmlSchemaGetCanonValueWhtsp();
35834: test_ret += test_xmlSchemaGetFacetValueAsULong();
35835: test_ret += test_xmlSchemaGetPredefinedType();
35836: test_ret += test_xmlSchemaGetValType();
35837: test_ret += test_xmlSchemaInitTypes();
35838: test_ret += test_xmlSchemaIsBuiltInTypeFacet();
35839: test_ret += test_xmlSchemaNewFacet();
35840: test_ret += test_xmlSchemaNewNOTATIONValue();
35841: test_ret += test_xmlSchemaNewQNameValue();
35842: test_ret += test_xmlSchemaNewStringValue();
35843: test_ret += test_xmlSchemaValPredefTypeNode();
35844: test_ret += test_xmlSchemaValPredefTypeNodeNoNorm();
35845: test_ret += test_xmlSchemaValidateFacet();
35846: test_ret += test_xmlSchemaValidateFacetWhtsp();
35847: test_ret += test_xmlSchemaValidateLengthFacet();
35848: test_ret += test_xmlSchemaValidateLengthFacetWhtsp();
35849: test_ret += test_xmlSchemaValidateListSimpleTypeFacet();
35850: test_ret += test_xmlSchemaValidatePredefinedType();
35851: test_ret += test_xmlSchemaValueAppend();
35852: test_ret += test_xmlSchemaValueGetAsBoolean();
35853: test_ret += test_xmlSchemaValueGetAsString();
35854: test_ret += test_xmlSchemaValueGetNext();
35855: test_ret += test_xmlSchemaWhiteSpaceReplace();
35856:
35857: if (test_ret != 0)
35858: printf("Module xmlschemastypes: %d errors\n", test_ret);
35859: return(test_ret);
35860: }
35861:
35862: static int
35863: test_xmlCharStrdup(void) {
35864: int test_ret = 0;
35865:
35866: int mem_base;
35867: xmlChar * ret_val;
35868: char * cur; /* the input char * */
35869: int n_cur;
35870:
35871: for (n_cur = 0;n_cur < gen_nb_const_char_ptr;n_cur++) {
35872: mem_base = xmlMemBlocks();
35873: cur = gen_const_char_ptr(n_cur, 0);
35874:
35875: ret_val = xmlCharStrdup((const char *)cur);
35876: desret_xmlChar_ptr(ret_val);
35877: call_tests++;
35878: des_const_char_ptr(n_cur, (const char *)cur, 0);
35879: xmlResetLastError();
35880: if (mem_base != xmlMemBlocks()) {
35881: printf("Leak of %d blocks found in xmlCharStrdup",
35882: xmlMemBlocks() - mem_base);
35883: test_ret++;
35884: printf(" %d", n_cur);
35885: printf("\n");
35886: }
35887: }
35888: function_tests++;
35889:
35890: return(test_ret);
35891: }
35892:
35893:
35894: static int
35895: test_xmlCharStrndup(void) {
35896: int test_ret = 0;
35897:
35898: int mem_base;
35899: xmlChar * ret_val;
35900: char * cur; /* the input char * */
35901: int n_cur;
35902: int len; /* the len of @cur */
35903: int n_len;
35904:
35905: for (n_cur = 0;n_cur < gen_nb_const_char_ptr;n_cur++) {
35906: for (n_len = 0;n_len < gen_nb_int;n_len++) {
35907: mem_base = xmlMemBlocks();
35908: cur = gen_const_char_ptr(n_cur, 0);
35909: len = gen_int(n_len, 1);
35910:
35911: ret_val = xmlCharStrndup((const char *)cur, len);
35912: desret_xmlChar_ptr(ret_val);
35913: call_tests++;
35914: des_const_char_ptr(n_cur, (const char *)cur, 0);
35915: des_int(n_len, len, 1);
35916: xmlResetLastError();
35917: if (mem_base != xmlMemBlocks()) {
35918: printf("Leak of %d blocks found in xmlCharStrndup",
35919: xmlMemBlocks() - mem_base);
35920: test_ret++;
35921: printf(" %d", n_cur);
35922: printf(" %d", n_len);
35923: printf("\n");
35924: }
35925: }
35926: }
35927: function_tests++;
35928:
35929: return(test_ret);
35930: }
35931:
35932:
35933: static int
35934: test_xmlCheckUTF8(void) {
35935: int test_ret = 0;
35936:
35937: int mem_base;
35938: int ret_val;
35939: unsigned char * utf; /* Pointer to putative UTF-8 encoded string. */
35940: int n_utf;
35941:
35942: for (n_utf = 0;n_utf < gen_nb_const_unsigned_char_ptr;n_utf++) {
35943: mem_base = xmlMemBlocks();
35944: utf = gen_const_unsigned_char_ptr(n_utf, 0);
35945:
35946: ret_val = xmlCheckUTF8((const unsigned char *)utf);
35947: desret_int(ret_val);
35948: call_tests++;
35949: des_const_unsigned_char_ptr(n_utf, (const unsigned char *)utf, 0);
35950: xmlResetLastError();
35951: if (mem_base != xmlMemBlocks()) {
35952: printf("Leak of %d blocks found in xmlCheckUTF8",
35953: xmlMemBlocks() - mem_base);
35954: test_ret++;
35955: printf(" %d", n_utf);
35956: printf("\n");
35957: }
35958: }
35959: function_tests++;
35960:
35961: return(test_ret);
35962: }
35963:
35964:
35965: static int
35966: test_xmlGetUTF8Char(void) {
35967: int test_ret = 0;
35968:
35969: int mem_base;
35970: int ret_val;
35971: unsigned char * utf; /* a sequence of UTF-8 encoded bytes */
35972: int n_utf;
35973: int * len; /* a pointer to the minimum number of bytes present in the sequence. This is used to assure the next character is completely contained within the sequence. */
35974: int n_len;
35975:
35976: for (n_utf = 0;n_utf < gen_nb_const_unsigned_char_ptr;n_utf++) {
35977: for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
35978: mem_base = xmlMemBlocks();
35979: utf = gen_const_unsigned_char_ptr(n_utf, 0);
35980: len = gen_int_ptr(n_len, 1);
35981:
35982: ret_val = xmlGetUTF8Char((const unsigned char *)utf, len);
35983: desret_int(ret_val);
35984: call_tests++;
35985: des_const_unsigned_char_ptr(n_utf, (const unsigned char *)utf, 0);
35986: des_int_ptr(n_len, len, 1);
35987: xmlResetLastError();
35988: if (mem_base != xmlMemBlocks()) {
35989: printf("Leak of %d blocks found in xmlGetUTF8Char",
35990: xmlMemBlocks() - mem_base);
35991: test_ret++;
35992: printf(" %d", n_utf);
35993: printf(" %d", n_len);
35994: printf("\n");
35995: }
35996: }
35997: }
35998: function_tests++;
35999:
36000: return(test_ret);
36001: }
36002:
36003:
36004: static int
36005: test_xmlStrEqual(void) {
36006: int test_ret = 0;
36007:
36008: int mem_base;
36009: int ret_val;
36010: xmlChar * str1; /* the first xmlChar * */
36011: int n_str1;
36012: xmlChar * str2; /* the second xmlChar * */
36013: int n_str2;
36014:
36015: for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
36016: for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
36017: mem_base = xmlMemBlocks();
36018: str1 = gen_const_xmlChar_ptr(n_str1, 0);
36019: str2 = gen_const_xmlChar_ptr(n_str2, 1);
36020:
36021: ret_val = xmlStrEqual((const xmlChar *)str1, (const xmlChar *)str2);
36022: desret_int(ret_val);
36023: call_tests++;
36024: des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
36025: des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
36026: xmlResetLastError();
36027: if (mem_base != xmlMemBlocks()) {
36028: printf("Leak of %d blocks found in xmlStrEqual",
36029: xmlMemBlocks() - mem_base);
36030: test_ret++;
36031: printf(" %d", n_str1);
36032: printf(" %d", n_str2);
36033: printf("\n");
36034: }
36035: }
36036: }
36037: function_tests++;
36038:
36039: return(test_ret);
36040: }
36041:
36042:
36043: static int
36044: test_xmlStrPrintf(void) {
36045: int test_ret = 0;
36046:
36047:
36048: /* missing type support */
36049: return(test_ret);
36050: }
36051:
36052:
36053: static int
36054: test_xmlStrQEqual(void) {
36055: int test_ret = 0;
36056:
36057: int mem_base;
36058: int ret_val;
36059: xmlChar * pref; /* the prefix of the QName */
36060: int n_pref;
36061: xmlChar * name; /* the localname of the QName */
36062: int n_name;
36063: xmlChar * str; /* the second xmlChar * */
36064: int n_str;
36065:
36066: for (n_pref = 0;n_pref < gen_nb_const_xmlChar_ptr;n_pref++) {
36067: for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
36068: for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
36069: mem_base = xmlMemBlocks();
36070: pref = gen_const_xmlChar_ptr(n_pref, 0);
36071: name = gen_const_xmlChar_ptr(n_name, 1);
36072: str = gen_const_xmlChar_ptr(n_str, 2);
36073:
36074: ret_val = xmlStrQEqual((const xmlChar *)pref, (const xmlChar *)name, (const xmlChar *)str);
36075: desret_int(ret_val);
36076: call_tests++;
36077: des_const_xmlChar_ptr(n_pref, (const xmlChar *)pref, 0);
36078: des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
36079: des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 2);
36080: xmlResetLastError();
36081: if (mem_base != xmlMemBlocks()) {
36082: printf("Leak of %d blocks found in xmlStrQEqual",
36083: xmlMemBlocks() - mem_base);
36084: test_ret++;
36085: printf(" %d", n_pref);
36086: printf(" %d", n_name);
36087: printf(" %d", n_str);
36088: printf("\n");
36089: }
36090: }
36091: }
36092: }
36093: function_tests++;
36094:
36095: return(test_ret);
36096: }
36097:
36098:
36099: static int
36100: test_xmlStrVPrintf(void) {
36101: int test_ret = 0;
36102:
36103:
36104: /* missing type support */
36105: return(test_ret);
36106: }
36107:
36108:
36109: static int
36110: test_xmlStrcasecmp(void) {
36111: int test_ret = 0;
36112:
36113: int mem_base;
36114: int ret_val;
36115: xmlChar * str1; /* the first xmlChar * */
36116: int n_str1;
36117: xmlChar * str2; /* the second xmlChar * */
36118: int n_str2;
36119:
36120: for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
36121: for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
36122: mem_base = xmlMemBlocks();
36123: str1 = gen_const_xmlChar_ptr(n_str1, 0);
36124: str2 = gen_const_xmlChar_ptr(n_str2, 1);
36125:
36126: ret_val = xmlStrcasecmp((const xmlChar *)str1, (const xmlChar *)str2);
36127: desret_int(ret_val);
36128: call_tests++;
36129: des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
36130: des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
36131: xmlResetLastError();
36132: if (mem_base != xmlMemBlocks()) {
36133: printf("Leak of %d blocks found in xmlStrcasecmp",
36134: xmlMemBlocks() - mem_base);
36135: test_ret++;
36136: printf(" %d", n_str1);
36137: printf(" %d", n_str2);
36138: printf("\n");
36139: }
36140: }
36141: }
36142: function_tests++;
36143:
36144: return(test_ret);
36145: }
36146:
36147:
36148: static int
36149: test_xmlStrcasestr(void) {
36150: int test_ret = 0;
36151:
36152: int mem_base;
36153: const xmlChar * ret_val;
36154: xmlChar * str; /* the xmlChar * array (haystack) */
36155: int n_str;
36156: xmlChar * val; /* the xmlChar to search (needle) */
36157: int n_val;
36158:
36159: for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
36160: for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
36161: mem_base = xmlMemBlocks();
36162: str = gen_const_xmlChar_ptr(n_str, 0);
36163: val = gen_const_xmlChar_ptr(n_val, 1);
36164:
36165: ret_val = xmlStrcasestr((const xmlChar *)str, (const xmlChar *)val);
36166: desret_const_xmlChar_ptr(ret_val);
36167: call_tests++;
36168: des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
36169: des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 1);
36170: xmlResetLastError();
36171: if (mem_base != xmlMemBlocks()) {
36172: printf("Leak of %d blocks found in xmlStrcasestr",
36173: xmlMemBlocks() - mem_base);
36174: test_ret++;
36175: printf(" %d", n_str);
36176: printf(" %d", n_val);
36177: printf("\n");
36178: }
36179: }
36180: }
36181: function_tests++;
36182:
36183: return(test_ret);
36184: }
36185:
36186:
36187: static int
36188: test_xmlStrchr(void) {
36189: int test_ret = 0;
36190:
36191: int mem_base;
36192: const xmlChar * ret_val;
36193: xmlChar * str; /* the xmlChar * array */
36194: int n_str;
36195: xmlChar val; /* the xmlChar to search */
36196: int n_val;
36197:
36198: for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
36199: for (n_val = 0;n_val < gen_nb_xmlChar;n_val++) {
36200: mem_base = xmlMemBlocks();
36201: str = gen_const_xmlChar_ptr(n_str, 0);
36202: val = gen_xmlChar(n_val, 1);
36203:
36204: ret_val = xmlStrchr((const xmlChar *)str, val);
36205: desret_const_xmlChar_ptr(ret_val);
36206: call_tests++;
36207: des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
36208: des_xmlChar(n_val, val, 1);
36209: xmlResetLastError();
36210: if (mem_base != xmlMemBlocks()) {
36211: printf("Leak of %d blocks found in xmlStrchr",
36212: xmlMemBlocks() - mem_base);
36213: test_ret++;
36214: printf(" %d", n_str);
36215: printf(" %d", n_val);
36216: printf("\n");
36217: }
36218: }
36219: }
36220: function_tests++;
36221:
36222: return(test_ret);
36223: }
36224:
36225:
36226: static int
36227: test_xmlStrcmp(void) {
36228: int test_ret = 0;
36229:
36230: int mem_base;
36231: int ret_val;
36232: xmlChar * str1; /* the first xmlChar * */
36233: int n_str1;
36234: xmlChar * str2; /* the second xmlChar * */
36235: int n_str2;
36236:
36237: for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
36238: for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
36239: mem_base = xmlMemBlocks();
36240: str1 = gen_const_xmlChar_ptr(n_str1, 0);
36241: str2 = gen_const_xmlChar_ptr(n_str2, 1);
36242:
36243: ret_val = xmlStrcmp((const xmlChar *)str1, (const xmlChar *)str2);
36244: desret_int(ret_val);
36245: call_tests++;
36246: des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
36247: des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
36248: xmlResetLastError();
36249: if (mem_base != xmlMemBlocks()) {
36250: printf("Leak of %d blocks found in xmlStrcmp",
36251: xmlMemBlocks() - mem_base);
36252: test_ret++;
36253: printf(" %d", n_str1);
36254: printf(" %d", n_str2);
36255: printf("\n");
36256: }
36257: }
36258: }
36259: function_tests++;
36260:
36261: return(test_ret);
36262: }
36263:
36264:
36265: static int
36266: test_xmlStrdup(void) {
36267: int test_ret = 0;
36268:
36269: int mem_base;
36270: xmlChar * ret_val;
36271: xmlChar * cur; /* the input xmlChar * */
36272: int n_cur;
36273:
36274: for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
36275: mem_base = xmlMemBlocks();
36276: cur = gen_const_xmlChar_ptr(n_cur, 0);
36277:
36278: ret_val = xmlStrdup((const xmlChar *)cur);
36279: desret_xmlChar_ptr(ret_val);
36280: call_tests++;
36281: des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
36282: xmlResetLastError();
36283: if (mem_base != xmlMemBlocks()) {
36284: printf("Leak of %d blocks found in xmlStrdup",
36285: xmlMemBlocks() - mem_base);
36286: test_ret++;
36287: printf(" %d", n_cur);
36288: printf("\n");
36289: }
36290: }
36291: function_tests++;
36292:
36293: return(test_ret);
36294: }
36295:
36296:
36297: static int
36298: test_xmlStrlen(void) {
36299: int test_ret = 0;
36300:
36301: int mem_base;
36302: int ret_val;
36303: xmlChar * str; /* the xmlChar * array */
36304: int n_str;
36305:
36306: for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
36307: mem_base = xmlMemBlocks();
36308: str = gen_const_xmlChar_ptr(n_str, 0);
36309:
36310: ret_val = xmlStrlen((const xmlChar *)str);
36311: desret_int(ret_val);
36312: call_tests++;
36313: des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
36314: xmlResetLastError();
36315: if (mem_base != xmlMemBlocks()) {
36316: printf("Leak of %d blocks found in xmlStrlen",
36317: xmlMemBlocks() - mem_base);
36318: test_ret++;
36319: printf(" %d", n_str);
36320: printf("\n");
36321: }
36322: }
36323: function_tests++;
36324:
36325: return(test_ret);
36326: }
36327:
36328:
36329: static int
36330: test_xmlStrncasecmp(void) {
36331: int test_ret = 0;
36332:
36333: int mem_base;
36334: int ret_val;
36335: xmlChar * str1; /* the first xmlChar * */
36336: int n_str1;
36337: xmlChar * str2; /* the second xmlChar * */
36338: int n_str2;
36339: int len; /* the max comparison length */
36340: int n_len;
36341:
36342: for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
36343: for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
36344: for (n_len = 0;n_len < gen_nb_int;n_len++) {
36345: mem_base = xmlMemBlocks();
36346: str1 = gen_const_xmlChar_ptr(n_str1, 0);
36347: str2 = gen_const_xmlChar_ptr(n_str2, 1);
36348: len = gen_int(n_len, 2);
36349:
36350: ret_val = xmlStrncasecmp((const xmlChar *)str1, (const xmlChar *)str2, len);
36351: desret_int(ret_val);
36352: call_tests++;
36353: des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
36354: des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
36355: des_int(n_len, len, 2);
36356: xmlResetLastError();
36357: if (mem_base != xmlMemBlocks()) {
36358: printf("Leak of %d blocks found in xmlStrncasecmp",
36359: xmlMemBlocks() - mem_base);
36360: test_ret++;
36361: printf(" %d", n_str1);
36362: printf(" %d", n_str2);
36363: printf(" %d", n_len);
36364: printf("\n");
36365: }
36366: }
36367: }
36368: }
36369: function_tests++;
36370:
36371: return(test_ret);
36372: }
36373:
36374:
36375: static int
36376: test_xmlStrncatNew(void) {
36377: int test_ret = 0;
36378:
36379: int mem_base;
36380: xmlChar * ret_val;
36381: xmlChar * str1; /* first xmlChar string */
36382: int n_str1;
36383: xmlChar * str2; /* second xmlChar string */
36384: int n_str2;
36385: int len; /* the len of @str2 or < 0 */
36386: int n_len;
36387:
36388: for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
36389: for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
36390: for (n_len = 0;n_len < gen_nb_int;n_len++) {
36391: mem_base = xmlMemBlocks();
36392: str1 = gen_const_xmlChar_ptr(n_str1, 0);
36393: str2 = gen_const_xmlChar_ptr(n_str2, 1);
36394: len = gen_int(n_len, 2);
36395:
36396: ret_val = xmlStrncatNew((const xmlChar *)str1, (const xmlChar *)str2, len);
36397: desret_xmlChar_ptr(ret_val);
36398: call_tests++;
36399: des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
36400: des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
36401: des_int(n_len, len, 2);
36402: xmlResetLastError();
36403: if (mem_base != xmlMemBlocks()) {
36404: printf("Leak of %d blocks found in xmlStrncatNew",
36405: xmlMemBlocks() - mem_base);
36406: test_ret++;
36407: printf(" %d", n_str1);
36408: printf(" %d", n_str2);
36409: printf(" %d", n_len);
36410: printf("\n");
36411: }
36412: }
36413: }
36414: }
36415: function_tests++;
36416:
36417: return(test_ret);
36418: }
36419:
36420:
36421: static int
36422: test_xmlStrncmp(void) {
36423: int test_ret = 0;
36424:
36425: int mem_base;
36426: int ret_val;
36427: xmlChar * str1; /* the first xmlChar * */
36428: int n_str1;
36429: xmlChar * str2; /* the second xmlChar * */
36430: int n_str2;
36431: int len; /* the max comparison length */
36432: int n_len;
36433:
36434: for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
36435: for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
36436: for (n_len = 0;n_len < gen_nb_int;n_len++) {
36437: mem_base = xmlMemBlocks();
36438: str1 = gen_const_xmlChar_ptr(n_str1, 0);
36439: str2 = gen_const_xmlChar_ptr(n_str2, 1);
36440: len = gen_int(n_len, 2);
36441:
36442: ret_val = xmlStrncmp((const xmlChar *)str1, (const xmlChar *)str2, len);
36443: desret_int(ret_val);
36444: call_tests++;
36445: des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
36446: des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
36447: des_int(n_len, len, 2);
36448: xmlResetLastError();
36449: if (mem_base != xmlMemBlocks()) {
36450: printf("Leak of %d blocks found in xmlStrncmp",
36451: xmlMemBlocks() - mem_base);
36452: test_ret++;
36453: printf(" %d", n_str1);
36454: printf(" %d", n_str2);
36455: printf(" %d", n_len);
36456: printf("\n");
36457: }
36458: }
36459: }
36460: }
36461: function_tests++;
36462:
36463: return(test_ret);
36464: }
36465:
36466:
36467: static int
36468: test_xmlStrndup(void) {
36469: int test_ret = 0;
36470:
36471: int mem_base;
36472: xmlChar * ret_val;
36473: xmlChar * cur; /* the input xmlChar * */
36474: int n_cur;
36475: int len; /* the len of @cur */
36476: int n_len;
36477:
36478: for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
36479: for (n_len = 0;n_len < gen_nb_int;n_len++) {
36480: mem_base = xmlMemBlocks();
36481: cur = gen_const_xmlChar_ptr(n_cur, 0);
36482: len = gen_int(n_len, 1);
36483:
36484: ret_val = xmlStrndup((const xmlChar *)cur, len);
36485: desret_xmlChar_ptr(ret_val);
36486: call_tests++;
36487: des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
36488: des_int(n_len, len, 1);
36489: xmlResetLastError();
36490: if (mem_base != xmlMemBlocks()) {
36491: printf("Leak of %d blocks found in xmlStrndup",
36492: xmlMemBlocks() - mem_base);
36493: test_ret++;
36494: printf(" %d", n_cur);
36495: printf(" %d", n_len);
36496: printf("\n");
36497: }
36498: }
36499: }
36500: function_tests++;
36501:
36502: return(test_ret);
36503: }
36504:
36505:
36506: static int
36507: test_xmlStrstr(void) {
36508: int test_ret = 0;
36509:
36510: int mem_base;
36511: const xmlChar * ret_val;
36512: xmlChar * str; /* the xmlChar * array (haystack) */
36513: int n_str;
36514: xmlChar * val; /* the xmlChar to search (needle) */
36515: int n_val;
36516:
36517: for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
36518: for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
36519: mem_base = xmlMemBlocks();
36520: str = gen_const_xmlChar_ptr(n_str, 0);
36521: val = gen_const_xmlChar_ptr(n_val, 1);
36522:
36523: ret_val = xmlStrstr((const xmlChar *)str, (const xmlChar *)val);
36524: desret_const_xmlChar_ptr(ret_val);
36525: call_tests++;
36526: des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
36527: des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 1);
36528: xmlResetLastError();
36529: if (mem_base != xmlMemBlocks()) {
36530: printf("Leak of %d blocks found in xmlStrstr",
36531: xmlMemBlocks() - mem_base);
36532: test_ret++;
36533: printf(" %d", n_str);
36534: printf(" %d", n_val);
36535: printf("\n");
36536: }
36537: }
36538: }
36539: function_tests++;
36540:
36541: return(test_ret);
36542: }
36543:
36544:
36545: static int
36546: test_xmlStrsub(void) {
36547: int test_ret = 0;
36548:
36549: int mem_base;
36550: xmlChar * ret_val;
36551: xmlChar * str; /* the xmlChar * array (haystack) */
36552: int n_str;
36553: int start; /* the index of the first char (zero based) */
36554: int n_start;
36555: int len; /* the length of the substring */
36556: int n_len;
36557:
36558: for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
36559: for (n_start = 0;n_start < gen_nb_int;n_start++) {
36560: for (n_len = 0;n_len < gen_nb_int;n_len++) {
36561: mem_base = xmlMemBlocks();
36562: str = gen_const_xmlChar_ptr(n_str, 0);
36563: start = gen_int(n_start, 1);
36564: len = gen_int(n_len, 2);
36565:
36566: ret_val = xmlStrsub((const xmlChar *)str, start, len);
36567: desret_xmlChar_ptr(ret_val);
36568: call_tests++;
36569: des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
36570: des_int(n_start, start, 1);
36571: des_int(n_len, len, 2);
36572: xmlResetLastError();
36573: if (mem_base != xmlMemBlocks()) {
36574: printf("Leak of %d blocks found in xmlStrsub",
36575: xmlMemBlocks() - mem_base);
36576: test_ret++;
36577: printf(" %d", n_str);
36578: printf(" %d", n_start);
36579: printf(" %d", n_len);
36580: printf("\n");
36581: }
36582: }
36583: }
36584: }
36585: function_tests++;
36586:
36587: return(test_ret);
36588: }
36589:
36590:
36591: static int
36592: test_xmlUTF8Charcmp(void) {
36593: int test_ret = 0;
36594:
36595: int mem_base;
36596: int ret_val;
36597: xmlChar * utf1; /* pointer to first UTF8 char */
36598: int n_utf1;
36599: xmlChar * utf2; /* pointer to second UTF8 char */
36600: int n_utf2;
36601:
36602: for (n_utf1 = 0;n_utf1 < gen_nb_const_xmlChar_ptr;n_utf1++) {
36603: for (n_utf2 = 0;n_utf2 < gen_nb_const_xmlChar_ptr;n_utf2++) {
36604: mem_base = xmlMemBlocks();
36605: utf1 = gen_const_xmlChar_ptr(n_utf1, 0);
36606: utf2 = gen_const_xmlChar_ptr(n_utf2, 1);
36607:
36608: ret_val = xmlUTF8Charcmp((const xmlChar *)utf1, (const xmlChar *)utf2);
36609: desret_int(ret_val);
36610: call_tests++;
36611: des_const_xmlChar_ptr(n_utf1, (const xmlChar *)utf1, 0);
36612: des_const_xmlChar_ptr(n_utf2, (const xmlChar *)utf2, 1);
36613: xmlResetLastError();
36614: if (mem_base != xmlMemBlocks()) {
36615: printf("Leak of %d blocks found in xmlUTF8Charcmp",
36616: xmlMemBlocks() - mem_base);
36617: test_ret++;
36618: printf(" %d", n_utf1);
36619: printf(" %d", n_utf2);
36620: printf("\n");
36621: }
36622: }
36623: }
36624: function_tests++;
36625:
36626: return(test_ret);
36627: }
36628:
36629:
36630: static int
36631: test_xmlUTF8Size(void) {
36632: int test_ret = 0;
36633:
36634: int mem_base;
36635: int ret_val;
36636: xmlChar * utf; /* pointer to the UTF8 character */
36637: int n_utf;
36638:
36639: for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
36640: mem_base = xmlMemBlocks();
36641: utf = gen_const_xmlChar_ptr(n_utf, 0);
36642:
36643: ret_val = xmlUTF8Size((const xmlChar *)utf);
36644: desret_int(ret_val);
36645: call_tests++;
36646: des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
36647: xmlResetLastError();
36648: if (mem_base != xmlMemBlocks()) {
36649: printf("Leak of %d blocks found in xmlUTF8Size",
36650: xmlMemBlocks() - mem_base);
36651: test_ret++;
36652: printf(" %d", n_utf);
36653: printf("\n");
36654: }
36655: }
36656: function_tests++;
36657:
36658: return(test_ret);
36659: }
36660:
36661:
36662: static int
36663: test_xmlUTF8Strlen(void) {
36664: int test_ret = 0;
36665:
36666: int mem_base;
36667: int ret_val;
36668: xmlChar * utf; /* a sequence of UTF-8 encoded bytes */
36669: int n_utf;
36670:
36671: for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
36672: mem_base = xmlMemBlocks();
36673: utf = gen_const_xmlChar_ptr(n_utf, 0);
36674:
36675: ret_val = xmlUTF8Strlen((const xmlChar *)utf);
36676: desret_int(ret_val);
36677: call_tests++;
36678: des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
36679: xmlResetLastError();
36680: if (mem_base != xmlMemBlocks()) {
36681: printf("Leak of %d blocks found in xmlUTF8Strlen",
36682: xmlMemBlocks() - mem_base);
36683: test_ret++;
36684: printf(" %d", n_utf);
36685: printf("\n");
36686: }
36687: }
36688: function_tests++;
36689:
36690: return(test_ret);
36691: }
36692:
36693:
36694: static int
36695: test_xmlUTF8Strloc(void) {
36696: int test_ret = 0;
36697:
36698: int mem_base;
36699: int ret_val;
36700: xmlChar * utf; /* the input UTF8 * */
36701: int n_utf;
36702: xmlChar * utfchar; /* the UTF8 character to be found */
36703: int n_utfchar;
36704:
36705: for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
36706: for (n_utfchar = 0;n_utfchar < gen_nb_const_xmlChar_ptr;n_utfchar++) {
36707: mem_base = xmlMemBlocks();
36708: utf = gen_const_xmlChar_ptr(n_utf, 0);
36709: utfchar = gen_const_xmlChar_ptr(n_utfchar, 1);
36710:
36711: ret_val = xmlUTF8Strloc((const xmlChar *)utf, (const xmlChar *)utfchar);
36712: desret_int(ret_val);
36713: call_tests++;
36714: des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
36715: des_const_xmlChar_ptr(n_utfchar, (const xmlChar *)utfchar, 1);
36716: xmlResetLastError();
36717: if (mem_base != xmlMemBlocks()) {
36718: printf("Leak of %d blocks found in xmlUTF8Strloc",
36719: xmlMemBlocks() - mem_base);
36720: test_ret++;
36721: printf(" %d", n_utf);
36722: printf(" %d", n_utfchar);
36723: printf("\n");
36724: }
36725: }
36726: }
36727: function_tests++;
36728:
36729: return(test_ret);
36730: }
36731:
36732:
36733: static int
36734: test_xmlUTF8Strndup(void) {
36735: int test_ret = 0;
36736:
36737: int mem_base;
36738: xmlChar * ret_val;
36739: xmlChar * utf; /* the input UTF8 * */
36740: int n_utf;
36741: int len; /* the len of @utf (in chars) */
36742: int n_len;
36743:
36744: for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
36745: for (n_len = 0;n_len < gen_nb_int;n_len++) {
36746: mem_base = xmlMemBlocks();
36747: utf = gen_const_xmlChar_ptr(n_utf, 0);
36748: len = gen_int(n_len, 1);
36749:
36750: ret_val = xmlUTF8Strndup((const xmlChar *)utf, len);
36751: desret_xmlChar_ptr(ret_val);
36752: call_tests++;
36753: des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
36754: des_int(n_len, len, 1);
36755: xmlResetLastError();
36756: if (mem_base != xmlMemBlocks()) {
36757: printf("Leak of %d blocks found in xmlUTF8Strndup",
36758: xmlMemBlocks() - mem_base);
36759: test_ret++;
36760: printf(" %d", n_utf);
36761: printf(" %d", n_len);
36762: printf("\n");
36763: }
36764: }
36765: }
36766: function_tests++;
36767:
36768: return(test_ret);
36769: }
36770:
36771:
36772: static int
36773: test_xmlUTF8Strpos(void) {
36774: int test_ret = 0;
36775:
36776: int mem_base;
36777: const xmlChar * ret_val;
36778: xmlChar * utf; /* the input UTF8 * */
36779: int n_utf;
36780: int pos; /* the position of the desired UTF8 char (in chars) */
36781: int n_pos;
36782:
36783: for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
36784: for (n_pos = 0;n_pos < gen_nb_int;n_pos++) {
36785: mem_base = xmlMemBlocks();
36786: utf = gen_const_xmlChar_ptr(n_utf, 0);
36787: pos = gen_int(n_pos, 1);
36788:
36789: ret_val = xmlUTF8Strpos((const xmlChar *)utf, pos);
36790: desret_const_xmlChar_ptr(ret_val);
36791: call_tests++;
36792: des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
36793: des_int(n_pos, pos, 1);
36794: xmlResetLastError();
36795: if (mem_base != xmlMemBlocks()) {
36796: printf("Leak of %d blocks found in xmlUTF8Strpos",
36797: xmlMemBlocks() - mem_base);
36798: test_ret++;
36799: printf(" %d", n_utf);
36800: printf(" %d", n_pos);
36801: printf("\n");
36802: }
36803: }
36804: }
36805: function_tests++;
36806:
36807: return(test_ret);
36808: }
36809:
36810:
36811: static int
36812: test_xmlUTF8Strsize(void) {
36813: int test_ret = 0;
36814:
36815: int mem_base;
36816: int ret_val;
36817: xmlChar * utf; /* a sequence of UTF-8 encoded bytes */
36818: int n_utf;
36819: int len; /* the number of characters in the array */
36820: int n_len;
36821:
36822: for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
36823: for (n_len = 0;n_len < gen_nb_int;n_len++) {
36824: mem_base = xmlMemBlocks();
36825: utf = gen_const_xmlChar_ptr(n_utf, 0);
36826: len = gen_int(n_len, 1);
36827:
36828: ret_val = xmlUTF8Strsize((const xmlChar *)utf, len);
36829: desret_int(ret_val);
36830: call_tests++;
36831: des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
36832: des_int(n_len, len, 1);
36833: xmlResetLastError();
36834: if (mem_base != xmlMemBlocks()) {
36835: printf("Leak of %d blocks found in xmlUTF8Strsize",
36836: xmlMemBlocks() - mem_base);
36837: test_ret++;
36838: printf(" %d", n_utf);
36839: printf(" %d", n_len);
36840: printf("\n");
36841: }
36842: }
36843: }
36844: function_tests++;
36845:
36846: return(test_ret);
36847: }
36848:
36849:
36850: static int
36851: test_xmlUTF8Strsub(void) {
36852: int test_ret = 0;
36853:
36854: int mem_base;
36855: xmlChar * ret_val;
36856: xmlChar * utf; /* a sequence of UTF-8 encoded bytes */
36857: int n_utf;
36858: int start; /* relative pos of first char */
36859: int n_start;
36860: int len; /* total number to copy */
36861: int n_len;
36862:
36863: for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
36864: for (n_start = 0;n_start < gen_nb_int;n_start++) {
36865: for (n_len = 0;n_len < gen_nb_int;n_len++) {
36866: mem_base = xmlMemBlocks();
36867: utf = gen_const_xmlChar_ptr(n_utf, 0);
36868: start = gen_int(n_start, 1);
36869: len = gen_int(n_len, 2);
36870:
36871: ret_val = xmlUTF8Strsub((const xmlChar *)utf, start, len);
36872: desret_xmlChar_ptr(ret_val);
36873: call_tests++;
36874: des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
36875: des_int(n_start, start, 1);
36876: des_int(n_len, len, 2);
36877: xmlResetLastError();
36878: if (mem_base != xmlMemBlocks()) {
36879: printf("Leak of %d blocks found in xmlUTF8Strsub",
36880: xmlMemBlocks() - mem_base);
36881: test_ret++;
36882: printf(" %d", n_utf);
36883: printf(" %d", n_start);
36884: printf(" %d", n_len);
36885: printf("\n");
36886: }
36887: }
36888: }
36889: }
36890: function_tests++;
36891:
36892: return(test_ret);
36893: }
36894:
36895: static int
36896: test_xmlstring(void) {
36897: int test_ret = 0;
36898:
36899: if (quiet == 0) printf("Testing xmlstring : 26 of 30 functions ...\n");
36900: test_ret += test_xmlCharStrdup();
36901: test_ret += test_xmlCharStrndup();
36902: test_ret += test_xmlCheckUTF8();
36903: test_ret += test_xmlGetUTF8Char();
36904: test_ret += test_xmlStrEqual();
36905: test_ret += test_xmlStrPrintf();
36906: test_ret += test_xmlStrQEqual();
36907: test_ret += test_xmlStrVPrintf();
36908: test_ret += test_xmlStrcasecmp();
36909: test_ret += test_xmlStrcasestr();
36910: test_ret += test_xmlStrchr();
36911: test_ret += test_xmlStrcmp();
36912: test_ret += test_xmlStrdup();
36913: test_ret += test_xmlStrlen();
36914: test_ret += test_xmlStrncasecmp();
36915: test_ret += test_xmlStrncatNew();
36916: test_ret += test_xmlStrncmp();
36917: test_ret += test_xmlStrndup();
36918: test_ret += test_xmlStrstr();
36919: test_ret += test_xmlStrsub();
36920: test_ret += test_xmlUTF8Charcmp();
36921: test_ret += test_xmlUTF8Size();
36922: test_ret += test_xmlUTF8Strlen();
36923: test_ret += test_xmlUTF8Strloc();
36924: test_ret += test_xmlUTF8Strndup();
36925: test_ret += test_xmlUTF8Strpos();
36926: test_ret += test_xmlUTF8Strsize();
36927: test_ret += test_xmlUTF8Strsub();
36928:
36929: if (test_ret != 0)
36930: printf("Module xmlstring: %d errors\n", test_ret);
36931: return(test_ret);
36932: }
36933:
36934: static int
36935: test_xmlUCSIsAegeanNumbers(void) {
36936: int test_ret = 0;
36937:
36938: #if defined(LIBXML_UNICODE_ENABLED)
36939: int mem_base;
36940: int ret_val;
36941: int code; /* UCS code point */
36942: int n_code;
36943:
36944: for (n_code = 0;n_code < gen_nb_int;n_code++) {
36945: mem_base = xmlMemBlocks();
36946: code = gen_int(n_code, 0);
36947:
36948: ret_val = xmlUCSIsAegeanNumbers(code);
36949: desret_int(ret_val);
36950: call_tests++;
36951: des_int(n_code, code, 0);
36952: xmlResetLastError();
36953: if (mem_base != xmlMemBlocks()) {
36954: printf("Leak of %d blocks found in xmlUCSIsAegeanNumbers",
36955: xmlMemBlocks() - mem_base);
36956: test_ret++;
36957: printf(" %d", n_code);
36958: printf("\n");
36959: }
36960: }
36961: function_tests++;
36962: #endif
36963:
36964: return(test_ret);
36965: }
36966:
36967:
36968: static int
36969: test_xmlUCSIsAlphabeticPresentationForms(void) {
36970: int test_ret = 0;
36971:
36972: #if defined(LIBXML_UNICODE_ENABLED)
36973: int mem_base;
36974: int ret_val;
36975: int code; /* UCS code point */
36976: int n_code;
36977:
36978: for (n_code = 0;n_code < gen_nb_int;n_code++) {
36979: mem_base = xmlMemBlocks();
36980: code = gen_int(n_code, 0);
36981:
36982: ret_val = xmlUCSIsAlphabeticPresentationForms(code);
36983: desret_int(ret_val);
36984: call_tests++;
36985: des_int(n_code, code, 0);
36986: xmlResetLastError();
36987: if (mem_base != xmlMemBlocks()) {
36988: printf("Leak of %d blocks found in xmlUCSIsAlphabeticPresentationForms",
36989: xmlMemBlocks() - mem_base);
36990: test_ret++;
36991: printf(" %d", n_code);
36992: printf("\n");
36993: }
36994: }
36995: function_tests++;
36996: #endif
36997:
36998: return(test_ret);
36999: }
37000:
37001:
37002: static int
37003: test_xmlUCSIsArabic(void) {
37004: int test_ret = 0;
37005:
37006: #if defined(LIBXML_UNICODE_ENABLED)
37007: int mem_base;
37008: int ret_val;
37009: int code; /* UCS code point */
37010: int n_code;
37011:
37012: for (n_code = 0;n_code < gen_nb_int;n_code++) {
37013: mem_base = xmlMemBlocks();
37014: code = gen_int(n_code, 0);
37015:
37016: ret_val = xmlUCSIsArabic(code);
37017: desret_int(ret_val);
37018: call_tests++;
37019: des_int(n_code, code, 0);
37020: xmlResetLastError();
37021: if (mem_base != xmlMemBlocks()) {
37022: printf("Leak of %d blocks found in xmlUCSIsArabic",
37023: xmlMemBlocks() - mem_base);
37024: test_ret++;
37025: printf(" %d", n_code);
37026: printf("\n");
37027: }
37028: }
37029: function_tests++;
37030: #endif
37031:
37032: return(test_ret);
37033: }
37034:
37035:
37036: static int
37037: test_xmlUCSIsArabicPresentationFormsA(void) {
37038: int test_ret = 0;
37039:
37040: #if defined(LIBXML_UNICODE_ENABLED)
37041: int mem_base;
37042: int ret_val;
37043: int code; /* UCS code point */
37044: int n_code;
37045:
37046: for (n_code = 0;n_code < gen_nb_int;n_code++) {
37047: mem_base = xmlMemBlocks();
37048: code = gen_int(n_code, 0);
37049:
37050: ret_val = xmlUCSIsArabicPresentationFormsA(code);
37051: desret_int(ret_val);
37052: call_tests++;
37053: des_int(n_code, code, 0);
37054: xmlResetLastError();
37055: if (mem_base != xmlMemBlocks()) {
37056: printf("Leak of %d blocks found in xmlUCSIsArabicPresentationFormsA",
37057: xmlMemBlocks() - mem_base);
37058: test_ret++;
37059: printf(" %d", n_code);
37060: printf("\n");
37061: }
37062: }
37063: function_tests++;
37064: #endif
37065:
37066: return(test_ret);
37067: }
37068:
37069:
37070: static int
37071: test_xmlUCSIsArabicPresentationFormsB(void) {
37072: int test_ret = 0;
37073:
37074: #if defined(LIBXML_UNICODE_ENABLED)
37075: int mem_base;
37076: int ret_val;
37077: int code; /* UCS code point */
37078: int n_code;
37079:
37080: for (n_code = 0;n_code < gen_nb_int;n_code++) {
37081: mem_base = xmlMemBlocks();
37082: code = gen_int(n_code, 0);
37083:
37084: ret_val = xmlUCSIsArabicPresentationFormsB(code);
37085: desret_int(ret_val);
37086: call_tests++;
37087: des_int(n_code, code, 0);
37088: xmlResetLastError();
37089: if (mem_base != xmlMemBlocks()) {
37090: printf("Leak of %d blocks found in xmlUCSIsArabicPresentationFormsB",
37091: xmlMemBlocks() - mem_base);
37092: test_ret++;
37093: printf(" %d", n_code);
37094: printf("\n");
37095: }
37096: }
37097: function_tests++;
37098: #endif
37099:
37100: return(test_ret);
37101: }
37102:
37103:
37104: static int
37105: test_xmlUCSIsArmenian(void) {
37106: int test_ret = 0;
37107:
37108: #if defined(LIBXML_UNICODE_ENABLED)
37109: int mem_base;
37110: int ret_val;
37111: int code; /* UCS code point */
37112: int n_code;
37113:
37114: for (n_code = 0;n_code < gen_nb_int;n_code++) {
37115: mem_base = xmlMemBlocks();
37116: code = gen_int(n_code, 0);
37117:
37118: ret_val = xmlUCSIsArmenian(code);
37119: desret_int(ret_val);
37120: call_tests++;
37121: des_int(n_code, code, 0);
37122: xmlResetLastError();
37123: if (mem_base != xmlMemBlocks()) {
37124: printf("Leak of %d blocks found in xmlUCSIsArmenian",
37125: xmlMemBlocks() - mem_base);
37126: test_ret++;
37127: printf(" %d", n_code);
37128: printf("\n");
37129: }
37130: }
37131: function_tests++;
37132: #endif
37133:
37134: return(test_ret);
37135: }
37136:
37137:
37138: static int
37139: test_xmlUCSIsArrows(void) {
37140: int test_ret = 0;
37141:
37142: #if defined(LIBXML_UNICODE_ENABLED)
37143: int mem_base;
37144: int ret_val;
37145: int code; /* UCS code point */
37146: int n_code;
37147:
37148: for (n_code = 0;n_code < gen_nb_int;n_code++) {
37149: mem_base = xmlMemBlocks();
37150: code = gen_int(n_code, 0);
37151:
37152: ret_val = xmlUCSIsArrows(code);
37153: desret_int(ret_val);
37154: call_tests++;
37155: des_int(n_code, code, 0);
37156: xmlResetLastError();
37157: if (mem_base != xmlMemBlocks()) {
37158: printf("Leak of %d blocks found in xmlUCSIsArrows",
37159: xmlMemBlocks() - mem_base);
37160: test_ret++;
37161: printf(" %d", n_code);
37162: printf("\n");
37163: }
37164: }
37165: function_tests++;
37166: #endif
37167:
37168: return(test_ret);
37169: }
37170:
37171:
37172: static int
37173: test_xmlUCSIsBasicLatin(void) {
37174: int test_ret = 0;
37175:
37176: #if defined(LIBXML_UNICODE_ENABLED)
37177: int mem_base;
37178: int ret_val;
37179: int code; /* UCS code point */
37180: int n_code;
37181:
37182: for (n_code = 0;n_code < gen_nb_int;n_code++) {
37183: mem_base = xmlMemBlocks();
37184: code = gen_int(n_code, 0);
37185:
37186: ret_val = xmlUCSIsBasicLatin(code);
37187: desret_int(ret_val);
37188: call_tests++;
37189: des_int(n_code, code, 0);
37190: xmlResetLastError();
37191: if (mem_base != xmlMemBlocks()) {
37192: printf("Leak of %d blocks found in xmlUCSIsBasicLatin",
37193: xmlMemBlocks() - mem_base);
37194: test_ret++;
37195: printf(" %d", n_code);
37196: printf("\n");
37197: }
37198: }
37199: function_tests++;
37200: #endif
37201:
37202: return(test_ret);
37203: }
37204:
37205:
37206: static int
37207: test_xmlUCSIsBengali(void) {
37208: int test_ret = 0;
37209:
37210: #if defined(LIBXML_UNICODE_ENABLED)
37211: int mem_base;
37212: int ret_val;
37213: int code; /* UCS code point */
37214: int n_code;
37215:
37216: for (n_code = 0;n_code < gen_nb_int;n_code++) {
37217: mem_base = xmlMemBlocks();
37218: code = gen_int(n_code, 0);
37219:
37220: ret_val = xmlUCSIsBengali(code);
37221: desret_int(ret_val);
37222: call_tests++;
37223: des_int(n_code, code, 0);
37224: xmlResetLastError();
37225: if (mem_base != xmlMemBlocks()) {
37226: printf("Leak of %d blocks found in xmlUCSIsBengali",
37227: xmlMemBlocks() - mem_base);
37228: test_ret++;
37229: printf(" %d", n_code);
37230: printf("\n");
37231: }
37232: }
37233: function_tests++;
37234: #endif
37235:
37236: return(test_ret);
37237: }
37238:
37239:
37240: static int
37241: test_xmlUCSIsBlock(void) {
37242: int test_ret = 0;
37243:
37244: #if defined(LIBXML_UNICODE_ENABLED)
37245: int mem_base;
37246: int ret_val;
37247: int code; /* UCS code point */
37248: int n_code;
37249: char * block; /* UCS block name */
37250: int n_block;
37251:
37252: for (n_code = 0;n_code < gen_nb_int;n_code++) {
37253: for (n_block = 0;n_block < gen_nb_const_char_ptr;n_block++) {
37254: mem_base = xmlMemBlocks();
37255: code = gen_int(n_code, 0);
37256: block = gen_const_char_ptr(n_block, 1);
37257:
37258: ret_val = xmlUCSIsBlock(code, (const char *)block);
37259: desret_int(ret_val);
37260: call_tests++;
37261: des_int(n_code, code, 0);
37262: des_const_char_ptr(n_block, (const char *)block, 1);
37263: xmlResetLastError();
37264: if (mem_base != xmlMemBlocks()) {
37265: printf("Leak of %d blocks found in xmlUCSIsBlock",
37266: xmlMemBlocks() - mem_base);
37267: test_ret++;
37268: printf(" %d", n_code);
37269: printf(" %d", n_block);
37270: printf("\n");
37271: }
37272: }
37273: }
37274: function_tests++;
37275: #endif
37276:
37277: return(test_ret);
37278: }
37279:
37280:
37281: static int
37282: test_xmlUCSIsBlockElements(void) {
37283: int test_ret = 0;
37284:
37285: #if defined(LIBXML_UNICODE_ENABLED)
37286: int mem_base;
37287: int ret_val;
37288: int code; /* UCS code point */
37289: int n_code;
37290:
37291: for (n_code = 0;n_code < gen_nb_int;n_code++) {
37292: mem_base = xmlMemBlocks();
37293: code = gen_int(n_code, 0);
37294:
37295: ret_val = xmlUCSIsBlockElements(code);
37296: desret_int(ret_val);
37297: call_tests++;
37298: des_int(n_code, code, 0);
37299: xmlResetLastError();
37300: if (mem_base != xmlMemBlocks()) {
37301: printf("Leak of %d blocks found in xmlUCSIsBlockElements",
37302: xmlMemBlocks() - mem_base);
37303: test_ret++;
37304: printf(" %d", n_code);
37305: printf("\n");
37306: }
37307: }
37308: function_tests++;
37309: #endif
37310:
37311: return(test_ret);
37312: }
37313:
37314:
37315: static int
37316: test_xmlUCSIsBopomofo(void) {
37317: int test_ret = 0;
37318:
37319: #if defined(LIBXML_UNICODE_ENABLED)
37320: int mem_base;
37321: int ret_val;
37322: int code; /* UCS code point */
37323: int n_code;
37324:
37325: for (n_code = 0;n_code < gen_nb_int;n_code++) {
37326: mem_base = xmlMemBlocks();
37327: code = gen_int(n_code, 0);
37328:
37329: ret_val = xmlUCSIsBopomofo(code);
37330: desret_int(ret_val);
37331: call_tests++;
37332: des_int(n_code, code, 0);
37333: xmlResetLastError();
37334: if (mem_base != xmlMemBlocks()) {
37335: printf("Leak of %d blocks found in xmlUCSIsBopomofo",
37336: xmlMemBlocks() - mem_base);
37337: test_ret++;
37338: printf(" %d", n_code);
37339: printf("\n");
37340: }
37341: }
37342: function_tests++;
37343: #endif
37344:
37345: return(test_ret);
37346: }
37347:
37348:
37349: static int
37350: test_xmlUCSIsBopomofoExtended(void) {
37351: int test_ret = 0;
37352:
37353: #if defined(LIBXML_UNICODE_ENABLED)
37354: int mem_base;
37355: int ret_val;
37356: int code; /* UCS code point */
37357: int n_code;
37358:
37359: for (n_code = 0;n_code < gen_nb_int;n_code++) {
37360: mem_base = xmlMemBlocks();
37361: code = gen_int(n_code, 0);
37362:
37363: ret_val = xmlUCSIsBopomofoExtended(code);
37364: desret_int(ret_val);
37365: call_tests++;
37366: des_int(n_code, code, 0);
37367: xmlResetLastError();
37368: if (mem_base != xmlMemBlocks()) {
37369: printf("Leak of %d blocks found in xmlUCSIsBopomofoExtended",
37370: xmlMemBlocks() - mem_base);
37371: test_ret++;
37372: printf(" %d", n_code);
37373: printf("\n");
37374: }
37375: }
37376: function_tests++;
37377: #endif
37378:
37379: return(test_ret);
37380: }
37381:
37382:
37383: static int
37384: test_xmlUCSIsBoxDrawing(void) {
37385: int test_ret = 0;
37386:
37387: #if defined(LIBXML_UNICODE_ENABLED)
37388: int mem_base;
37389: int ret_val;
37390: int code; /* UCS code point */
37391: int n_code;
37392:
37393: for (n_code = 0;n_code < gen_nb_int;n_code++) {
37394: mem_base = xmlMemBlocks();
37395: code = gen_int(n_code, 0);
37396:
37397: ret_val = xmlUCSIsBoxDrawing(code);
37398: desret_int(ret_val);
37399: call_tests++;
37400: des_int(n_code, code, 0);
37401: xmlResetLastError();
37402: if (mem_base != xmlMemBlocks()) {
37403: printf("Leak of %d blocks found in xmlUCSIsBoxDrawing",
37404: xmlMemBlocks() - mem_base);
37405: test_ret++;
37406: printf(" %d", n_code);
37407: printf("\n");
37408: }
37409: }
37410: function_tests++;
37411: #endif
37412:
37413: return(test_ret);
37414: }
37415:
37416:
37417: static int
37418: test_xmlUCSIsBraillePatterns(void) {
37419: int test_ret = 0;
37420:
37421: #if defined(LIBXML_UNICODE_ENABLED)
37422: int mem_base;
37423: int ret_val;
37424: int code; /* UCS code point */
37425: int n_code;
37426:
37427: for (n_code = 0;n_code < gen_nb_int;n_code++) {
37428: mem_base = xmlMemBlocks();
37429: code = gen_int(n_code, 0);
37430:
37431: ret_val = xmlUCSIsBraillePatterns(code);
37432: desret_int(ret_val);
37433: call_tests++;
37434: des_int(n_code, code, 0);
37435: xmlResetLastError();
37436: if (mem_base != xmlMemBlocks()) {
37437: printf("Leak of %d blocks found in xmlUCSIsBraillePatterns",
37438: xmlMemBlocks() - mem_base);
37439: test_ret++;
37440: printf(" %d", n_code);
37441: printf("\n");
37442: }
37443: }
37444: function_tests++;
37445: #endif
37446:
37447: return(test_ret);
37448: }
37449:
37450:
37451: static int
37452: test_xmlUCSIsBuhid(void) {
37453: int test_ret = 0;
37454:
37455: #if defined(LIBXML_UNICODE_ENABLED)
37456: int mem_base;
37457: int ret_val;
37458: int code; /* UCS code point */
37459: int n_code;
37460:
37461: for (n_code = 0;n_code < gen_nb_int;n_code++) {
37462: mem_base = xmlMemBlocks();
37463: code = gen_int(n_code, 0);
37464:
37465: ret_val = xmlUCSIsBuhid(code);
37466: desret_int(ret_val);
37467: call_tests++;
37468: des_int(n_code, code, 0);
37469: xmlResetLastError();
37470: if (mem_base != xmlMemBlocks()) {
37471: printf("Leak of %d blocks found in xmlUCSIsBuhid",
37472: xmlMemBlocks() - mem_base);
37473: test_ret++;
37474: printf(" %d", n_code);
37475: printf("\n");
37476: }
37477: }
37478: function_tests++;
37479: #endif
37480:
37481: return(test_ret);
37482: }
37483:
37484:
37485: static int
37486: test_xmlUCSIsByzantineMusicalSymbols(void) {
37487: int test_ret = 0;
37488:
37489: #if defined(LIBXML_UNICODE_ENABLED)
37490: int mem_base;
37491: int ret_val;
37492: int code; /* UCS code point */
37493: int n_code;
37494:
37495: for (n_code = 0;n_code < gen_nb_int;n_code++) {
37496: mem_base = xmlMemBlocks();
37497: code = gen_int(n_code, 0);
37498:
37499: ret_val = xmlUCSIsByzantineMusicalSymbols(code);
37500: desret_int(ret_val);
37501: call_tests++;
37502: des_int(n_code, code, 0);
37503: xmlResetLastError();
37504: if (mem_base != xmlMemBlocks()) {
37505: printf("Leak of %d blocks found in xmlUCSIsByzantineMusicalSymbols",
37506: xmlMemBlocks() - mem_base);
37507: test_ret++;
37508: printf(" %d", n_code);
37509: printf("\n");
37510: }
37511: }
37512: function_tests++;
37513: #endif
37514:
37515: return(test_ret);
37516: }
37517:
37518:
37519: static int
37520: test_xmlUCSIsCJKCompatibility(void) {
37521: int test_ret = 0;
37522:
37523: #if defined(LIBXML_UNICODE_ENABLED)
37524: int mem_base;
37525: int ret_val;
37526: int code; /* UCS code point */
37527: int n_code;
37528:
37529: for (n_code = 0;n_code < gen_nb_int;n_code++) {
37530: mem_base = xmlMemBlocks();
37531: code = gen_int(n_code, 0);
37532:
37533: ret_val = xmlUCSIsCJKCompatibility(code);
37534: desret_int(ret_val);
37535: call_tests++;
37536: des_int(n_code, code, 0);
37537: xmlResetLastError();
37538: if (mem_base != xmlMemBlocks()) {
37539: printf("Leak of %d blocks found in xmlUCSIsCJKCompatibility",
37540: xmlMemBlocks() - mem_base);
37541: test_ret++;
37542: printf(" %d", n_code);
37543: printf("\n");
37544: }
37545: }
37546: function_tests++;
37547: #endif
37548:
37549: return(test_ret);
37550: }
37551:
37552:
37553: static int
37554: test_xmlUCSIsCJKCompatibilityForms(void) {
37555: int test_ret = 0;
37556:
37557: #if defined(LIBXML_UNICODE_ENABLED)
37558: int mem_base;
37559: int ret_val;
37560: int code; /* UCS code point */
37561: int n_code;
37562:
37563: for (n_code = 0;n_code < gen_nb_int;n_code++) {
37564: mem_base = xmlMemBlocks();
37565: code = gen_int(n_code, 0);
37566:
37567: ret_val = xmlUCSIsCJKCompatibilityForms(code);
37568: desret_int(ret_val);
37569: call_tests++;
37570: des_int(n_code, code, 0);
37571: xmlResetLastError();
37572: if (mem_base != xmlMemBlocks()) {
37573: printf("Leak of %d blocks found in xmlUCSIsCJKCompatibilityForms",
37574: xmlMemBlocks() - mem_base);
37575: test_ret++;
37576: printf(" %d", n_code);
37577: printf("\n");
37578: }
37579: }
37580: function_tests++;
37581: #endif
37582:
37583: return(test_ret);
37584: }
37585:
37586:
37587: static int
37588: test_xmlUCSIsCJKCompatibilityIdeographs(void) {
37589: int test_ret = 0;
37590:
37591: #if defined(LIBXML_UNICODE_ENABLED)
37592: int mem_base;
37593: int ret_val;
37594: int code; /* UCS code point */
37595: int n_code;
37596:
37597: for (n_code = 0;n_code < gen_nb_int;n_code++) {
37598: mem_base = xmlMemBlocks();
37599: code = gen_int(n_code, 0);
37600:
37601: ret_val = xmlUCSIsCJKCompatibilityIdeographs(code);
37602: desret_int(ret_val);
37603: call_tests++;
37604: des_int(n_code, code, 0);
37605: xmlResetLastError();
37606: if (mem_base != xmlMemBlocks()) {
37607: printf("Leak of %d blocks found in xmlUCSIsCJKCompatibilityIdeographs",
37608: xmlMemBlocks() - mem_base);
37609: test_ret++;
37610: printf(" %d", n_code);
37611: printf("\n");
37612: }
37613: }
37614: function_tests++;
37615: #endif
37616:
37617: return(test_ret);
37618: }
37619:
37620:
37621: static int
37622: test_xmlUCSIsCJKCompatibilityIdeographsSupplement(void) {
37623: int test_ret = 0;
37624:
37625: #if defined(LIBXML_UNICODE_ENABLED)
37626: int mem_base;
37627: int ret_val;
37628: int code; /* UCS code point */
37629: int n_code;
37630:
37631: for (n_code = 0;n_code < gen_nb_int;n_code++) {
37632: mem_base = xmlMemBlocks();
37633: code = gen_int(n_code, 0);
37634:
37635: ret_val = xmlUCSIsCJKCompatibilityIdeographsSupplement(code);
37636: desret_int(ret_val);
37637: call_tests++;
37638: des_int(n_code, code, 0);
37639: xmlResetLastError();
37640: if (mem_base != xmlMemBlocks()) {
37641: printf("Leak of %d blocks found in xmlUCSIsCJKCompatibilityIdeographsSupplement",
37642: xmlMemBlocks() - mem_base);
37643: test_ret++;
37644: printf(" %d", n_code);
37645: printf("\n");
37646: }
37647: }
37648: function_tests++;
37649: #endif
37650:
37651: return(test_ret);
37652: }
37653:
37654:
37655: static int
37656: test_xmlUCSIsCJKRadicalsSupplement(void) {
37657: int test_ret = 0;
37658:
37659: #if defined(LIBXML_UNICODE_ENABLED)
37660: int mem_base;
37661: int ret_val;
37662: int code; /* UCS code point */
37663: int n_code;
37664:
37665: for (n_code = 0;n_code < gen_nb_int;n_code++) {
37666: mem_base = xmlMemBlocks();
37667: code = gen_int(n_code, 0);
37668:
37669: ret_val = xmlUCSIsCJKRadicalsSupplement(code);
37670: desret_int(ret_val);
37671: call_tests++;
37672: des_int(n_code, code, 0);
37673: xmlResetLastError();
37674: if (mem_base != xmlMemBlocks()) {
37675: printf("Leak of %d blocks found in xmlUCSIsCJKRadicalsSupplement",
37676: xmlMemBlocks() - mem_base);
37677: test_ret++;
37678: printf(" %d", n_code);
37679: printf("\n");
37680: }
37681: }
37682: function_tests++;
37683: #endif
37684:
37685: return(test_ret);
37686: }
37687:
37688:
37689: static int
37690: test_xmlUCSIsCJKSymbolsandPunctuation(void) {
37691: int test_ret = 0;
37692:
37693: #if defined(LIBXML_UNICODE_ENABLED)
37694: int mem_base;
37695: int ret_val;
37696: int code; /* UCS code point */
37697: int n_code;
37698:
37699: for (n_code = 0;n_code < gen_nb_int;n_code++) {
37700: mem_base = xmlMemBlocks();
37701: code = gen_int(n_code, 0);
37702:
37703: ret_val = xmlUCSIsCJKSymbolsandPunctuation(code);
37704: desret_int(ret_val);
37705: call_tests++;
37706: des_int(n_code, code, 0);
37707: xmlResetLastError();
37708: if (mem_base != xmlMemBlocks()) {
37709: printf("Leak of %d blocks found in xmlUCSIsCJKSymbolsandPunctuation",
37710: xmlMemBlocks() - mem_base);
37711: test_ret++;
37712: printf(" %d", n_code);
37713: printf("\n");
37714: }
37715: }
37716: function_tests++;
37717: #endif
37718:
37719: return(test_ret);
37720: }
37721:
37722:
37723: static int
37724: test_xmlUCSIsCJKUnifiedIdeographs(void) {
37725: int test_ret = 0;
37726:
37727: #if defined(LIBXML_UNICODE_ENABLED)
37728: int mem_base;
37729: int ret_val;
37730: int code; /* UCS code point */
37731: int n_code;
37732:
37733: for (n_code = 0;n_code < gen_nb_int;n_code++) {
37734: mem_base = xmlMemBlocks();
37735: code = gen_int(n_code, 0);
37736:
37737: ret_val = xmlUCSIsCJKUnifiedIdeographs(code);
37738: desret_int(ret_val);
37739: call_tests++;
37740: des_int(n_code, code, 0);
37741: xmlResetLastError();
37742: if (mem_base != xmlMemBlocks()) {
37743: printf("Leak of %d blocks found in xmlUCSIsCJKUnifiedIdeographs",
37744: xmlMemBlocks() - mem_base);
37745: test_ret++;
37746: printf(" %d", n_code);
37747: printf("\n");
37748: }
37749: }
37750: function_tests++;
37751: #endif
37752:
37753: return(test_ret);
37754: }
37755:
37756:
37757: static int
37758: test_xmlUCSIsCJKUnifiedIdeographsExtensionA(void) {
37759: int test_ret = 0;
37760:
37761: #if defined(LIBXML_UNICODE_ENABLED)
37762: int mem_base;
37763: int ret_val;
37764: int code; /* UCS code point */
37765: int n_code;
37766:
37767: for (n_code = 0;n_code < gen_nb_int;n_code++) {
37768: mem_base = xmlMemBlocks();
37769: code = gen_int(n_code, 0);
37770:
37771: ret_val = xmlUCSIsCJKUnifiedIdeographsExtensionA(code);
37772: desret_int(ret_val);
37773: call_tests++;
37774: des_int(n_code, code, 0);
37775: xmlResetLastError();
37776: if (mem_base != xmlMemBlocks()) {
37777: printf("Leak of %d blocks found in xmlUCSIsCJKUnifiedIdeographsExtensionA",
37778: xmlMemBlocks() - mem_base);
37779: test_ret++;
37780: printf(" %d", n_code);
37781: printf("\n");
37782: }
37783: }
37784: function_tests++;
37785: #endif
37786:
37787: return(test_ret);
37788: }
37789:
37790:
37791: static int
37792: test_xmlUCSIsCJKUnifiedIdeographsExtensionB(void) {
37793: int test_ret = 0;
37794:
37795: #if defined(LIBXML_UNICODE_ENABLED)
37796: int mem_base;
37797: int ret_val;
37798: int code; /* UCS code point */
37799: int n_code;
37800:
37801: for (n_code = 0;n_code < gen_nb_int;n_code++) {
37802: mem_base = xmlMemBlocks();
37803: code = gen_int(n_code, 0);
37804:
37805: ret_val = xmlUCSIsCJKUnifiedIdeographsExtensionB(code);
37806: desret_int(ret_val);
37807: call_tests++;
37808: des_int(n_code, code, 0);
37809: xmlResetLastError();
37810: if (mem_base != xmlMemBlocks()) {
37811: printf("Leak of %d blocks found in xmlUCSIsCJKUnifiedIdeographsExtensionB",
37812: xmlMemBlocks() - mem_base);
37813: test_ret++;
37814: printf(" %d", n_code);
37815: printf("\n");
37816: }
37817: }
37818: function_tests++;
37819: #endif
37820:
37821: return(test_ret);
37822: }
37823:
37824:
37825: static int
37826: test_xmlUCSIsCat(void) {
37827: int test_ret = 0;
37828:
37829: #if defined(LIBXML_UNICODE_ENABLED)
37830: int mem_base;
37831: int ret_val;
37832: int code; /* UCS code point */
37833: int n_code;
37834: char * cat; /* UCS Category name */
37835: int n_cat;
37836:
37837: for (n_code = 0;n_code < gen_nb_int;n_code++) {
37838: for (n_cat = 0;n_cat < gen_nb_const_char_ptr;n_cat++) {
37839: mem_base = xmlMemBlocks();
37840: code = gen_int(n_code, 0);
37841: cat = gen_const_char_ptr(n_cat, 1);
37842:
37843: ret_val = xmlUCSIsCat(code, (const char *)cat);
37844: desret_int(ret_val);
37845: call_tests++;
37846: des_int(n_code, code, 0);
37847: des_const_char_ptr(n_cat, (const char *)cat, 1);
37848: xmlResetLastError();
37849: if (mem_base != xmlMemBlocks()) {
37850: printf("Leak of %d blocks found in xmlUCSIsCat",
37851: xmlMemBlocks() - mem_base);
37852: test_ret++;
37853: printf(" %d", n_code);
37854: printf(" %d", n_cat);
37855: printf("\n");
37856: }
37857: }
37858: }
37859: function_tests++;
37860: #endif
37861:
37862: return(test_ret);
37863: }
37864:
37865:
37866: static int
37867: test_xmlUCSIsCatC(void) {
37868: int test_ret = 0;
37869:
37870: #if defined(LIBXML_UNICODE_ENABLED)
37871: int mem_base;
37872: int ret_val;
37873: int code; /* UCS code point */
37874: int n_code;
37875:
37876: for (n_code = 0;n_code < gen_nb_int;n_code++) {
37877: mem_base = xmlMemBlocks();
37878: code = gen_int(n_code, 0);
37879:
37880: ret_val = xmlUCSIsCatC(code);
37881: desret_int(ret_val);
37882: call_tests++;
37883: des_int(n_code, code, 0);
37884: xmlResetLastError();
37885: if (mem_base != xmlMemBlocks()) {
37886: printf("Leak of %d blocks found in xmlUCSIsCatC",
37887: xmlMemBlocks() - mem_base);
37888: test_ret++;
37889: printf(" %d", n_code);
37890: printf("\n");
37891: }
37892: }
37893: function_tests++;
37894: #endif
37895:
37896: return(test_ret);
37897: }
37898:
37899:
37900: static int
37901: test_xmlUCSIsCatCc(void) {
37902: int test_ret = 0;
37903:
37904: #if defined(LIBXML_UNICODE_ENABLED)
37905: int mem_base;
37906: int ret_val;
37907: int code; /* UCS code point */
37908: int n_code;
37909:
37910: for (n_code = 0;n_code < gen_nb_int;n_code++) {
37911: mem_base = xmlMemBlocks();
37912: code = gen_int(n_code, 0);
37913:
37914: ret_val = xmlUCSIsCatCc(code);
37915: desret_int(ret_val);
37916: call_tests++;
37917: des_int(n_code, code, 0);
37918: xmlResetLastError();
37919: if (mem_base != xmlMemBlocks()) {
37920: printf("Leak of %d blocks found in xmlUCSIsCatCc",
37921: xmlMemBlocks() - mem_base);
37922: test_ret++;
37923: printf(" %d", n_code);
37924: printf("\n");
37925: }
37926: }
37927: function_tests++;
37928: #endif
37929:
37930: return(test_ret);
37931: }
37932:
37933:
37934: static int
37935: test_xmlUCSIsCatCf(void) {
37936: int test_ret = 0;
37937:
37938: #if defined(LIBXML_UNICODE_ENABLED)
37939: int mem_base;
37940: int ret_val;
37941: int code; /* UCS code point */
37942: int n_code;
37943:
37944: for (n_code = 0;n_code < gen_nb_int;n_code++) {
37945: mem_base = xmlMemBlocks();
37946: code = gen_int(n_code, 0);
37947:
37948: ret_val = xmlUCSIsCatCf(code);
37949: desret_int(ret_val);
37950: call_tests++;
37951: des_int(n_code, code, 0);
37952: xmlResetLastError();
37953: if (mem_base != xmlMemBlocks()) {
37954: printf("Leak of %d blocks found in xmlUCSIsCatCf",
37955: xmlMemBlocks() - mem_base);
37956: test_ret++;
37957: printf(" %d", n_code);
37958: printf("\n");
37959: }
37960: }
37961: function_tests++;
37962: #endif
37963:
37964: return(test_ret);
37965: }
37966:
37967:
37968: static int
37969: test_xmlUCSIsCatCo(void) {
37970: int test_ret = 0;
37971:
37972: #if defined(LIBXML_UNICODE_ENABLED)
37973: int mem_base;
37974: int ret_val;
37975: int code; /* UCS code point */
37976: int n_code;
37977:
37978: for (n_code = 0;n_code < gen_nb_int;n_code++) {
37979: mem_base = xmlMemBlocks();
37980: code = gen_int(n_code, 0);
37981:
37982: ret_val = xmlUCSIsCatCo(code);
37983: desret_int(ret_val);
37984: call_tests++;
37985: des_int(n_code, code, 0);
37986: xmlResetLastError();
37987: if (mem_base != xmlMemBlocks()) {
37988: printf("Leak of %d blocks found in xmlUCSIsCatCo",
37989: xmlMemBlocks() - mem_base);
37990: test_ret++;
37991: printf(" %d", n_code);
37992: printf("\n");
37993: }
37994: }
37995: function_tests++;
37996: #endif
37997:
37998: return(test_ret);
37999: }
38000:
38001:
38002: static int
38003: test_xmlUCSIsCatCs(void) {
38004: int test_ret = 0;
38005:
38006: #if defined(LIBXML_UNICODE_ENABLED)
38007: int mem_base;
38008: int ret_val;
38009: int code; /* UCS code point */
38010: int n_code;
38011:
38012: for (n_code = 0;n_code < gen_nb_int;n_code++) {
38013: mem_base = xmlMemBlocks();
38014: code = gen_int(n_code, 0);
38015:
38016: ret_val = xmlUCSIsCatCs(code);
38017: desret_int(ret_val);
38018: call_tests++;
38019: des_int(n_code, code, 0);
38020: xmlResetLastError();
38021: if (mem_base != xmlMemBlocks()) {
38022: printf("Leak of %d blocks found in xmlUCSIsCatCs",
38023: xmlMemBlocks() - mem_base);
38024: test_ret++;
38025: printf(" %d", n_code);
38026: printf("\n");
38027: }
38028: }
38029: function_tests++;
38030: #endif
38031:
38032: return(test_ret);
38033: }
38034:
38035:
38036: static int
38037: test_xmlUCSIsCatL(void) {
38038: int test_ret = 0;
38039:
38040: #if defined(LIBXML_UNICODE_ENABLED)
38041: int mem_base;
38042: int ret_val;
38043: int code; /* UCS code point */
38044: int n_code;
38045:
38046: for (n_code = 0;n_code < gen_nb_int;n_code++) {
38047: mem_base = xmlMemBlocks();
38048: code = gen_int(n_code, 0);
38049:
38050: ret_val = xmlUCSIsCatL(code);
38051: desret_int(ret_val);
38052: call_tests++;
38053: des_int(n_code, code, 0);
38054: xmlResetLastError();
38055: if (mem_base != xmlMemBlocks()) {
38056: printf("Leak of %d blocks found in xmlUCSIsCatL",
38057: xmlMemBlocks() - mem_base);
38058: test_ret++;
38059: printf(" %d", n_code);
38060: printf("\n");
38061: }
38062: }
38063: function_tests++;
38064: #endif
38065:
38066: return(test_ret);
38067: }
38068:
38069:
38070: static int
38071: test_xmlUCSIsCatLl(void) {
38072: int test_ret = 0;
38073:
38074: #if defined(LIBXML_UNICODE_ENABLED)
38075: int mem_base;
38076: int ret_val;
38077: int code; /* UCS code point */
38078: int n_code;
38079:
38080: for (n_code = 0;n_code < gen_nb_int;n_code++) {
38081: mem_base = xmlMemBlocks();
38082: code = gen_int(n_code, 0);
38083:
38084: ret_val = xmlUCSIsCatLl(code);
38085: desret_int(ret_val);
38086: call_tests++;
38087: des_int(n_code, code, 0);
38088: xmlResetLastError();
38089: if (mem_base != xmlMemBlocks()) {
38090: printf("Leak of %d blocks found in xmlUCSIsCatLl",
38091: xmlMemBlocks() - mem_base);
38092: test_ret++;
38093: printf(" %d", n_code);
38094: printf("\n");
38095: }
38096: }
38097: function_tests++;
38098: #endif
38099:
38100: return(test_ret);
38101: }
38102:
38103:
38104: static int
38105: test_xmlUCSIsCatLm(void) {
38106: int test_ret = 0;
38107:
38108: #if defined(LIBXML_UNICODE_ENABLED)
38109: int mem_base;
38110: int ret_val;
38111: int code; /* UCS code point */
38112: int n_code;
38113:
38114: for (n_code = 0;n_code < gen_nb_int;n_code++) {
38115: mem_base = xmlMemBlocks();
38116: code = gen_int(n_code, 0);
38117:
38118: ret_val = xmlUCSIsCatLm(code);
38119: desret_int(ret_val);
38120: call_tests++;
38121: des_int(n_code, code, 0);
38122: xmlResetLastError();
38123: if (mem_base != xmlMemBlocks()) {
38124: printf("Leak of %d blocks found in xmlUCSIsCatLm",
38125: xmlMemBlocks() - mem_base);
38126: test_ret++;
38127: printf(" %d", n_code);
38128: printf("\n");
38129: }
38130: }
38131: function_tests++;
38132: #endif
38133:
38134: return(test_ret);
38135: }
38136:
38137:
38138: static int
38139: test_xmlUCSIsCatLo(void) {
38140: int test_ret = 0;
38141:
38142: #if defined(LIBXML_UNICODE_ENABLED)
38143: int mem_base;
38144: int ret_val;
38145: int code; /* UCS code point */
38146: int n_code;
38147:
38148: for (n_code = 0;n_code < gen_nb_int;n_code++) {
38149: mem_base = xmlMemBlocks();
38150: code = gen_int(n_code, 0);
38151:
38152: ret_val = xmlUCSIsCatLo(code);
38153: desret_int(ret_val);
38154: call_tests++;
38155: des_int(n_code, code, 0);
38156: xmlResetLastError();
38157: if (mem_base != xmlMemBlocks()) {
38158: printf("Leak of %d blocks found in xmlUCSIsCatLo",
38159: xmlMemBlocks() - mem_base);
38160: test_ret++;
38161: printf(" %d", n_code);
38162: printf("\n");
38163: }
38164: }
38165: function_tests++;
38166: #endif
38167:
38168: return(test_ret);
38169: }
38170:
38171:
38172: static int
38173: test_xmlUCSIsCatLt(void) {
38174: int test_ret = 0;
38175:
38176: #if defined(LIBXML_UNICODE_ENABLED)
38177: int mem_base;
38178: int ret_val;
38179: int code; /* UCS code point */
38180: int n_code;
38181:
38182: for (n_code = 0;n_code < gen_nb_int;n_code++) {
38183: mem_base = xmlMemBlocks();
38184: code = gen_int(n_code, 0);
38185:
38186: ret_val = xmlUCSIsCatLt(code);
38187: desret_int(ret_val);
38188: call_tests++;
38189: des_int(n_code, code, 0);
38190: xmlResetLastError();
38191: if (mem_base != xmlMemBlocks()) {
38192: printf("Leak of %d blocks found in xmlUCSIsCatLt",
38193: xmlMemBlocks() - mem_base);
38194: test_ret++;
38195: printf(" %d", n_code);
38196: printf("\n");
38197: }
38198: }
38199: function_tests++;
38200: #endif
38201:
38202: return(test_ret);
38203: }
38204:
38205:
38206: static int
38207: test_xmlUCSIsCatLu(void) {
38208: int test_ret = 0;
38209:
38210: #if defined(LIBXML_UNICODE_ENABLED)
38211: int mem_base;
38212: int ret_val;
38213: int code; /* UCS code point */
38214: int n_code;
38215:
38216: for (n_code = 0;n_code < gen_nb_int;n_code++) {
38217: mem_base = xmlMemBlocks();
38218: code = gen_int(n_code, 0);
38219:
38220: ret_val = xmlUCSIsCatLu(code);
38221: desret_int(ret_val);
38222: call_tests++;
38223: des_int(n_code, code, 0);
38224: xmlResetLastError();
38225: if (mem_base != xmlMemBlocks()) {
38226: printf("Leak of %d blocks found in xmlUCSIsCatLu",
38227: xmlMemBlocks() - mem_base);
38228: test_ret++;
38229: printf(" %d", n_code);
38230: printf("\n");
38231: }
38232: }
38233: function_tests++;
38234: #endif
38235:
38236: return(test_ret);
38237: }
38238:
38239:
38240: static int
38241: test_xmlUCSIsCatM(void) {
38242: int test_ret = 0;
38243:
38244: #if defined(LIBXML_UNICODE_ENABLED)
38245: int mem_base;
38246: int ret_val;
38247: int code; /* UCS code point */
38248: int n_code;
38249:
38250: for (n_code = 0;n_code < gen_nb_int;n_code++) {
38251: mem_base = xmlMemBlocks();
38252: code = gen_int(n_code, 0);
38253:
38254: ret_val = xmlUCSIsCatM(code);
38255: desret_int(ret_val);
38256: call_tests++;
38257: des_int(n_code, code, 0);
38258: xmlResetLastError();
38259: if (mem_base != xmlMemBlocks()) {
38260: printf("Leak of %d blocks found in xmlUCSIsCatM",
38261: xmlMemBlocks() - mem_base);
38262: test_ret++;
38263: printf(" %d", n_code);
38264: printf("\n");
38265: }
38266: }
38267: function_tests++;
38268: #endif
38269:
38270: return(test_ret);
38271: }
38272:
38273:
38274: static int
38275: test_xmlUCSIsCatMc(void) {
38276: int test_ret = 0;
38277:
38278: #if defined(LIBXML_UNICODE_ENABLED)
38279: int mem_base;
38280: int ret_val;
38281: int code; /* UCS code point */
38282: int n_code;
38283:
38284: for (n_code = 0;n_code < gen_nb_int;n_code++) {
38285: mem_base = xmlMemBlocks();
38286: code = gen_int(n_code, 0);
38287:
38288: ret_val = xmlUCSIsCatMc(code);
38289: desret_int(ret_val);
38290: call_tests++;
38291: des_int(n_code, code, 0);
38292: xmlResetLastError();
38293: if (mem_base != xmlMemBlocks()) {
38294: printf("Leak of %d blocks found in xmlUCSIsCatMc",
38295: xmlMemBlocks() - mem_base);
38296: test_ret++;
38297: printf(" %d", n_code);
38298: printf("\n");
38299: }
38300: }
38301: function_tests++;
38302: #endif
38303:
38304: return(test_ret);
38305: }
38306:
38307:
38308: static int
38309: test_xmlUCSIsCatMe(void) {
38310: int test_ret = 0;
38311:
38312: #if defined(LIBXML_UNICODE_ENABLED)
38313: int mem_base;
38314: int ret_val;
38315: int code; /* UCS code point */
38316: int n_code;
38317:
38318: for (n_code = 0;n_code < gen_nb_int;n_code++) {
38319: mem_base = xmlMemBlocks();
38320: code = gen_int(n_code, 0);
38321:
38322: ret_val = xmlUCSIsCatMe(code);
38323: desret_int(ret_val);
38324: call_tests++;
38325: des_int(n_code, code, 0);
38326: xmlResetLastError();
38327: if (mem_base != xmlMemBlocks()) {
38328: printf("Leak of %d blocks found in xmlUCSIsCatMe",
38329: xmlMemBlocks() - mem_base);
38330: test_ret++;
38331: printf(" %d", n_code);
38332: printf("\n");
38333: }
38334: }
38335: function_tests++;
38336: #endif
38337:
38338: return(test_ret);
38339: }
38340:
38341:
38342: static int
38343: test_xmlUCSIsCatMn(void) {
38344: int test_ret = 0;
38345:
38346: #if defined(LIBXML_UNICODE_ENABLED)
38347: int mem_base;
38348: int ret_val;
38349: int code; /* UCS code point */
38350: int n_code;
38351:
38352: for (n_code = 0;n_code < gen_nb_int;n_code++) {
38353: mem_base = xmlMemBlocks();
38354: code = gen_int(n_code, 0);
38355:
38356: ret_val = xmlUCSIsCatMn(code);
38357: desret_int(ret_val);
38358: call_tests++;
38359: des_int(n_code, code, 0);
38360: xmlResetLastError();
38361: if (mem_base != xmlMemBlocks()) {
38362: printf("Leak of %d blocks found in xmlUCSIsCatMn",
38363: xmlMemBlocks() - mem_base);
38364: test_ret++;
38365: printf(" %d", n_code);
38366: printf("\n");
38367: }
38368: }
38369: function_tests++;
38370: #endif
38371:
38372: return(test_ret);
38373: }
38374:
38375:
38376: static int
38377: test_xmlUCSIsCatN(void) {
38378: int test_ret = 0;
38379:
38380: #if defined(LIBXML_UNICODE_ENABLED)
38381: int mem_base;
38382: int ret_val;
38383: int code; /* UCS code point */
38384: int n_code;
38385:
38386: for (n_code = 0;n_code < gen_nb_int;n_code++) {
38387: mem_base = xmlMemBlocks();
38388: code = gen_int(n_code, 0);
38389:
38390: ret_val = xmlUCSIsCatN(code);
38391: desret_int(ret_val);
38392: call_tests++;
38393: des_int(n_code, code, 0);
38394: xmlResetLastError();
38395: if (mem_base != xmlMemBlocks()) {
38396: printf("Leak of %d blocks found in xmlUCSIsCatN",
38397: xmlMemBlocks() - mem_base);
38398: test_ret++;
38399: printf(" %d", n_code);
38400: printf("\n");
38401: }
38402: }
38403: function_tests++;
38404: #endif
38405:
38406: return(test_ret);
38407: }
38408:
38409:
38410: static int
38411: test_xmlUCSIsCatNd(void) {
38412: int test_ret = 0;
38413:
38414: #if defined(LIBXML_UNICODE_ENABLED)
38415: int mem_base;
38416: int ret_val;
38417: int code; /* UCS code point */
38418: int n_code;
38419:
38420: for (n_code = 0;n_code < gen_nb_int;n_code++) {
38421: mem_base = xmlMemBlocks();
38422: code = gen_int(n_code, 0);
38423:
38424: ret_val = xmlUCSIsCatNd(code);
38425: desret_int(ret_val);
38426: call_tests++;
38427: des_int(n_code, code, 0);
38428: xmlResetLastError();
38429: if (mem_base != xmlMemBlocks()) {
38430: printf("Leak of %d blocks found in xmlUCSIsCatNd",
38431: xmlMemBlocks() - mem_base);
38432: test_ret++;
38433: printf(" %d", n_code);
38434: printf("\n");
38435: }
38436: }
38437: function_tests++;
38438: #endif
38439:
38440: return(test_ret);
38441: }
38442:
38443:
38444: static int
38445: test_xmlUCSIsCatNl(void) {
38446: int test_ret = 0;
38447:
38448: #if defined(LIBXML_UNICODE_ENABLED)
38449: int mem_base;
38450: int ret_val;
38451: int code; /* UCS code point */
38452: int n_code;
38453:
38454: for (n_code = 0;n_code < gen_nb_int;n_code++) {
38455: mem_base = xmlMemBlocks();
38456: code = gen_int(n_code, 0);
38457:
38458: ret_val = xmlUCSIsCatNl(code);
38459: desret_int(ret_val);
38460: call_tests++;
38461: des_int(n_code, code, 0);
38462: xmlResetLastError();
38463: if (mem_base != xmlMemBlocks()) {
38464: printf("Leak of %d blocks found in xmlUCSIsCatNl",
38465: xmlMemBlocks() - mem_base);
38466: test_ret++;
38467: printf(" %d", n_code);
38468: printf("\n");
38469: }
38470: }
38471: function_tests++;
38472: #endif
38473:
38474: return(test_ret);
38475: }
38476:
38477:
38478: static int
38479: test_xmlUCSIsCatNo(void) {
38480: int test_ret = 0;
38481:
38482: #if defined(LIBXML_UNICODE_ENABLED)
38483: int mem_base;
38484: int ret_val;
38485: int code; /* UCS code point */
38486: int n_code;
38487:
38488: for (n_code = 0;n_code < gen_nb_int;n_code++) {
38489: mem_base = xmlMemBlocks();
38490: code = gen_int(n_code, 0);
38491:
38492: ret_val = xmlUCSIsCatNo(code);
38493: desret_int(ret_val);
38494: call_tests++;
38495: des_int(n_code, code, 0);
38496: xmlResetLastError();
38497: if (mem_base != xmlMemBlocks()) {
38498: printf("Leak of %d blocks found in xmlUCSIsCatNo",
38499: xmlMemBlocks() - mem_base);
38500: test_ret++;
38501: printf(" %d", n_code);
38502: printf("\n");
38503: }
38504: }
38505: function_tests++;
38506: #endif
38507:
38508: return(test_ret);
38509: }
38510:
38511:
38512: static int
38513: test_xmlUCSIsCatP(void) {
38514: int test_ret = 0;
38515:
38516: #if defined(LIBXML_UNICODE_ENABLED)
38517: int mem_base;
38518: int ret_val;
38519: int code; /* UCS code point */
38520: int n_code;
38521:
38522: for (n_code = 0;n_code < gen_nb_int;n_code++) {
38523: mem_base = xmlMemBlocks();
38524: code = gen_int(n_code, 0);
38525:
38526: ret_val = xmlUCSIsCatP(code);
38527: desret_int(ret_val);
38528: call_tests++;
38529: des_int(n_code, code, 0);
38530: xmlResetLastError();
38531: if (mem_base != xmlMemBlocks()) {
38532: printf("Leak of %d blocks found in xmlUCSIsCatP",
38533: xmlMemBlocks() - mem_base);
38534: test_ret++;
38535: printf(" %d", n_code);
38536: printf("\n");
38537: }
38538: }
38539: function_tests++;
38540: #endif
38541:
38542: return(test_ret);
38543: }
38544:
38545:
38546: static int
38547: test_xmlUCSIsCatPc(void) {
38548: int test_ret = 0;
38549:
38550: #if defined(LIBXML_UNICODE_ENABLED)
38551: int mem_base;
38552: int ret_val;
38553: int code; /* UCS code point */
38554: int n_code;
38555:
38556: for (n_code = 0;n_code < gen_nb_int;n_code++) {
38557: mem_base = xmlMemBlocks();
38558: code = gen_int(n_code, 0);
38559:
38560: ret_val = xmlUCSIsCatPc(code);
38561: desret_int(ret_val);
38562: call_tests++;
38563: des_int(n_code, code, 0);
38564: xmlResetLastError();
38565: if (mem_base != xmlMemBlocks()) {
38566: printf("Leak of %d blocks found in xmlUCSIsCatPc",
38567: xmlMemBlocks() - mem_base);
38568: test_ret++;
38569: printf(" %d", n_code);
38570: printf("\n");
38571: }
38572: }
38573: function_tests++;
38574: #endif
38575:
38576: return(test_ret);
38577: }
38578:
38579:
38580: static int
38581: test_xmlUCSIsCatPd(void) {
38582: int test_ret = 0;
38583:
38584: #if defined(LIBXML_UNICODE_ENABLED)
38585: int mem_base;
38586: int ret_val;
38587: int code; /* UCS code point */
38588: int n_code;
38589:
38590: for (n_code = 0;n_code < gen_nb_int;n_code++) {
38591: mem_base = xmlMemBlocks();
38592: code = gen_int(n_code, 0);
38593:
38594: ret_val = xmlUCSIsCatPd(code);
38595: desret_int(ret_val);
38596: call_tests++;
38597: des_int(n_code, code, 0);
38598: xmlResetLastError();
38599: if (mem_base != xmlMemBlocks()) {
38600: printf("Leak of %d blocks found in xmlUCSIsCatPd",
38601: xmlMemBlocks() - mem_base);
38602: test_ret++;
38603: printf(" %d", n_code);
38604: printf("\n");
38605: }
38606: }
38607: function_tests++;
38608: #endif
38609:
38610: return(test_ret);
38611: }
38612:
38613:
38614: static int
38615: test_xmlUCSIsCatPe(void) {
38616: int test_ret = 0;
38617:
38618: #if defined(LIBXML_UNICODE_ENABLED)
38619: int mem_base;
38620: int ret_val;
38621: int code; /* UCS code point */
38622: int n_code;
38623:
38624: for (n_code = 0;n_code < gen_nb_int;n_code++) {
38625: mem_base = xmlMemBlocks();
38626: code = gen_int(n_code, 0);
38627:
38628: ret_val = xmlUCSIsCatPe(code);
38629: desret_int(ret_val);
38630: call_tests++;
38631: des_int(n_code, code, 0);
38632: xmlResetLastError();
38633: if (mem_base != xmlMemBlocks()) {
38634: printf("Leak of %d blocks found in xmlUCSIsCatPe",
38635: xmlMemBlocks() - mem_base);
38636: test_ret++;
38637: printf(" %d", n_code);
38638: printf("\n");
38639: }
38640: }
38641: function_tests++;
38642: #endif
38643:
38644: return(test_ret);
38645: }
38646:
38647:
38648: static int
38649: test_xmlUCSIsCatPf(void) {
38650: int test_ret = 0;
38651:
38652: #if defined(LIBXML_UNICODE_ENABLED)
38653: int mem_base;
38654: int ret_val;
38655: int code; /* UCS code point */
38656: int n_code;
38657:
38658: for (n_code = 0;n_code < gen_nb_int;n_code++) {
38659: mem_base = xmlMemBlocks();
38660: code = gen_int(n_code, 0);
38661:
38662: ret_val = xmlUCSIsCatPf(code);
38663: desret_int(ret_val);
38664: call_tests++;
38665: des_int(n_code, code, 0);
38666: xmlResetLastError();
38667: if (mem_base != xmlMemBlocks()) {
38668: printf("Leak of %d blocks found in xmlUCSIsCatPf",
38669: xmlMemBlocks() - mem_base);
38670: test_ret++;
38671: printf(" %d", n_code);
38672: printf("\n");
38673: }
38674: }
38675: function_tests++;
38676: #endif
38677:
38678: return(test_ret);
38679: }
38680:
38681:
38682: static int
38683: test_xmlUCSIsCatPi(void) {
38684: int test_ret = 0;
38685:
38686: #if defined(LIBXML_UNICODE_ENABLED)
38687: int mem_base;
38688: int ret_val;
38689: int code; /* UCS code point */
38690: int n_code;
38691:
38692: for (n_code = 0;n_code < gen_nb_int;n_code++) {
38693: mem_base = xmlMemBlocks();
38694: code = gen_int(n_code, 0);
38695:
38696: ret_val = xmlUCSIsCatPi(code);
38697: desret_int(ret_val);
38698: call_tests++;
38699: des_int(n_code, code, 0);
38700: xmlResetLastError();
38701: if (mem_base != xmlMemBlocks()) {
38702: printf("Leak of %d blocks found in xmlUCSIsCatPi",
38703: xmlMemBlocks() - mem_base);
38704: test_ret++;
38705: printf(" %d", n_code);
38706: printf("\n");
38707: }
38708: }
38709: function_tests++;
38710: #endif
38711:
38712: return(test_ret);
38713: }
38714:
38715:
38716: static int
38717: test_xmlUCSIsCatPo(void) {
38718: int test_ret = 0;
38719:
38720: #if defined(LIBXML_UNICODE_ENABLED)
38721: int mem_base;
38722: int ret_val;
38723: int code; /* UCS code point */
38724: int n_code;
38725:
38726: for (n_code = 0;n_code < gen_nb_int;n_code++) {
38727: mem_base = xmlMemBlocks();
38728: code = gen_int(n_code, 0);
38729:
38730: ret_val = xmlUCSIsCatPo(code);
38731: desret_int(ret_val);
38732: call_tests++;
38733: des_int(n_code, code, 0);
38734: xmlResetLastError();
38735: if (mem_base != xmlMemBlocks()) {
38736: printf("Leak of %d blocks found in xmlUCSIsCatPo",
38737: xmlMemBlocks() - mem_base);
38738: test_ret++;
38739: printf(" %d", n_code);
38740: printf("\n");
38741: }
38742: }
38743: function_tests++;
38744: #endif
38745:
38746: return(test_ret);
38747: }
38748:
38749:
38750: static int
38751: test_xmlUCSIsCatPs(void) {
38752: int test_ret = 0;
38753:
38754: #if defined(LIBXML_UNICODE_ENABLED)
38755: int mem_base;
38756: int ret_val;
38757: int code; /* UCS code point */
38758: int n_code;
38759:
38760: for (n_code = 0;n_code < gen_nb_int;n_code++) {
38761: mem_base = xmlMemBlocks();
38762: code = gen_int(n_code, 0);
38763:
38764: ret_val = xmlUCSIsCatPs(code);
38765: desret_int(ret_val);
38766: call_tests++;
38767: des_int(n_code, code, 0);
38768: xmlResetLastError();
38769: if (mem_base != xmlMemBlocks()) {
38770: printf("Leak of %d blocks found in xmlUCSIsCatPs",
38771: xmlMemBlocks() - mem_base);
38772: test_ret++;
38773: printf(" %d", n_code);
38774: printf("\n");
38775: }
38776: }
38777: function_tests++;
38778: #endif
38779:
38780: return(test_ret);
38781: }
38782:
38783:
38784: static int
38785: test_xmlUCSIsCatS(void) {
38786: int test_ret = 0;
38787:
38788: #if defined(LIBXML_UNICODE_ENABLED)
38789: int mem_base;
38790: int ret_val;
38791: int code; /* UCS code point */
38792: int n_code;
38793:
38794: for (n_code = 0;n_code < gen_nb_int;n_code++) {
38795: mem_base = xmlMemBlocks();
38796: code = gen_int(n_code, 0);
38797:
38798: ret_val = xmlUCSIsCatS(code);
38799: desret_int(ret_val);
38800: call_tests++;
38801: des_int(n_code, code, 0);
38802: xmlResetLastError();
38803: if (mem_base != xmlMemBlocks()) {
38804: printf("Leak of %d blocks found in xmlUCSIsCatS",
38805: xmlMemBlocks() - mem_base);
38806: test_ret++;
38807: printf(" %d", n_code);
38808: printf("\n");
38809: }
38810: }
38811: function_tests++;
38812: #endif
38813:
38814: return(test_ret);
38815: }
38816:
38817:
38818: static int
38819: test_xmlUCSIsCatSc(void) {
38820: int test_ret = 0;
38821:
38822: #if defined(LIBXML_UNICODE_ENABLED)
38823: int mem_base;
38824: int ret_val;
38825: int code; /* UCS code point */
38826: int n_code;
38827:
38828: for (n_code = 0;n_code < gen_nb_int;n_code++) {
38829: mem_base = xmlMemBlocks();
38830: code = gen_int(n_code, 0);
38831:
38832: ret_val = xmlUCSIsCatSc(code);
38833: desret_int(ret_val);
38834: call_tests++;
38835: des_int(n_code, code, 0);
38836: xmlResetLastError();
38837: if (mem_base != xmlMemBlocks()) {
38838: printf("Leak of %d blocks found in xmlUCSIsCatSc",
38839: xmlMemBlocks() - mem_base);
38840: test_ret++;
38841: printf(" %d", n_code);
38842: printf("\n");
38843: }
38844: }
38845: function_tests++;
38846: #endif
38847:
38848: return(test_ret);
38849: }
38850:
38851:
38852: static int
38853: test_xmlUCSIsCatSk(void) {
38854: int test_ret = 0;
38855:
38856: #if defined(LIBXML_UNICODE_ENABLED)
38857: int mem_base;
38858: int ret_val;
38859: int code; /* UCS code point */
38860: int n_code;
38861:
38862: for (n_code = 0;n_code < gen_nb_int;n_code++) {
38863: mem_base = xmlMemBlocks();
38864: code = gen_int(n_code, 0);
38865:
38866: ret_val = xmlUCSIsCatSk(code);
38867: desret_int(ret_val);
38868: call_tests++;
38869: des_int(n_code, code, 0);
38870: xmlResetLastError();
38871: if (mem_base != xmlMemBlocks()) {
38872: printf("Leak of %d blocks found in xmlUCSIsCatSk",
38873: xmlMemBlocks() - mem_base);
38874: test_ret++;
38875: printf(" %d", n_code);
38876: printf("\n");
38877: }
38878: }
38879: function_tests++;
38880: #endif
38881:
38882: return(test_ret);
38883: }
38884:
38885:
38886: static int
38887: test_xmlUCSIsCatSm(void) {
38888: int test_ret = 0;
38889:
38890: #if defined(LIBXML_UNICODE_ENABLED)
38891: int mem_base;
38892: int ret_val;
38893: int code; /* UCS code point */
38894: int n_code;
38895:
38896: for (n_code = 0;n_code < gen_nb_int;n_code++) {
38897: mem_base = xmlMemBlocks();
38898: code = gen_int(n_code, 0);
38899:
38900: ret_val = xmlUCSIsCatSm(code);
38901: desret_int(ret_val);
38902: call_tests++;
38903: des_int(n_code, code, 0);
38904: xmlResetLastError();
38905: if (mem_base != xmlMemBlocks()) {
38906: printf("Leak of %d blocks found in xmlUCSIsCatSm",
38907: xmlMemBlocks() - mem_base);
38908: test_ret++;
38909: printf(" %d", n_code);
38910: printf("\n");
38911: }
38912: }
38913: function_tests++;
38914: #endif
38915:
38916: return(test_ret);
38917: }
38918:
38919:
38920: static int
38921: test_xmlUCSIsCatSo(void) {
38922: int test_ret = 0;
38923:
38924: #if defined(LIBXML_UNICODE_ENABLED)
38925: int mem_base;
38926: int ret_val;
38927: int code; /* UCS code point */
38928: int n_code;
38929:
38930: for (n_code = 0;n_code < gen_nb_int;n_code++) {
38931: mem_base = xmlMemBlocks();
38932: code = gen_int(n_code, 0);
38933:
38934: ret_val = xmlUCSIsCatSo(code);
38935: desret_int(ret_val);
38936: call_tests++;
38937: des_int(n_code, code, 0);
38938: xmlResetLastError();
38939: if (mem_base != xmlMemBlocks()) {
38940: printf("Leak of %d blocks found in xmlUCSIsCatSo",
38941: xmlMemBlocks() - mem_base);
38942: test_ret++;
38943: printf(" %d", n_code);
38944: printf("\n");
38945: }
38946: }
38947: function_tests++;
38948: #endif
38949:
38950: return(test_ret);
38951: }
38952:
38953:
38954: static int
38955: test_xmlUCSIsCatZ(void) {
38956: int test_ret = 0;
38957:
38958: #if defined(LIBXML_UNICODE_ENABLED)
38959: int mem_base;
38960: int ret_val;
38961: int code; /* UCS code point */
38962: int n_code;
38963:
38964: for (n_code = 0;n_code < gen_nb_int;n_code++) {
38965: mem_base = xmlMemBlocks();
38966: code = gen_int(n_code, 0);
38967:
38968: ret_val = xmlUCSIsCatZ(code);
38969: desret_int(ret_val);
38970: call_tests++;
38971: des_int(n_code, code, 0);
38972: xmlResetLastError();
38973: if (mem_base != xmlMemBlocks()) {
38974: printf("Leak of %d blocks found in xmlUCSIsCatZ",
38975: xmlMemBlocks() - mem_base);
38976: test_ret++;
38977: printf(" %d", n_code);
38978: printf("\n");
38979: }
38980: }
38981: function_tests++;
38982: #endif
38983:
38984: return(test_ret);
38985: }
38986:
38987:
38988: static int
38989: test_xmlUCSIsCatZl(void) {
38990: int test_ret = 0;
38991:
38992: #if defined(LIBXML_UNICODE_ENABLED)
38993: int mem_base;
38994: int ret_val;
38995: int code; /* UCS code point */
38996: int n_code;
38997:
38998: for (n_code = 0;n_code < gen_nb_int;n_code++) {
38999: mem_base = xmlMemBlocks();
39000: code = gen_int(n_code, 0);
39001:
39002: ret_val = xmlUCSIsCatZl(code);
39003: desret_int(ret_val);
39004: call_tests++;
39005: des_int(n_code, code, 0);
39006: xmlResetLastError();
39007: if (mem_base != xmlMemBlocks()) {
39008: printf("Leak of %d blocks found in xmlUCSIsCatZl",
39009: xmlMemBlocks() - mem_base);
39010: test_ret++;
39011: printf(" %d", n_code);
39012: printf("\n");
39013: }
39014: }
39015: function_tests++;
39016: #endif
39017:
39018: return(test_ret);
39019: }
39020:
39021:
39022: static int
39023: test_xmlUCSIsCatZp(void) {
39024: int test_ret = 0;
39025:
39026: #if defined(LIBXML_UNICODE_ENABLED)
39027: int mem_base;
39028: int ret_val;
39029: int code; /* UCS code point */
39030: int n_code;
39031:
39032: for (n_code = 0;n_code < gen_nb_int;n_code++) {
39033: mem_base = xmlMemBlocks();
39034: code = gen_int(n_code, 0);
39035:
39036: ret_val = xmlUCSIsCatZp(code);
39037: desret_int(ret_val);
39038: call_tests++;
39039: des_int(n_code, code, 0);
39040: xmlResetLastError();
39041: if (mem_base != xmlMemBlocks()) {
39042: printf("Leak of %d blocks found in xmlUCSIsCatZp",
39043: xmlMemBlocks() - mem_base);
39044: test_ret++;
39045: printf(" %d", n_code);
39046: printf("\n");
39047: }
39048: }
39049: function_tests++;
39050: #endif
39051:
39052: return(test_ret);
39053: }
39054:
39055:
39056: static int
39057: test_xmlUCSIsCatZs(void) {
39058: int test_ret = 0;
39059:
39060: #if defined(LIBXML_UNICODE_ENABLED)
39061: int mem_base;
39062: int ret_val;
39063: int code; /* UCS code point */
39064: int n_code;
39065:
39066: for (n_code = 0;n_code < gen_nb_int;n_code++) {
39067: mem_base = xmlMemBlocks();
39068: code = gen_int(n_code, 0);
39069:
39070: ret_val = xmlUCSIsCatZs(code);
39071: desret_int(ret_val);
39072: call_tests++;
39073: des_int(n_code, code, 0);
39074: xmlResetLastError();
39075: if (mem_base != xmlMemBlocks()) {
39076: printf("Leak of %d blocks found in xmlUCSIsCatZs",
39077: xmlMemBlocks() - mem_base);
39078: test_ret++;
39079: printf(" %d", n_code);
39080: printf("\n");
39081: }
39082: }
39083: function_tests++;
39084: #endif
39085:
39086: return(test_ret);
39087: }
39088:
39089:
39090: static int
39091: test_xmlUCSIsCherokee(void) {
39092: int test_ret = 0;
39093:
39094: #if defined(LIBXML_UNICODE_ENABLED)
39095: int mem_base;
39096: int ret_val;
39097: int code; /* UCS code point */
39098: int n_code;
39099:
39100: for (n_code = 0;n_code < gen_nb_int;n_code++) {
39101: mem_base = xmlMemBlocks();
39102: code = gen_int(n_code, 0);
39103:
39104: ret_val = xmlUCSIsCherokee(code);
39105: desret_int(ret_val);
39106: call_tests++;
39107: des_int(n_code, code, 0);
39108: xmlResetLastError();
39109: if (mem_base != xmlMemBlocks()) {
39110: printf("Leak of %d blocks found in xmlUCSIsCherokee",
39111: xmlMemBlocks() - mem_base);
39112: test_ret++;
39113: printf(" %d", n_code);
39114: printf("\n");
39115: }
39116: }
39117: function_tests++;
39118: #endif
39119:
39120: return(test_ret);
39121: }
39122:
39123:
39124: static int
39125: test_xmlUCSIsCombiningDiacriticalMarks(void) {
39126: int test_ret = 0;
39127:
39128: #if defined(LIBXML_UNICODE_ENABLED)
39129: int mem_base;
39130: int ret_val;
39131: int code; /* UCS code point */
39132: int n_code;
39133:
39134: for (n_code = 0;n_code < gen_nb_int;n_code++) {
39135: mem_base = xmlMemBlocks();
39136: code = gen_int(n_code, 0);
39137:
39138: ret_val = xmlUCSIsCombiningDiacriticalMarks(code);
39139: desret_int(ret_val);
39140: call_tests++;
39141: des_int(n_code, code, 0);
39142: xmlResetLastError();
39143: if (mem_base != xmlMemBlocks()) {
39144: printf("Leak of %d blocks found in xmlUCSIsCombiningDiacriticalMarks",
39145: xmlMemBlocks() - mem_base);
39146: test_ret++;
39147: printf(" %d", n_code);
39148: printf("\n");
39149: }
39150: }
39151: function_tests++;
39152: #endif
39153:
39154: return(test_ret);
39155: }
39156:
39157:
39158: static int
39159: test_xmlUCSIsCombiningDiacriticalMarksforSymbols(void) {
39160: int test_ret = 0;
39161:
39162: #if defined(LIBXML_UNICODE_ENABLED)
39163: int mem_base;
39164: int ret_val;
39165: int code; /* UCS code point */
39166: int n_code;
39167:
39168: for (n_code = 0;n_code < gen_nb_int;n_code++) {
39169: mem_base = xmlMemBlocks();
39170: code = gen_int(n_code, 0);
39171:
39172: ret_val = xmlUCSIsCombiningDiacriticalMarksforSymbols(code);
39173: desret_int(ret_val);
39174: call_tests++;
39175: des_int(n_code, code, 0);
39176: xmlResetLastError();
39177: if (mem_base != xmlMemBlocks()) {
39178: printf("Leak of %d blocks found in xmlUCSIsCombiningDiacriticalMarksforSymbols",
39179: xmlMemBlocks() - mem_base);
39180: test_ret++;
39181: printf(" %d", n_code);
39182: printf("\n");
39183: }
39184: }
39185: function_tests++;
39186: #endif
39187:
39188: return(test_ret);
39189: }
39190:
39191:
39192: static int
39193: test_xmlUCSIsCombiningHalfMarks(void) {
39194: int test_ret = 0;
39195:
39196: #if defined(LIBXML_UNICODE_ENABLED)
39197: int mem_base;
39198: int ret_val;
39199: int code; /* UCS code point */
39200: int n_code;
39201:
39202: for (n_code = 0;n_code < gen_nb_int;n_code++) {
39203: mem_base = xmlMemBlocks();
39204: code = gen_int(n_code, 0);
39205:
39206: ret_val = xmlUCSIsCombiningHalfMarks(code);
39207: desret_int(ret_val);
39208: call_tests++;
39209: des_int(n_code, code, 0);
39210: xmlResetLastError();
39211: if (mem_base != xmlMemBlocks()) {
39212: printf("Leak of %d blocks found in xmlUCSIsCombiningHalfMarks",
39213: xmlMemBlocks() - mem_base);
39214: test_ret++;
39215: printf(" %d", n_code);
39216: printf("\n");
39217: }
39218: }
39219: function_tests++;
39220: #endif
39221:
39222: return(test_ret);
39223: }
39224:
39225:
39226: static int
39227: test_xmlUCSIsCombiningMarksforSymbols(void) {
39228: int test_ret = 0;
39229:
39230: #if defined(LIBXML_UNICODE_ENABLED)
39231: int mem_base;
39232: int ret_val;
39233: int code; /* UCS code point */
39234: int n_code;
39235:
39236: for (n_code = 0;n_code < gen_nb_int;n_code++) {
39237: mem_base = xmlMemBlocks();
39238: code = gen_int(n_code, 0);
39239:
39240: ret_val = xmlUCSIsCombiningMarksforSymbols(code);
39241: desret_int(ret_val);
39242: call_tests++;
39243: des_int(n_code, code, 0);
39244: xmlResetLastError();
39245: if (mem_base != xmlMemBlocks()) {
39246: printf("Leak of %d blocks found in xmlUCSIsCombiningMarksforSymbols",
39247: xmlMemBlocks() - mem_base);
39248: test_ret++;
39249: printf(" %d", n_code);
39250: printf("\n");
39251: }
39252: }
39253: function_tests++;
39254: #endif
39255:
39256: return(test_ret);
39257: }
39258:
39259:
39260: static int
39261: test_xmlUCSIsControlPictures(void) {
39262: int test_ret = 0;
39263:
39264: #if defined(LIBXML_UNICODE_ENABLED)
39265: int mem_base;
39266: int ret_val;
39267: int code; /* UCS code point */
39268: int n_code;
39269:
39270: for (n_code = 0;n_code < gen_nb_int;n_code++) {
39271: mem_base = xmlMemBlocks();
39272: code = gen_int(n_code, 0);
39273:
39274: ret_val = xmlUCSIsControlPictures(code);
39275: desret_int(ret_val);
39276: call_tests++;
39277: des_int(n_code, code, 0);
39278: xmlResetLastError();
39279: if (mem_base != xmlMemBlocks()) {
39280: printf("Leak of %d blocks found in xmlUCSIsControlPictures",
39281: xmlMemBlocks() - mem_base);
39282: test_ret++;
39283: printf(" %d", n_code);
39284: printf("\n");
39285: }
39286: }
39287: function_tests++;
39288: #endif
39289:
39290: return(test_ret);
39291: }
39292:
39293:
39294: static int
39295: test_xmlUCSIsCurrencySymbols(void) {
39296: int test_ret = 0;
39297:
39298: #if defined(LIBXML_UNICODE_ENABLED)
39299: int mem_base;
39300: int ret_val;
39301: int code; /* UCS code point */
39302: int n_code;
39303:
39304: for (n_code = 0;n_code < gen_nb_int;n_code++) {
39305: mem_base = xmlMemBlocks();
39306: code = gen_int(n_code, 0);
39307:
39308: ret_val = xmlUCSIsCurrencySymbols(code);
39309: desret_int(ret_val);
39310: call_tests++;
39311: des_int(n_code, code, 0);
39312: xmlResetLastError();
39313: if (mem_base != xmlMemBlocks()) {
39314: printf("Leak of %d blocks found in xmlUCSIsCurrencySymbols",
39315: xmlMemBlocks() - mem_base);
39316: test_ret++;
39317: printf(" %d", n_code);
39318: printf("\n");
39319: }
39320: }
39321: function_tests++;
39322: #endif
39323:
39324: return(test_ret);
39325: }
39326:
39327:
39328: static int
39329: test_xmlUCSIsCypriotSyllabary(void) {
39330: int test_ret = 0;
39331:
39332: #if defined(LIBXML_UNICODE_ENABLED)
39333: int mem_base;
39334: int ret_val;
39335: int code; /* UCS code point */
39336: int n_code;
39337:
39338: for (n_code = 0;n_code < gen_nb_int;n_code++) {
39339: mem_base = xmlMemBlocks();
39340: code = gen_int(n_code, 0);
39341:
39342: ret_val = xmlUCSIsCypriotSyllabary(code);
39343: desret_int(ret_val);
39344: call_tests++;
39345: des_int(n_code, code, 0);
39346: xmlResetLastError();
39347: if (mem_base != xmlMemBlocks()) {
39348: printf("Leak of %d blocks found in xmlUCSIsCypriotSyllabary",
39349: xmlMemBlocks() - mem_base);
39350: test_ret++;
39351: printf(" %d", n_code);
39352: printf("\n");
39353: }
39354: }
39355: function_tests++;
39356: #endif
39357:
39358: return(test_ret);
39359: }
39360:
39361:
39362: static int
39363: test_xmlUCSIsCyrillic(void) {
39364: int test_ret = 0;
39365:
39366: #if defined(LIBXML_UNICODE_ENABLED)
39367: int mem_base;
39368: int ret_val;
39369: int code; /* UCS code point */
39370: int n_code;
39371:
39372: for (n_code = 0;n_code < gen_nb_int;n_code++) {
39373: mem_base = xmlMemBlocks();
39374: code = gen_int(n_code, 0);
39375:
39376: ret_val = xmlUCSIsCyrillic(code);
39377: desret_int(ret_val);
39378: call_tests++;
39379: des_int(n_code, code, 0);
39380: xmlResetLastError();
39381: if (mem_base != xmlMemBlocks()) {
39382: printf("Leak of %d blocks found in xmlUCSIsCyrillic",
39383: xmlMemBlocks() - mem_base);
39384: test_ret++;
39385: printf(" %d", n_code);
39386: printf("\n");
39387: }
39388: }
39389: function_tests++;
39390: #endif
39391:
39392: return(test_ret);
39393: }
39394:
39395:
39396: static int
39397: test_xmlUCSIsCyrillicSupplement(void) {
39398: int test_ret = 0;
39399:
39400: #if defined(LIBXML_UNICODE_ENABLED)
39401: int mem_base;
39402: int ret_val;
39403: int code; /* UCS code point */
39404: int n_code;
39405:
39406: for (n_code = 0;n_code < gen_nb_int;n_code++) {
39407: mem_base = xmlMemBlocks();
39408: code = gen_int(n_code, 0);
39409:
39410: ret_val = xmlUCSIsCyrillicSupplement(code);
39411: desret_int(ret_val);
39412: call_tests++;
39413: des_int(n_code, code, 0);
39414: xmlResetLastError();
39415: if (mem_base != xmlMemBlocks()) {
39416: printf("Leak of %d blocks found in xmlUCSIsCyrillicSupplement",
39417: xmlMemBlocks() - mem_base);
39418: test_ret++;
39419: printf(" %d", n_code);
39420: printf("\n");
39421: }
39422: }
39423: function_tests++;
39424: #endif
39425:
39426: return(test_ret);
39427: }
39428:
39429:
39430: static int
39431: test_xmlUCSIsDeseret(void) {
39432: int test_ret = 0;
39433:
39434: #if defined(LIBXML_UNICODE_ENABLED)
39435: int mem_base;
39436: int ret_val;
39437: int code; /* UCS code point */
39438: int n_code;
39439:
39440: for (n_code = 0;n_code < gen_nb_int;n_code++) {
39441: mem_base = xmlMemBlocks();
39442: code = gen_int(n_code, 0);
39443:
39444: ret_val = xmlUCSIsDeseret(code);
39445: desret_int(ret_val);
39446: call_tests++;
39447: des_int(n_code, code, 0);
39448: xmlResetLastError();
39449: if (mem_base != xmlMemBlocks()) {
39450: printf("Leak of %d blocks found in xmlUCSIsDeseret",
39451: xmlMemBlocks() - mem_base);
39452: test_ret++;
39453: printf(" %d", n_code);
39454: printf("\n");
39455: }
39456: }
39457: function_tests++;
39458: #endif
39459:
39460: return(test_ret);
39461: }
39462:
39463:
39464: static int
39465: test_xmlUCSIsDevanagari(void) {
39466: int test_ret = 0;
39467:
39468: #if defined(LIBXML_UNICODE_ENABLED)
39469: int mem_base;
39470: int ret_val;
39471: int code; /* UCS code point */
39472: int n_code;
39473:
39474: for (n_code = 0;n_code < gen_nb_int;n_code++) {
39475: mem_base = xmlMemBlocks();
39476: code = gen_int(n_code, 0);
39477:
39478: ret_val = xmlUCSIsDevanagari(code);
39479: desret_int(ret_val);
39480: call_tests++;
39481: des_int(n_code, code, 0);
39482: xmlResetLastError();
39483: if (mem_base != xmlMemBlocks()) {
39484: printf("Leak of %d blocks found in xmlUCSIsDevanagari",
39485: xmlMemBlocks() - mem_base);
39486: test_ret++;
39487: printf(" %d", n_code);
39488: printf("\n");
39489: }
39490: }
39491: function_tests++;
39492: #endif
39493:
39494: return(test_ret);
39495: }
39496:
39497:
39498: static int
39499: test_xmlUCSIsDingbats(void) {
39500: int test_ret = 0;
39501:
39502: #if defined(LIBXML_UNICODE_ENABLED)
39503: int mem_base;
39504: int ret_val;
39505: int code; /* UCS code point */
39506: int n_code;
39507:
39508: for (n_code = 0;n_code < gen_nb_int;n_code++) {
39509: mem_base = xmlMemBlocks();
39510: code = gen_int(n_code, 0);
39511:
39512: ret_val = xmlUCSIsDingbats(code);
39513: desret_int(ret_val);
39514: call_tests++;
39515: des_int(n_code, code, 0);
39516: xmlResetLastError();
39517: if (mem_base != xmlMemBlocks()) {
39518: printf("Leak of %d blocks found in xmlUCSIsDingbats",
39519: xmlMemBlocks() - mem_base);
39520: test_ret++;
39521: printf(" %d", n_code);
39522: printf("\n");
39523: }
39524: }
39525: function_tests++;
39526: #endif
39527:
39528: return(test_ret);
39529: }
39530:
39531:
39532: static int
39533: test_xmlUCSIsEnclosedAlphanumerics(void) {
39534: int test_ret = 0;
39535:
39536: #if defined(LIBXML_UNICODE_ENABLED)
39537: int mem_base;
39538: int ret_val;
39539: int code; /* UCS code point */
39540: int n_code;
39541:
39542: for (n_code = 0;n_code < gen_nb_int;n_code++) {
39543: mem_base = xmlMemBlocks();
39544: code = gen_int(n_code, 0);
39545:
39546: ret_val = xmlUCSIsEnclosedAlphanumerics(code);
39547: desret_int(ret_val);
39548: call_tests++;
39549: des_int(n_code, code, 0);
39550: xmlResetLastError();
39551: if (mem_base != xmlMemBlocks()) {
39552: printf("Leak of %d blocks found in xmlUCSIsEnclosedAlphanumerics",
39553: xmlMemBlocks() - mem_base);
39554: test_ret++;
39555: printf(" %d", n_code);
39556: printf("\n");
39557: }
39558: }
39559: function_tests++;
39560: #endif
39561:
39562: return(test_ret);
39563: }
39564:
39565:
39566: static int
39567: test_xmlUCSIsEnclosedCJKLettersandMonths(void) {
39568: int test_ret = 0;
39569:
39570: #if defined(LIBXML_UNICODE_ENABLED)
39571: int mem_base;
39572: int ret_val;
39573: int code; /* UCS code point */
39574: int n_code;
39575:
39576: for (n_code = 0;n_code < gen_nb_int;n_code++) {
39577: mem_base = xmlMemBlocks();
39578: code = gen_int(n_code, 0);
39579:
39580: ret_val = xmlUCSIsEnclosedCJKLettersandMonths(code);
39581: desret_int(ret_val);
39582: call_tests++;
39583: des_int(n_code, code, 0);
39584: xmlResetLastError();
39585: if (mem_base != xmlMemBlocks()) {
39586: printf("Leak of %d blocks found in xmlUCSIsEnclosedCJKLettersandMonths",
39587: xmlMemBlocks() - mem_base);
39588: test_ret++;
39589: printf(" %d", n_code);
39590: printf("\n");
39591: }
39592: }
39593: function_tests++;
39594: #endif
39595:
39596: return(test_ret);
39597: }
39598:
39599:
39600: static int
39601: test_xmlUCSIsEthiopic(void) {
39602: int test_ret = 0;
39603:
39604: #if defined(LIBXML_UNICODE_ENABLED)
39605: int mem_base;
39606: int ret_val;
39607: int code; /* UCS code point */
39608: int n_code;
39609:
39610: for (n_code = 0;n_code < gen_nb_int;n_code++) {
39611: mem_base = xmlMemBlocks();
39612: code = gen_int(n_code, 0);
39613:
39614: ret_val = xmlUCSIsEthiopic(code);
39615: desret_int(ret_val);
39616: call_tests++;
39617: des_int(n_code, code, 0);
39618: xmlResetLastError();
39619: if (mem_base != xmlMemBlocks()) {
39620: printf("Leak of %d blocks found in xmlUCSIsEthiopic",
39621: xmlMemBlocks() - mem_base);
39622: test_ret++;
39623: printf(" %d", n_code);
39624: printf("\n");
39625: }
39626: }
39627: function_tests++;
39628: #endif
39629:
39630: return(test_ret);
39631: }
39632:
39633:
39634: static int
39635: test_xmlUCSIsGeneralPunctuation(void) {
39636: int test_ret = 0;
39637:
39638: #if defined(LIBXML_UNICODE_ENABLED)
39639: int mem_base;
39640: int ret_val;
39641: int code; /* UCS code point */
39642: int n_code;
39643:
39644: for (n_code = 0;n_code < gen_nb_int;n_code++) {
39645: mem_base = xmlMemBlocks();
39646: code = gen_int(n_code, 0);
39647:
39648: ret_val = xmlUCSIsGeneralPunctuation(code);
39649: desret_int(ret_val);
39650: call_tests++;
39651: des_int(n_code, code, 0);
39652: xmlResetLastError();
39653: if (mem_base != xmlMemBlocks()) {
39654: printf("Leak of %d blocks found in xmlUCSIsGeneralPunctuation",
39655: xmlMemBlocks() - mem_base);
39656: test_ret++;
39657: printf(" %d", n_code);
39658: printf("\n");
39659: }
39660: }
39661: function_tests++;
39662: #endif
39663:
39664: return(test_ret);
39665: }
39666:
39667:
39668: static int
39669: test_xmlUCSIsGeometricShapes(void) {
39670: int test_ret = 0;
39671:
39672: #if defined(LIBXML_UNICODE_ENABLED)
39673: int mem_base;
39674: int ret_val;
39675: int code; /* UCS code point */
39676: int n_code;
39677:
39678: for (n_code = 0;n_code < gen_nb_int;n_code++) {
39679: mem_base = xmlMemBlocks();
39680: code = gen_int(n_code, 0);
39681:
39682: ret_val = xmlUCSIsGeometricShapes(code);
39683: desret_int(ret_val);
39684: call_tests++;
39685: des_int(n_code, code, 0);
39686: xmlResetLastError();
39687: if (mem_base != xmlMemBlocks()) {
39688: printf("Leak of %d blocks found in xmlUCSIsGeometricShapes",
39689: xmlMemBlocks() - mem_base);
39690: test_ret++;
39691: printf(" %d", n_code);
39692: printf("\n");
39693: }
39694: }
39695: function_tests++;
39696: #endif
39697:
39698: return(test_ret);
39699: }
39700:
39701:
39702: static int
39703: test_xmlUCSIsGeorgian(void) {
39704: int test_ret = 0;
39705:
39706: #if defined(LIBXML_UNICODE_ENABLED)
39707: int mem_base;
39708: int ret_val;
39709: int code; /* UCS code point */
39710: int n_code;
39711:
39712: for (n_code = 0;n_code < gen_nb_int;n_code++) {
39713: mem_base = xmlMemBlocks();
39714: code = gen_int(n_code, 0);
39715:
39716: ret_val = xmlUCSIsGeorgian(code);
39717: desret_int(ret_val);
39718: call_tests++;
39719: des_int(n_code, code, 0);
39720: xmlResetLastError();
39721: if (mem_base != xmlMemBlocks()) {
39722: printf("Leak of %d blocks found in xmlUCSIsGeorgian",
39723: xmlMemBlocks() - mem_base);
39724: test_ret++;
39725: printf(" %d", n_code);
39726: printf("\n");
39727: }
39728: }
39729: function_tests++;
39730: #endif
39731:
39732: return(test_ret);
39733: }
39734:
39735:
39736: static int
39737: test_xmlUCSIsGothic(void) {
39738: int test_ret = 0;
39739:
39740: #if defined(LIBXML_UNICODE_ENABLED)
39741: int mem_base;
39742: int ret_val;
39743: int code; /* UCS code point */
39744: int n_code;
39745:
39746: for (n_code = 0;n_code < gen_nb_int;n_code++) {
39747: mem_base = xmlMemBlocks();
39748: code = gen_int(n_code, 0);
39749:
39750: ret_val = xmlUCSIsGothic(code);
39751: desret_int(ret_val);
39752: call_tests++;
39753: des_int(n_code, code, 0);
39754: xmlResetLastError();
39755: if (mem_base != xmlMemBlocks()) {
39756: printf("Leak of %d blocks found in xmlUCSIsGothic",
39757: xmlMemBlocks() - mem_base);
39758: test_ret++;
39759: printf(" %d", n_code);
39760: printf("\n");
39761: }
39762: }
39763: function_tests++;
39764: #endif
39765:
39766: return(test_ret);
39767: }
39768:
39769:
39770: static int
39771: test_xmlUCSIsGreek(void) {
39772: int test_ret = 0;
39773:
39774: #if defined(LIBXML_UNICODE_ENABLED)
39775: int mem_base;
39776: int ret_val;
39777: int code; /* UCS code point */
39778: int n_code;
39779:
39780: for (n_code = 0;n_code < gen_nb_int;n_code++) {
39781: mem_base = xmlMemBlocks();
39782: code = gen_int(n_code, 0);
39783:
39784: ret_val = xmlUCSIsGreek(code);
39785: desret_int(ret_val);
39786: call_tests++;
39787: des_int(n_code, code, 0);
39788: xmlResetLastError();
39789: if (mem_base != xmlMemBlocks()) {
39790: printf("Leak of %d blocks found in xmlUCSIsGreek",
39791: xmlMemBlocks() - mem_base);
39792: test_ret++;
39793: printf(" %d", n_code);
39794: printf("\n");
39795: }
39796: }
39797: function_tests++;
39798: #endif
39799:
39800: return(test_ret);
39801: }
39802:
39803:
39804: static int
39805: test_xmlUCSIsGreekExtended(void) {
39806: int test_ret = 0;
39807:
39808: #if defined(LIBXML_UNICODE_ENABLED)
39809: int mem_base;
39810: int ret_val;
39811: int code; /* UCS code point */
39812: int n_code;
39813:
39814: for (n_code = 0;n_code < gen_nb_int;n_code++) {
39815: mem_base = xmlMemBlocks();
39816: code = gen_int(n_code, 0);
39817:
39818: ret_val = xmlUCSIsGreekExtended(code);
39819: desret_int(ret_val);
39820: call_tests++;
39821: des_int(n_code, code, 0);
39822: xmlResetLastError();
39823: if (mem_base != xmlMemBlocks()) {
39824: printf("Leak of %d blocks found in xmlUCSIsGreekExtended",
39825: xmlMemBlocks() - mem_base);
39826: test_ret++;
39827: printf(" %d", n_code);
39828: printf("\n");
39829: }
39830: }
39831: function_tests++;
39832: #endif
39833:
39834: return(test_ret);
39835: }
39836:
39837:
39838: static int
39839: test_xmlUCSIsGreekandCoptic(void) {
39840: int test_ret = 0;
39841:
39842: #if defined(LIBXML_UNICODE_ENABLED)
39843: int mem_base;
39844: int ret_val;
39845: int code; /* UCS code point */
39846: int n_code;
39847:
39848: for (n_code = 0;n_code < gen_nb_int;n_code++) {
39849: mem_base = xmlMemBlocks();
39850: code = gen_int(n_code, 0);
39851:
39852: ret_val = xmlUCSIsGreekandCoptic(code);
39853: desret_int(ret_val);
39854: call_tests++;
39855: des_int(n_code, code, 0);
39856: xmlResetLastError();
39857: if (mem_base != xmlMemBlocks()) {
39858: printf("Leak of %d blocks found in xmlUCSIsGreekandCoptic",
39859: xmlMemBlocks() - mem_base);
39860: test_ret++;
39861: printf(" %d", n_code);
39862: printf("\n");
39863: }
39864: }
39865: function_tests++;
39866: #endif
39867:
39868: return(test_ret);
39869: }
39870:
39871:
39872: static int
39873: test_xmlUCSIsGujarati(void) {
39874: int test_ret = 0;
39875:
39876: #if defined(LIBXML_UNICODE_ENABLED)
39877: int mem_base;
39878: int ret_val;
39879: int code; /* UCS code point */
39880: int n_code;
39881:
39882: for (n_code = 0;n_code < gen_nb_int;n_code++) {
39883: mem_base = xmlMemBlocks();
39884: code = gen_int(n_code, 0);
39885:
39886: ret_val = xmlUCSIsGujarati(code);
39887: desret_int(ret_val);
39888: call_tests++;
39889: des_int(n_code, code, 0);
39890: xmlResetLastError();
39891: if (mem_base != xmlMemBlocks()) {
39892: printf("Leak of %d blocks found in xmlUCSIsGujarati",
39893: xmlMemBlocks() - mem_base);
39894: test_ret++;
39895: printf(" %d", n_code);
39896: printf("\n");
39897: }
39898: }
39899: function_tests++;
39900: #endif
39901:
39902: return(test_ret);
39903: }
39904:
39905:
39906: static int
39907: test_xmlUCSIsGurmukhi(void) {
39908: int test_ret = 0;
39909:
39910: #if defined(LIBXML_UNICODE_ENABLED)
39911: int mem_base;
39912: int ret_val;
39913: int code; /* UCS code point */
39914: int n_code;
39915:
39916: for (n_code = 0;n_code < gen_nb_int;n_code++) {
39917: mem_base = xmlMemBlocks();
39918: code = gen_int(n_code, 0);
39919:
39920: ret_val = xmlUCSIsGurmukhi(code);
39921: desret_int(ret_val);
39922: call_tests++;
39923: des_int(n_code, code, 0);
39924: xmlResetLastError();
39925: if (mem_base != xmlMemBlocks()) {
39926: printf("Leak of %d blocks found in xmlUCSIsGurmukhi",
39927: xmlMemBlocks() - mem_base);
39928: test_ret++;
39929: printf(" %d", n_code);
39930: printf("\n");
39931: }
39932: }
39933: function_tests++;
39934: #endif
39935:
39936: return(test_ret);
39937: }
39938:
39939:
39940: static int
39941: test_xmlUCSIsHalfwidthandFullwidthForms(void) {
39942: int test_ret = 0;
39943:
39944: #if defined(LIBXML_UNICODE_ENABLED)
39945: int mem_base;
39946: int ret_val;
39947: int code; /* UCS code point */
39948: int n_code;
39949:
39950: for (n_code = 0;n_code < gen_nb_int;n_code++) {
39951: mem_base = xmlMemBlocks();
39952: code = gen_int(n_code, 0);
39953:
39954: ret_val = xmlUCSIsHalfwidthandFullwidthForms(code);
39955: desret_int(ret_val);
39956: call_tests++;
39957: des_int(n_code, code, 0);
39958: xmlResetLastError();
39959: if (mem_base != xmlMemBlocks()) {
39960: printf("Leak of %d blocks found in xmlUCSIsHalfwidthandFullwidthForms",
39961: xmlMemBlocks() - mem_base);
39962: test_ret++;
39963: printf(" %d", n_code);
39964: printf("\n");
39965: }
39966: }
39967: function_tests++;
39968: #endif
39969:
39970: return(test_ret);
39971: }
39972:
39973:
39974: static int
39975: test_xmlUCSIsHangulCompatibilityJamo(void) {
39976: int test_ret = 0;
39977:
39978: #if defined(LIBXML_UNICODE_ENABLED)
39979: int mem_base;
39980: int ret_val;
39981: int code; /* UCS code point */
39982: int n_code;
39983:
39984: for (n_code = 0;n_code < gen_nb_int;n_code++) {
39985: mem_base = xmlMemBlocks();
39986: code = gen_int(n_code, 0);
39987:
39988: ret_val = xmlUCSIsHangulCompatibilityJamo(code);
39989: desret_int(ret_val);
39990: call_tests++;
39991: des_int(n_code, code, 0);
39992: xmlResetLastError();
39993: if (mem_base != xmlMemBlocks()) {
39994: printf("Leak of %d blocks found in xmlUCSIsHangulCompatibilityJamo",
39995: xmlMemBlocks() - mem_base);
39996: test_ret++;
39997: printf(" %d", n_code);
39998: printf("\n");
39999: }
40000: }
40001: function_tests++;
40002: #endif
40003:
40004: return(test_ret);
40005: }
40006:
40007:
40008: static int
40009: test_xmlUCSIsHangulJamo(void) {
40010: int test_ret = 0;
40011:
40012: #if defined(LIBXML_UNICODE_ENABLED)
40013: int mem_base;
40014: int ret_val;
40015: int code; /* UCS code point */
40016: int n_code;
40017:
40018: for (n_code = 0;n_code < gen_nb_int;n_code++) {
40019: mem_base = xmlMemBlocks();
40020: code = gen_int(n_code, 0);
40021:
40022: ret_val = xmlUCSIsHangulJamo(code);
40023: desret_int(ret_val);
40024: call_tests++;
40025: des_int(n_code, code, 0);
40026: xmlResetLastError();
40027: if (mem_base != xmlMemBlocks()) {
40028: printf("Leak of %d blocks found in xmlUCSIsHangulJamo",
40029: xmlMemBlocks() - mem_base);
40030: test_ret++;
40031: printf(" %d", n_code);
40032: printf("\n");
40033: }
40034: }
40035: function_tests++;
40036: #endif
40037:
40038: return(test_ret);
40039: }
40040:
40041:
40042: static int
40043: test_xmlUCSIsHangulSyllables(void) {
40044: int test_ret = 0;
40045:
40046: #if defined(LIBXML_UNICODE_ENABLED)
40047: int mem_base;
40048: int ret_val;
40049: int code; /* UCS code point */
40050: int n_code;
40051:
40052: for (n_code = 0;n_code < gen_nb_int;n_code++) {
40053: mem_base = xmlMemBlocks();
40054: code = gen_int(n_code, 0);
40055:
40056: ret_val = xmlUCSIsHangulSyllables(code);
40057: desret_int(ret_val);
40058: call_tests++;
40059: des_int(n_code, code, 0);
40060: xmlResetLastError();
40061: if (mem_base != xmlMemBlocks()) {
40062: printf("Leak of %d blocks found in xmlUCSIsHangulSyllables",
40063: xmlMemBlocks() - mem_base);
40064: test_ret++;
40065: printf(" %d", n_code);
40066: printf("\n");
40067: }
40068: }
40069: function_tests++;
40070: #endif
40071:
40072: return(test_ret);
40073: }
40074:
40075:
40076: static int
40077: test_xmlUCSIsHanunoo(void) {
40078: int test_ret = 0;
40079:
40080: #if defined(LIBXML_UNICODE_ENABLED)
40081: int mem_base;
40082: int ret_val;
40083: int code; /* UCS code point */
40084: int n_code;
40085:
40086: for (n_code = 0;n_code < gen_nb_int;n_code++) {
40087: mem_base = xmlMemBlocks();
40088: code = gen_int(n_code, 0);
40089:
40090: ret_val = xmlUCSIsHanunoo(code);
40091: desret_int(ret_val);
40092: call_tests++;
40093: des_int(n_code, code, 0);
40094: xmlResetLastError();
40095: if (mem_base != xmlMemBlocks()) {
40096: printf("Leak of %d blocks found in xmlUCSIsHanunoo",
40097: xmlMemBlocks() - mem_base);
40098: test_ret++;
40099: printf(" %d", n_code);
40100: printf("\n");
40101: }
40102: }
40103: function_tests++;
40104: #endif
40105:
40106: return(test_ret);
40107: }
40108:
40109:
40110: static int
40111: test_xmlUCSIsHebrew(void) {
40112: int test_ret = 0;
40113:
40114: #if defined(LIBXML_UNICODE_ENABLED)
40115: int mem_base;
40116: int ret_val;
40117: int code; /* UCS code point */
40118: int n_code;
40119:
40120: for (n_code = 0;n_code < gen_nb_int;n_code++) {
40121: mem_base = xmlMemBlocks();
40122: code = gen_int(n_code, 0);
40123:
40124: ret_val = xmlUCSIsHebrew(code);
40125: desret_int(ret_val);
40126: call_tests++;
40127: des_int(n_code, code, 0);
40128: xmlResetLastError();
40129: if (mem_base != xmlMemBlocks()) {
40130: printf("Leak of %d blocks found in xmlUCSIsHebrew",
40131: xmlMemBlocks() - mem_base);
40132: test_ret++;
40133: printf(" %d", n_code);
40134: printf("\n");
40135: }
40136: }
40137: function_tests++;
40138: #endif
40139:
40140: return(test_ret);
40141: }
40142:
40143:
40144: static int
40145: test_xmlUCSIsHighPrivateUseSurrogates(void) {
40146: int test_ret = 0;
40147:
40148: #if defined(LIBXML_UNICODE_ENABLED)
40149: int mem_base;
40150: int ret_val;
40151: int code; /* UCS code point */
40152: int n_code;
40153:
40154: for (n_code = 0;n_code < gen_nb_int;n_code++) {
40155: mem_base = xmlMemBlocks();
40156: code = gen_int(n_code, 0);
40157:
40158: ret_val = xmlUCSIsHighPrivateUseSurrogates(code);
40159: desret_int(ret_val);
40160: call_tests++;
40161: des_int(n_code, code, 0);
40162: xmlResetLastError();
40163: if (mem_base != xmlMemBlocks()) {
40164: printf("Leak of %d blocks found in xmlUCSIsHighPrivateUseSurrogates",
40165: xmlMemBlocks() - mem_base);
40166: test_ret++;
40167: printf(" %d", n_code);
40168: printf("\n");
40169: }
40170: }
40171: function_tests++;
40172: #endif
40173:
40174: return(test_ret);
40175: }
40176:
40177:
40178: static int
40179: test_xmlUCSIsHighSurrogates(void) {
40180: int test_ret = 0;
40181:
40182: #if defined(LIBXML_UNICODE_ENABLED)
40183: int mem_base;
40184: int ret_val;
40185: int code; /* UCS code point */
40186: int n_code;
40187:
40188: for (n_code = 0;n_code < gen_nb_int;n_code++) {
40189: mem_base = xmlMemBlocks();
40190: code = gen_int(n_code, 0);
40191:
40192: ret_val = xmlUCSIsHighSurrogates(code);
40193: desret_int(ret_val);
40194: call_tests++;
40195: des_int(n_code, code, 0);
40196: xmlResetLastError();
40197: if (mem_base != xmlMemBlocks()) {
40198: printf("Leak of %d blocks found in xmlUCSIsHighSurrogates",
40199: xmlMemBlocks() - mem_base);
40200: test_ret++;
40201: printf(" %d", n_code);
40202: printf("\n");
40203: }
40204: }
40205: function_tests++;
40206: #endif
40207:
40208: return(test_ret);
40209: }
40210:
40211:
40212: static int
40213: test_xmlUCSIsHiragana(void) {
40214: int test_ret = 0;
40215:
40216: #if defined(LIBXML_UNICODE_ENABLED)
40217: int mem_base;
40218: int ret_val;
40219: int code; /* UCS code point */
40220: int n_code;
40221:
40222: for (n_code = 0;n_code < gen_nb_int;n_code++) {
40223: mem_base = xmlMemBlocks();
40224: code = gen_int(n_code, 0);
40225:
40226: ret_val = xmlUCSIsHiragana(code);
40227: desret_int(ret_val);
40228: call_tests++;
40229: des_int(n_code, code, 0);
40230: xmlResetLastError();
40231: if (mem_base != xmlMemBlocks()) {
40232: printf("Leak of %d blocks found in xmlUCSIsHiragana",
40233: xmlMemBlocks() - mem_base);
40234: test_ret++;
40235: printf(" %d", n_code);
40236: printf("\n");
40237: }
40238: }
40239: function_tests++;
40240: #endif
40241:
40242: return(test_ret);
40243: }
40244:
40245:
40246: static int
40247: test_xmlUCSIsIPAExtensions(void) {
40248: int test_ret = 0;
40249:
40250: #if defined(LIBXML_UNICODE_ENABLED)
40251: int mem_base;
40252: int ret_val;
40253: int code; /* UCS code point */
40254: int n_code;
40255:
40256: for (n_code = 0;n_code < gen_nb_int;n_code++) {
40257: mem_base = xmlMemBlocks();
40258: code = gen_int(n_code, 0);
40259:
40260: ret_val = xmlUCSIsIPAExtensions(code);
40261: desret_int(ret_val);
40262: call_tests++;
40263: des_int(n_code, code, 0);
40264: xmlResetLastError();
40265: if (mem_base != xmlMemBlocks()) {
40266: printf("Leak of %d blocks found in xmlUCSIsIPAExtensions",
40267: xmlMemBlocks() - mem_base);
40268: test_ret++;
40269: printf(" %d", n_code);
40270: printf("\n");
40271: }
40272: }
40273: function_tests++;
40274: #endif
40275:
40276: return(test_ret);
40277: }
40278:
40279:
40280: static int
40281: test_xmlUCSIsIdeographicDescriptionCharacters(void) {
40282: int test_ret = 0;
40283:
40284: #if defined(LIBXML_UNICODE_ENABLED)
40285: int mem_base;
40286: int ret_val;
40287: int code; /* UCS code point */
40288: int n_code;
40289:
40290: for (n_code = 0;n_code < gen_nb_int;n_code++) {
40291: mem_base = xmlMemBlocks();
40292: code = gen_int(n_code, 0);
40293:
40294: ret_val = xmlUCSIsIdeographicDescriptionCharacters(code);
40295: desret_int(ret_val);
40296: call_tests++;
40297: des_int(n_code, code, 0);
40298: xmlResetLastError();
40299: if (mem_base != xmlMemBlocks()) {
40300: printf("Leak of %d blocks found in xmlUCSIsIdeographicDescriptionCharacters",
40301: xmlMemBlocks() - mem_base);
40302: test_ret++;
40303: printf(" %d", n_code);
40304: printf("\n");
40305: }
40306: }
40307: function_tests++;
40308: #endif
40309:
40310: return(test_ret);
40311: }
40312:
40313:
40314: static int
40315: test_xmlUCSIsKanbun(void) {
40316: int test_ret = 0;
40317:
40318: #if defined(LIBXML_UNICODE_ENABLED)
40319: int mem_base;
40320: int ret_val;
40321: int code; /* UCS code point */
40322: int n_code;
40323:
40324: for (n_code = 0;n_code < gen_nb_int;n_code++) {
40325: mem_base = xmlMemBlocks();
40326: code = gen_int(n_code, 0);
40327:
40328: ret_val = xmlUCSIsKanbun(code);
40329: desret_int(ret_val);
40330: call_tests++;
40331: des_int(n_code, code, 0);
40332: xmlResetLastError();
40333: if (mem_base != xmlMemBlocks()) {
40334: printf("Leak of %d blocks found in xmlUCSIsKanbun",
40335: xmlMemBlocks() - mem_base);
40336: test_ret++;
40337: printf(" %d", n_code);
40338: printf("\n");
40339: }
40340: }
40341: function_tests++;
40342: #endif
40343:
40344: return(test_ret);
40345: }
40346:
40347:
40348: static int
40349: test_xmlUCSIsKangxiRadicals(void) {
40350: int test_ret = 0;
40351:
40352: #if defined(LIBXML_UNICODE_ENABLED)
40353: int mem_base;
40354: int ret_val;
40355: int code; /* UCS code point */
40356: int n_code;
40357:
40358: for (n_code = 0;n_code < gen_nb_int;n_code++) {
40359: mem_base = xmlMemBlocks();
40360: code = gen_int(n_code, 0);
40361:
40362: ret_val = xmlUCSIsKangxiRadicals(code);
40363: desret_int(ret_val);
40364: call_tests++;
40365: des_int(n_code, code, 0);
40366: xmlResetLastError();
40367: if (mem_base != xmlMemBlocks()) {
40368: printf("Leak of %d blocks found in xmlUCSIsKangxiRadicals",
40369: xmlMemBlocks() - mem_base);
40370: test_ret++;
40371: printf(" %d", n_code);
40372: printf("\n");
40373: }
40374: }
40375: function_tests++;
40376: #endif
40377:
40378: return(test_ret);
40379: }
40380:
40381:
40382: static int
40383: test_xmlUCSIsKannada(void) {
40384: int test_ret = 0;
40385:
40386: #if defined(LIBXML_UNICODE_ENABLED)
40387: int mem_base;
40388: int ret_val;
40389: int code; /* UCS code point */
40390: int n_code;
40391:
40392: for (n_code = 0;n_code < gen_nb_int;n_code++) {
40393: mem_base = xmlMemBlocks();
40394: code = gen_int(n_code, 0);
40395:
40396: ret_val = xmlUCSIsKannada(code);
40397: desret_int(ret_val);
40398: call_tests++;
40399: des_int(n_code, code, 0);
40400: xmlResetLastError();
40401: if (mem_base != xmlMemBlocks()) {
40402: printf("Leak of %d blocks found in xmlUCSIsKannada",
40403: xmlMemBlocks() - mem_base);
40404: test_ret++;
40405: printf(" %d", n_code);
40406: printf("\n");
40407: }
40408: }
40409: function_tests++;
40410: #endif
40411:
40412: return(test_ret);
40413: }
40414:
40415:
40416: static int
40417: test_xmlUCSIsKatakana(void) {
40418: int test_ret = 0;
40419:
40420: #if defined(LIBXML_UNICODE_ENABLED)
40421: int mem_base;
40422: int ret_val;
40423: int code; /* UCS code point */
40424: int n_code;
40425:
40426: for (n_code = 0;n_code < gen_nb_int;n_code++) {
40427: mem_base = xmlMemBlocks();
40428: code = gen_int(n_code, 0);
40429:
40430: ret_val = xmlUCSIsKatakana(code);
40431: desret_int(ret_val);
40432: call_tests++;
40433: des_int(n_code, code, 0);
40434: xmlResetLastError();
40435: if (mem_base != xmlMemBlocks()) {
40436: printf("Leak of %d blocks found in xmlUCSIsKatakana",
40437: xmlMemBlocks() - mem_base);
40438: test_ret++;
40439: printf(" %d", n_code);
40440: printf("\n");
40441: }
40442: }
40443: function_tests++;
40444: #endif
40445:
40446: return(test_ret);
40447: }
40448:
40449:
40450: static int
40451: test_xmlUCSIsKatakanaPhoneticExtensions(void) {
40452: int test_ret = 0;
40453:
40454: #if defined(LIBXML_UNICODE_ENABLED)
40455: int mem_base;
40456: int ret_val;
40457: int code; /* UCS code point */
40458: int n_code;
40459:
40460: for (n_code = 0;n_code < gen_nb_int;n_code++) {
40461: mem_base = xmlMemBlocks();
40462: code = gen_int(n_code, 0);
40463:
40464: ret_val = xmlUCSIsKatakanaPhoneticExtensions(code);
40465: desret_int(ret_val);
40466: call_tests++;
40467: des_int(n_code, code, 0);
40468: xmlResetLastError();
40469: if (mem_base != xmlMemBlocks()) {
40470: printf("Leak of %d blocks found in xmlUCSIsKatakanaPhoneticExtensions",
40471: xmlMemBlocks() - mem_base);
40472: test_ret++;
40473: printf(" %d", n_code);
40474: printf("\n");
40475: }
40476: }
40477: function_tests++;
40478: #endif
40479:
40480: return(test_ret);
40481: }
40482:
40483:
40484: static int
40485: test_xmlUCSIsKhmer(void) {
40486: int test_ret = 0;
40487:
40488: #if defined(LIBXML_UNICODE_ENABLED)
40489: int mem_base;
40490: int ret_val;
40491: int code; /* UCS code point */
40492: int n_code;
40493:
40494: for (n_code = 0;n_code < gen_nb_int;n_code++) {
40495: mem_base = xmlMemBlocks();
40496: code = gen_int(n_code, 0);
40497:
40498: ret_val = xmlUCSIsKhmer(code);
40499: desret_int(ret_val);
40500: call_tests++;
40501: des_int(n_code, code, 0);
40502: xmlResetLastError();
40503: if (mem_base != xmlMemBlocks()) {
40504: printf("Leak of %d blocks found in xmlUCSIsKhmer",
40505: xmlMemBlocks() - mem_base);
40506: test_ret++;
40507: printf(" %d", n_code);
40508: printf("\n");
40509: }
40510: }
40511: function_tests++;
40512: #endif
40513:
40514: return(test_ret);
40515: }
40516:
40517:
40518: static int
40519: test_xmlUCSIsKhmerSymbols(void) {
40520: int test_ret = 0;
40521:
40522: #if defined(LIBXML_UNICODE_ENABLED)
40523: int mem_base;
40524: int ret_val;
40525: int code; /* UCS code point */
40526: int n_code;
40527:
40528: for (n_code = 0;n_code < gen_nb_int;n_code++) {
40529: mem_base = xmlMemBlocks();
40530: code = gen_int(n_code, 0);
40531:
40532: ret_val = xmlUCSIsKhmerSymbols(code);
40533: desret_int(ret_val);
40534: call_tests++;
40535: des_int(n_code, code, 0);
40536: xmlResetLastError();
40537: if (mem_base != xmlMemBlocks()) {
40538: printf("Leak of %d blocks found in xmlUCSIsKhmerSymbols",
40539: xmlMemBlocks() - mem_base);
40540: test_ret++;
40541: printf(" %d", n_code);
40542: printf("\n");
40543: }
40544: }
40545: function_tests++;
40546: #endif
40547:
40548: return(test_ret);
40549: }
40550:
40551:
40552: static int
40553: test_xmlUCSIsLao(void) {
40554: int test_ret = 0;
40555:
40556: #if defined(LIBXML_UNICODE_ENABLED)
40557: int mem_base;
40558: int ret_val;
40559: int code; /* UCS code point */
40560: int n_code;
40561:
40562: for (n_code = 0;n_code < gen_nb_int;n_code++) {
40563: mem_base = xmlMemBlocks();
40564: code = gen_int(n_code, 0);
40565:
40566: ret_val = xmlUCSIsLao(code);
40567: desret_int(ret_val);
40568: call_tests++;
40569: des_int(n_code, code, 0);
40570: xmlResetLastError();
40571: if (mem_base != xmlMemBlocks()) {
40572: printf("Leak of %d blocks found in xmlUCSIsLao",
40573: xmlMemBlocks() - mem_base);
40574: test_ret++;
40575: printf(" %d", n_code);
40576: printf("\n");
40577: }
40578: }
40579: function_tests++;
40580: #endif
40581:
40582: return(test_ret);
40583: }
40584:
40585:
40586: static int
40587: test_xmlUCSIsLatin1Supplement(void) {
40588: int test_ret = 0;
40589:
40590: #if defined(LIBXML_UNICODE_ENABLED)
40591: int mem_base;
40592: int ret_val;
40593: int code; /* UCS code point */
40594: int n_code;
40595:
40596: for (n_code = 0;n_code < gen_nb_int;n_code++) {
40597: mem_base = xmlMemBlocks();
40598: code = gen_int(n_code, 0);
40599:
40600: ret_val = xmlUCSIsLatin1Supplement(code);
40601: desret_int(ret_val);
40602: call_tests++;
40603: des_int(n_code, code, 0);
40604: xmlResetLastError();
40605: if (mem_base != xmlMemBlocks()) {
40606: printf("Leak of %d blocks found in xmlUCSIsLatin1Supplement",
40607: xmlMemBlocks() - mem_base);
40608: test_ret++;
40609: printf(" %d", n_code);
40610: printf("\n");
40611: }
40612: }
40613: function_tests++;
40614: #endif
40615:
40616: return(test_ret);
40617: }
40618:
40619:
40620: static int
40621: test_xmlUCSIsLatinExtendedA(void) {
40622: int test_ret = 0;
40623:
40624: #if defined(LIBXML_UNICODE_ENABLED)
40625: int mem_base;
40626: int ret_val;
40627: int code; /* UCS code point */
40628: int n_code;
40629:
40630: for (n_code = 0;n_code < gen_nb_int;n_code++) {
40631: mem_base = xmlMemBlocks();
40632: code = gen_int(n_code, 0);
40633:
40634: ret_val = xmlUCSIsLatinExtendedA(code);
40635: desret_int(ret_val);
40636: call_tests++;
40637: des_int(n_code, code, 0);
40638: xmlResetLastError();
40639: if (mem_base != xmlMemBlocks()) {
40640: printf("Leak of %d blocks found in xmlUCSIsLatinExtendedA",
40641: xmlMemBlocks() - mem_base);
40642: test_ret++;
40643: printf(" %d", n_code);
40644: printf("\n");
40645: }
40646: }
40647: function_tests++;
40648: #endif
40649:
40650: return(test_ret);
40651: }
40652:
40653:
40654: static int
40655: test_xmlUCSIsLatinExtendedAdditional(void) {
40656: int test_ret = 0;
40657:
40658: #if defined(LIBXML_UNICODE_ENABLED)
40659: int mem_base;
40660: int ret_val;
40661: int code; /* UCS code point */
40662: int n_code;
40663:
40664: for (n_code = 0;n_code < gen_nb_int;n_code++) {
40665: mem_base = xmlMemBlocks();
40666: code = gen_int(n_code, 0);
40667:
40668: ret_val = xmlUCSIsLatinExtendedAdditional(code);
40669: desret_int(ret_val);
40670: call_tests++;
40671: des_int(n_code, code, 0);
40672: xmlResetLastError();
40673: if (mem_base != xmlMemBlocks()) {
40674: printf("Leak of %d blocks found in xmlUCSIsLatinExtendedAdditional",
40675: xmlMemBlocks() - mem_base);
40676: test_ret++;
40677: printf(" %d", n_code);
40678: printf("\n");
40679: }
40680: }
40681: function_tests++;
40682: #endif
40683:
40684: return(test_ret);
40685: }
40686:
40687:
40688: static int
40689: test_xmlUCSIsLatinExtendedB(void) {
40690: int test_ret = 0;
40691:
40692: #if defined(LIBXML_UNICODE_ENABLED)
40693: int mem_base;
40694: int ret_val;
40695: int code; /* UCS code point */
40696: int n_code;
40697:
40698: for (n_code = 0;n_code < gen_nb_int;n_code++) {
40699: mem_base = xmlMemBlocks();
40700: code = gen_int(n_code, 0);
40701:
40702: ret_val = xmlUCSIsLatinExtendedB(code);
40703: desret_int(ret_val);
40704: call_tests++;
40705: des_int(n_code, code, 0);
40706: xmlResetLastError();
40707: if (mem_base != xmlMemBlocks()) {
40708: printf("Leak of %d blocks found in xmlUCSIsLatinExtendedB",
40709: xmlMemBlocks() - mem_base);
40710: test_ret++;
40711: printf(" %d", n_code);
40712: printf("\n");
40713: }
40714: }
40715: function_tests++;
40716: #endif
40717:
40718: return(test_ret);
40719: }
40720:
40721:
40722: static int
40723: test_xmlUCSIsLetterlikeSymbols(void) {
40724: int test_ret = 0;
40725:
40726: #if defined(LIBXML_UNICODE_ENABLED)
40727: int mem_base;
40728: int ret_val;
40729: int code; /* UCS code point */
40730: int n_code;
40731:
40732: for (n_code = 0;n_code < gen_nb_int;n_code++) {
40733: mem_base = xmlMemBlocks();
40734: code = gen_int(n_code, 0);
40735:
40736: ret_val = xmlUCSIsLetterlikeSymbols(code);
40737: desret_int(ret_val);
40738: call_tests++;
40739: des_int(n_code, code, 0);
40740: xmlResetLastError();
40741: if (mem_base != xmlMemBlocks()) {
40742: printf("Leak of %d blocks found in xmlUCSIsLetterlikeSymbols",
40743: xmlMemBlocks() - mem_base);
40744: test_ret++;
40745: printf(" %d", n_code);
40746: printf("\n");
40747: }
40748: }
40749: function_tests++;
40750: #endif
40751:
40752: return(test_ret);
40753: }
40754:
40755:
40756: static int
40757: test_xmlUCSIsLimbu(void) {
40758: int test_ret = 0;
40759:
40760: #if defined(LIBXML_UNICODE_ENABLED)
40761: int mem_base;
40762: int ret_val;
40763: int code; /* UCS code point */
40764: int n_code;
40765:
40766: for (n_code = 0;n_code < gen_nb_int;n_code++) {
40767: mem_base = xmlMemBlocks();
40768: code = gen_int(n_code, 0);
40769:
40770: ret_val = xmlUCSIsLimbu(code);
40771: desret_int(ret_val);
40772: call_tests++;
40773: des_int(n_code, code, 0);
40774: xmlResetLastError();
40775: if (mem_base != xmlMemBlocks()) {
40776: printf("Leak of %d blocks found in xmlUCSIsLimbu",
40777: xmlMemBlocks() - mem_base);
40778: test_ret++;
40779: printf(" %d", n_code);
40780: printf("\n");
40781: }
40782: }
40783: function_tests++;
40784: #endif
40785:
40786: return(test_ret);
40787: }
40788:
40789:
40790: static int
40791: test_xmlUCSIsLinearBIdeograms(void) {
40792: int test_ret = 0;
40793:
40794: #if defined(LIBXML_UNICODE_ENABLED)
40795: int mem_base;
40796: int ret_val;
40797: int code; /* UCS code point */
40798: int n_code;
40799:
40800: for (n_code = 0;n_code < gen_nb_int;n_code++) {
40801: mem_base = xmlMemBlocks();
40802: code = gen_int(n_code, 0);
40803:
40804: ret_val = xmlUCSIsLinearBIdeograms(code);
40805: desret_int(ret_val);
40806: call_tests++;
40807: des_int(n_code, code, 0);
40808: xmlResetLastError();
40809: if (mem_base != xmlMemBlocks()) {
40810: printf("Leak of %d blocks found in xmlUCSIsLinearBIdeograms",
40811: xmlMemBlocks() - mem_base);
40812: test_ret++;
40813: printf(" %d", n_code);
40814: printf("\n");
40815: }
40816: }
40817: function_tests++;
40818: #endif
40819:
40820: return(test_ret);
40821: }
40822:
40823:
40824: static int
40825: test_xmlUCSIsLinearBSyllabary(void) {
40826: int test_ret = 0;
40827:
40828: #if defined(LIBXML_UNICODE_ENABLED)
40829: int mem_base;
40830: int ret_val;
40831: int code; /* UCS code point */
40832: int n_code;
40833:
40834: for (n_code = 0;n_code < gen_nb_int;n_code++) {
40835: mem_base = xmlMemBlocks();
40836: code = gen_int(n_code, 0);
40837:
40838: ret_val = xmlUCSIsLinearBSyllabary(code);
40839: desret_int(ret_val);
40840: call_tests++;
40841: des_int(n_code, code, 0);
40842: xmlResetLastError();
40843: if (mem_base != xmlMemBlocks()) {
40844: printf("Leak of %d blocks found in xmlUCSIsLinearBSyllabary",
40845: xmlMemBlocks() - mem_base);
40846: test_ret++;
40847: printf(" %d", n_code);
40848: printf("\n");
40849: }
40850: }
40851: function_tests++;
40852: #endif
40853:
40854: return(test_ret);
40855: }
40856:
40857:
40858: static int
40859: test_xmlUCSIsLowSurrogates(void) {
40860: int test_ret = 0;
40861:
40862: #if defined(LIBXML_UNICODE_ENABLED)
40863: int mem_base;
40864: int ret_val;
40865: int code; /* UCS code point */
40866: int n_code;
40867:
40868: for (n_code = 0;n_code < gen_nb_int;n_code++) {
40869: mem_base = xmlMemBlocks();
40870: code = gen_int(n_code, 0);
40871:
40872: ret_val = xmlUCSIsLowSurrogates(code);
40873: desret_int(ret_val);
40874: call_tests++;
40875: des_int(n_code, code, 0);
40876: xmlResetLastError();
40877: if (mem_base != xmlMemBlocks()) {
40878: printf("Leak of %d blocks found in xmlUCSIsLowSurrogates",
40879: xmlMemBlocks() - mem_base);
40880: test_ret++;
40881: printf(" %d", n_code);
40882: printf("\n");
40883: }
40884: }
40885: function_tests++;
40886: #endif
40887:
40888: return(test_ret);
40889: }
40890:
40891:
40892: static int
40893: test_xmlUCSIsMalayalam(void) {
40894: int test_ret = 0;
40895:
40896: #if defined(LIBXML_UNICODE_ENABLED)
40897: int mem_base;
40898: int ret_val;
40899: int code; /* UCS code point */
40900: int n_code;
40901:
40902: for (n_code = 0;n_code < gen_nb_int;n_code++) {
40903: mem_base = xmlMemBlocks();
40904: code = gen_int(n_code, 0);
40905:
40906: ret_val = xmlUCSIsMalayalam(code);
40907: desret_int(ret_val);
40908: call_tests++;
40909: des_int(n_code, code, 0);
40910: xmlResetLastError();
40911: if (mem_base != xmlMemBlocks()) {
40912: printf("Leak of %d blocks found in xmlUCSIsMalayalam",
40913: xmlMemBlocks() - mem_base);
40914: test_ret++;
40915: printf(" %d", n_code);
40916: printf("\n");
40917: }
40918: }
40919: function_tests++;
40920: #endif
40921:
40922: return(test_ret);
40923: }
40924:
40925:
40926: static int
40927: test_xmlUCSIsMathematicalAlphanumericSymbols(void) {
40928: int test_ret = 0;
40929:
40930: #if defined(LIBXML_UNICODE_ENABLED)
40931: int mem_base;
40932: int ret_val;
40933: int code; /* UCS code point */
40934: int n_code;
40935:
40936: for (n_code = 0;n_code < gen_nb_int;n_code++) {
40937: mem_base = xmlMemBlocks();
40938: code = gen_int(n_code, 0);
40939:
40940: ret_val = xmlUCSIsMathematicalAlphanumericSymbols(code);
40941: desret_int(ret_val);
40942: call_tests++;
40943: des_int(n_code, code, 0);
40944: xmlResetLastError();
40945: if (mem_base != xmlMemBlocks()) {
40946: printf("Leak of %d blocks found in xmlUCSIsMathematicalAlphanumericSymbols",
40947: xmlMemBlocks() - mem_base);
40948: test_ret++;
40949: printf(" %d", n_code);
40950: printf("\n");
40951: }
40952: }
40953: function_tests++;
40954: #endif
40955:
40956: return(test_ret);
40957: }
40958:
40959:
40960: static int
40961: test_xmlUCSIsMathematicalOperators(void) {
40962: int test_ret = 0;
40963:
40964: #if defined(LIBXML_UNICODE_ENABLED)
40965: int mem_base;
40966: int ret_val;
40967: int code; /* UCS code point */
40968: int n_code;
40969:
40970: for (n_code = 0;n_code < gen_nb_int;n_code++) {
40971: mem_base = xmlMemBlocks();
40972: code = gen_int(n_code, 0);
40973:
40974: ret_val = xmlUCSIsMathematicalOperators(code);
40975: desret_int(ret_val);
40976: call_tests++;
40977: des_int(n_code, code, 0);
40978: xmlResetLastError();
40979: if (mem_base != xmlMemBlocks()) {
40980: printf("Leak of %d blocks found in xmlUCSIsMathematicalOperators",
40981: xmlMemBlocks() - mem_base);
40982: test_ret++;
40983: printf(" %d", n_code);
40984: printf("\n");
40985: }
40986: }
40987: function_tests++;
40988: #endif
40989:
40990: return(test_ret);
40991: }
40992:
40993:
40994: static int
40995: test_xmlUCSIsMiscellaneousMathematicalSymbolsA(void) {
40996: int test_ret = 0;
40997:
40998: #if defined(LIBXML_UNICODE_ENABLED)
40999: int mem_base;
41000: int ret_val;
41001: int code; /* UCS code point */
41002: int n_code;
41003:
41004: for (n_code = 0;n_code < gen_nb_int;n_code++) {
41005: mem_base = xmlMemBlocks();
41006: code = gen_int(n_code, 0);
41007:
41008: ret_val = xmlUCSIsMiscellaneousMathematicalSymbolsA(code);
41009: desret_int(ret_val);
41010: call_tests++;
41011: des_int(n_code, code, 0);
41012: xmlResetLastError();
41013: if (mem_base != xmlMemBlocks()) {
41014: printf("Leak of %d blocks found in xmlUCSIsMiscellaneousMathematicalSymbolsA",
41015: xmlMemBlocks() - mem_base);
41016: test_ret++;
41017: printf(" %d", n_code);
41018: printf("\n");
41019: }
41020: }
41021: function_tests++;
41022: #endif
41023:
41024: return(test_ret);
41025: }
41026:
41027:
41028: static int
41029: test_xmlUCSIsMiscellaneousMathematicalSymbolsB(void) {
41030: int test_ret = 0;
41031:
41032: #if defined(LIBXML_UNICODE_ENABLED)
41033: int mem_base;
41034: int ret_val;
41035: int code; /* UCS code point */
41036: int n_code;
41037:
41038: for (n_code = 0;n_code < gen_nb_int;n_code++) {
41039: mem_base = xmlMemBlocks();
41040: code = gen_int(n_code, 0);
41041:
41042: ret_val = xmlUCSIsMiscellaneousMathematicalSymbolsB(code);
41043: desret_int(ret_val);
41044: call_tests++;
41045: des_int(n_code, code, 0);
41046: xmlResetLastError();
41047: if (mem_base != xmlMemBlocks()) {
41048: printf("Leak of %d blocks found in xmlUCSIsMiscellaneousMathematicalSymbolsB",
41049: xmlMemBlocks() - mem_base);
41050: test_ret++;
41051: printf(" %d", n_code);
41052: printf("\n");
41053: }
41054: }
41055: function_tests++;
41056: #endif
41057:
41058: return(test_ret);
41059: }
41060:
41061:
41062: static int
41063: test_xmlUCSIsMiscellaneousSymbols(void) {
41064: int test_ret = 0;
41065:
41066: #if defined(LIBXML_UNICODE_ENABLED)
41067: int mem_base;
41068: int ret_val;
41069: int code; /* UCS code point */
41070: int n_code;
41071:
41072: for (n_code = 0;n_code < gen_nb_int;n_code++) {
41073: mem_base = xmlMemBlocks();
41074: code = gen_int(n_code, 0);
41075:
41076: ret_val = xmlUCSIsMiscellaneousSymbols(code);
41077: desret_int(ret_val);
41078: call_tests++;
41079: des_int(n_code, code, 0);
41080: xmlResetLastError();
41081: if (mem_base != xmlMemBlocks()) {
41082: printf("Leak of %d blocks found in xmlUCSIsMiscellaneousSymbols",
41083: xmlMemBlocks() - mem_base);
41084: test_ret++;
41085: printf(" %d", n_code);
41086: printf("\n");
41087: }
41088: }
41089: function_tests++;
41090: #endif
41091:
41092: return(test_ret);
41093: }
41094:
41095:
41096: static int
41097: test_xmlUCSIsMiscellaneousSymbolsandArrows(void) {
41098: int test_ret = 0;
41099:
41100: #if defined(LIBXML_UNICODE_ENABLED)
41101: int mem_base;
41102: int ret_val;
41103: int code; /* UCS code point */
41104: int n_code;
41105:
41106: for (n_code = 0;n_code < gen_nb_int;n_code++) {
41107: mem_base = xmlMemBlocks();
41108: code = gen_int(n_code, 0);
41109:
41110: ret_val = xmlUCSIsMiscellaneousSymbolsandArrows(code);
41111: desret_int(ret_val);
41112: call_tests++;
41113: des_int(n_code, code, 0);
41114: xmlResetLastError();
41115: if (mem_base != xmlMemBlocks()) {
41116: printf("Leak of %d blocks found in xmlUCSIsMiscellaneousSymbolsandArrows",
41117: xmlMemBlocks() - mem_base);
41118: test_ret++;
41119: printf(" %d", n_code);
41120: printf("\n");
41121: }
41122: }
41123: function_tests++;
41124: #endif
41125:
41126: return(test_ret);
41127: }
41128:
41129:
41130: static int
41131: test_xmlUCSIsMiscellaneousTechnical(void) {
41132: int test_ret = 0;
41133:
41134: #if defined(LIBXML_UNICODE_ENABLED)
41135: int mem_base;
41136: int ret_val;
41137: int code; /* UCS code point */
41138: int n_code;
41139:
41140: for (n_code = 0;n_code < gen_nb_int;n_code++) {
41141: mem_base = xmlMemBlocks();
41142: code = gen_int(n_code, 0);
41143:
41144: ret_val = xmlUCSIsMiscellaneousTechnical(code);
41145: desret_int(ret_val);
41146: call_tests++;
41147: des_int(n_code, code, 0);
41148: xmlResetLastError();
41149: if (mem_base != xmlMemBlocks()) {
41150: printf("Leak of %d blocks found in xmlUCSIsMiscellaneousTechnical",
41151: xmlMemBlocks() - mem_base);
41152: test_ret++;
41153: printf(" %d", n_code);
41154: printf("\n");
41155: }
41156: }
41157: function_tests++;
41158: #endif
41159:
41160: return(test_ret);
41161: }
41162:
41163:
41164: static int
41165: test_xmlUCSIsMongolian(void) {
41166: int test_ret = 0;
41167:
41168: #if defined(LIBXML_UNICODE_ENABLED)
41169: int mem_base;
41170: int ret_val;
41171: int code; /* UCS code point */
41172: int n_code;
41173:
41174: for (n_code = 0;n_code < gen_nb_int;n_code++) {
41175: mem_base = xmlMemBlocks();
41176: code = gen_int(n_code, 0);
41177:
41178: ret_val = xmlUCSIsMongolian(code);
41179: desret_int(ret_val);
41180: call_tests++;
41181: des_int(n_code, code, 0);
41182: xmlResetLastError();
41183: if (mem_base != xmlMemBlocks()) {
41184: printf("Leak of %d blocks found in xmlUCSIsMongolian",
41185: xmlMemBlocks() - mem_base);
41186: test_ret++;
41187: printf(" %d", n_code);
41188: printf("\n");
41189: }
41190: }
41191: function_tests++;
41192: #endif
41193:
41194: return(test_ret);
41195: }
41196:
41197:
41198: static int
41199: test_xmlUCSIsMusicalSymbols(void) {
41200: int test_ret = 0;
41201:
41202: #if defined(LIBXML_UNICODE_ENABLED)
41203: int mem_base;
41204: int ret_val;
41205: int code; /* UCS code point */
41206: int n_code;
41207:
41208: for (n_code = 0;n_code < gen_nb_int;n_code++) {
41209: mem_base = xmlMemBlocks();
41210: code = gen_int(n_code, 0);
41211:
41212: ret_val = xmlUCSIsMusicalSymbols(code);
41213: desret_int(ret_val);
41214: call_tests++;
41215: des_int(n_code, code, 0);
41216: xmlResetLastError();
41217: if (mem_base != xmlMemBlocks()) {
41218: printf("Leak of %d blocks found in xmlUCSIsMusicalSymbols",
41219: xmlMemBlocks() - mem_base);
41220: test_ret++;
41221: printf(" %d", n_code);
41222: printf("\n");
41223: }
41224: }
41225: function_tests++;
41226: #endif
41227:
41228: return(test_ret);
41229: }
41230:
41231:
41232: static int
41233: test_xmlUCSIsMyanmar(void) {
41234: int test_ret = 0;
41235:
41236: #if defined(LIBXML_UNICODE_ENABLED)
41237: int mem_base;
41238: int ret_val;
41239: int code; /* UCS code point */
41240: int n_code;
41241:
41242: for (n_code = 0;n_code < gen_nb_int;n_code++) {
41243: mem_base = xmlMemBlocks();
41244: code = gen_int(n_code, 0);
41245:
41246: ret_val = xmlUCSIsMyanmar(code);
41247: desret_int(ret_val);
41248: call_tests++;
41249: des_int(n_code, code, 0);
41250: xmlResetLastError();
41251: if (mem_base != xmlMemBlocks()) {
41252: printf("Leak of %d blocks found in xmlUCSIsMyanmar",
41253: xmlMemBlocks() - mem_base);
41254: test_ret++;
41255: printf(" %d", n_code);
41256: printf("\n");
41257: }
41258: }
41259: function_tests++;
41260: #endif
41261:
41262: return(test_ret);
41263: }
41264:
41265:
41266: static int
41267: test_xmlUCSIsNumberForms(void) {
41268: int test_ret = 0;
41269:
41270: #if defined(LIBXML_UNICODE_ENABLED)
41271: int mem_base;
41272: int ret_val;
41273: int code; /* UCS code point */
41274: int n_code;
41275:
41276: for (n_code = 0;n_code < gen_nb_int;n_code++) {
41277: mem_base = xmlMemBlocks();
41278: code = gen_int(n_code, 0);
41279:
41280: ret_val = xmlUCSIsNumberForms(code);
41281: desret_int(ret_val);
41282: call_tests++;
41283: des_int(n_code, code, 0);
41284: xmlResetLastError();
41285: if (mem_base != xmlMemBlocks()) {
41286: printf("Leak of %d blocks found in xmlUCSIsNumberForms",
41287: xmlMemBlocks() - mem_base);
41288: test_ret++;
41289: printf(" %d", n_code);
41290: printf("\n");
41291: }
41292: }
41293: function_tests++;
41294: #endif
41295:
41296: return(test_ret);
41297: }
41298:
41299:
41300: static int
41301: test_xmlUCSIsOgham(void) {
41302: int test_ret = 0;
41303:
41304: #if defined(LIBXML_UNICODE_ENABLED)
41305: int mem_base;
41306: int ret_val;
41307: int code; /* UCS code point */
41308: int n_code;
41309:
41310: for (n_code = 0;n_code < gen_nb_int;n_code++) {
41311: mem_base = xmlMemBlocks();
41312: code = gen_int(n_code, 0);
41313:
41314: ret_val = xmlUCSIsOgham(code);
41315: desret_int(ret_val);
41316: call_tests++;
41317: des_int(n_code, code, 0);
41318: xmlResetLastError();
41319: if (mem_base != xmlMemBlocks()) {
41320: printf("Leak of %d blocks found in xmlUCSIsOgham",
41321: xmlMemBlocks() - mem_base);
41322: test_ret++;
41323: printf(" %d", n_code);
41324: printf("\n");
41325: }
41326: }
41327: function_tests++;
41328: #endif
41329:
41330: return(test_ret);
41331: }
41332:
41333:
41334: static int
41335: test_xmlUCSIsOldItalic(void) {
41336: int test_ret = 0;
41337:
41338: #if defined(LIBXML_UNICODE_ENABLED)
41339: int mem_base;
41340: int ret_val;
41341: int code; /* UCS code point */
41342: int n_code;
41343:
41344: for (n_code = 0;n_code < gen_nb_int;n_code++) {
41345: mem_base = xmlMemBlocks();
41346: code = gen_int(n_code, 0);
41347:
41348: ret_val = xmlUCSIsOldItalic(code);
41349: desret_int(ret_val);
41350: call_tests++;
41351: des_int(n_code, code, 0);
41352: xmlResetLastError();
41353: if (mem_base != xmlMemBlocks()) {
41354: printf("Leak of %d blocks found in xmlUCSIsOldItalic",
41355: xmlMemBlocks() - mem_base);
41356: test_ret++;
41357: printf(" %d", n_code);
41358: printf("\n");
41359: }
41360: }
41361: function_tests++;
41362: #endif
41363:
41364: return(test_ret);
41365: }
41366:
41367:
41368: static int
41369: test_xmlUCSIsOpticalCharacterRecognition(void) {
41370: int test_ret = 0;
41371:
41372: #if defined(LIBXML_UNICODE_ENABLED)
41373: int mem_base;
41374: int ret_val;
41375: int code; /* UCS code point */
41376: int n_code;
41377:
41378: for (n_code = 0;n_code < gen_nb_int;n_code++) {
41379: mem_base = xmlMemBlocks();
41380: code = gen_int(n_code, 0);
41381:
41382: ret_val = xmlUCSIsOpticalCharacterRecognition(code);
41383: desret_int(ret_val);
41384: call_tests++;
41385: des_int(n_code, code, 0);
41386: xmlResetLastError();
41387: if (mem_base != xmlMemBlocks()) {
41388: printf("Leak of %d blocks found in xmlUCSIsOpticalCharacterRecognition",
41389: xmlMemBlocks() - mem_base);
41390: test_ret++;
41391: printf(" %d", n_code);
41392: printf("\n");
41393: }
41394: }
41395: function_tests++;
41396: #endif
41397:
41398: return(test_ret);
41399: }
41400:
41401:
41402: static int
41403: test_xmlUCSIsOriya(void) {
41404: int test_ret = 0;
41405:
41406: #if defined(LIBXML_UNICODE_ENABLED)
41407: int mem_base;
41408: int ret_val;
41409: int code; /* UCS code point */
41410: int n_code;
41411:
41412: for (n_code = 0;n_code < gen_nb_int;n_code++) {
41413: mem_base = xmlMemBlocks();
41414: code = gen_int(n_code, 0);
41415:
41416: ret_val = xmlUCSIsOriya(code);
41417: desret_int(ret_val);
41418: call_tests++;
41419: des_int(n_code, code, 0);
41420: xmlResetLastError();
41421: if (mem_base != xmlMemBlocks()) {
41422: printf("Leak of %d blocks found in xmlUCSIsOriya",
41423: xmlMemBlocks() - mem_base);
41424: test_ret++;
41425: printf(" %d", n_code);
41426: printf("\n");
41427: }
41428: }
41429: function_tests++;
41430: #endif
41431:
41432: return(test_ret);
41433: }
41434:
41435:
41436: static int
41437: test_xmlUCSIsOsmanya(void) {
41438: int test_ret = 0;
41439:
41440: #if defined(LIBXML_UNICODE_ENABLED)
41441: int mem_base;
41442: int ret_val;
41443: int code; /* UCS code point */
41444: int n_code;
41445:
41446: for (n_code = 0;n_code < gen_nb_int;n_code++) {
41447: mem_base = xmlMemBlocks();
41448: code = gen_int(n_code, 0);
41449:
41450: ret_val = xmlUCSIsOsmanya(code);
41451: desret_int(ret_val);
41452: call_tests++;
41453: des_int(n_code, code, 0);
41454: xmlResetLastError();
41455: if (mem_base != xmlMemBlocks()) {
41456: printf("Leak of %d blocks found in xmlUCSIsOsmanya",
41457: xmlMemBlocks() - mem_base);
41458: test_ret++;
41459: printf(" %d", n_code);
41460: printf("\n");
41461: }
41462: }
41463: function_tests++;
41464: #endif
41465:
41466: return(test_ret);
41467: }
41468:
41469:
41470: static int
41471: test_xmlUCSIsPhoneticExtensions(void) {
41472: int test_ret = 0;
41473:
41474: #if defined(LIBXML_UNICODE_ENABLED)
41475: int mem_base;
41476: int ret_val;
41477: int code; /* UCS code point */
41478: int n_code;
41479:
41480: for (n_code = 0;n_code < gen_nb_int;n_code++) {
41481: mem_base = xmlMemBlocks();
41482: code = gen_int(n_code, 0);
41483:
41484: ret_val = xmlUCSIsPhoneticExtensions(code);
41485: desret_int(ret_val);
41486: call_tests++;
41487: des_int(n_code, code, 0);
41488: xmlResetLastError();
41489: if (mem_base != xmlMemBlocks()) {
41490: printf("Leak of %d blocks found in xmlUCSIsPhoneticExtensions",
41491: xmlMemBlocks() - mem_base);
41492: test_ret++;
41493: printf(" %d", n_code);
41494: printf("\n");
41495: }
41496: }
41497: function_tests++;
41498: #endif
41499:
41500: return(test_ret);
41501: }
41502:
41503:
41504: static int
41505: test_xmlUCSIsPrivateUse(void) {
41506: int test_ret = 0;
41507:
41508: #if defined(LIBXML_UNICODE_ENABLED)
41509: int mem_base;
41510: int ret_val;
41511: int code; /* UCS code point */
41512: int n_code;
41513:
41514: for (n_code = 0;n_code < gen_nb_int;n_code++) {
41515: mem_base = xmlMemBlocks();
41516: code = gen_int(n_code, 0);
41517:
41518: ret_val = xmlUCSIsPrivateUse(code);
41519: desret_int(ret_val);
41520: call_tests++;
41521: des_int(n_code, code, 0);
41522: xmlResetLastError();
41523: if (mem_base != xmlMemBlocks()) {
41524: printf("Leak of %d blocks found in xmlUCSIsPrivateUse",
41525: xmlMemBlocks() - mem_base);
41526: test_ret++;
41527: printf(" %d", n_code);
41528: printf("\n");
41529: }
41530: }
41531: function_tests++;
41532: #endif
41533:
41534: return(test_ret);
41535: }
41536:
41537:
41538: static int
41539: test_xmlUCSIsPrivateUseArea(void) {
41540: int test_ret = 0;
41541:
41542: #if defined(LIBXML_UNICODE_ENABLED)
41543: int mem_base;
41544: int ret_val;
41545: int code; /* UCS code point */
41546: int n_code;
41547:
41548: for (n_code = 0;n_code < gen_nb_int;n_code++) {
41549: mem_base = xmlMemBlocks();
41550: code = gen_int(n_code, 0);
41551:
41552: ret_val = xmlUCSIsPrivateUseArea(code);
41553: desret_int(ret_val);
41554: call_tests++;
41555: des_int(n_code, code, 0);
41556: xmlResetLastError();
41557: if (mem_base != xmlMemBlocks()) {
41558: printf("Leak of %d blocks found in xmlUCSIsPrivateUseArea",
41559: xmlMemBlocks() - mem_base);
41560: test_ret++;
41561: printf(" %d", n_code);
41562: printf("\n");
41563: }
41564: }
41565: function_tests++;
41566: #endif
41567:
41568: return(test_ret);
41569: }
41570:
41571:
41572: static int
41573: test_xmlUCSIsRunic(void) {
41574: int test_ret = 0;
41575:
41576: #if defined(LIBXML_UNICODE_ENABLED)
41577: int mem_base;
41578: int ret_val;
41579: int code; /* UCS code point */
41580: int n_code;
41581:
41582: for (n_code = 0;n_code < gen_nb_int;n_code++) {
41583: mem_base = xmlMemBlocks();
41584: code = gen_int(n_code, 0);
41585:
41586: ret_val = xmlUCSIsRunic(code);
41587: desret_int(ret_val);
41588: call_tests++;
41589: des_int(n_code, code, 0);
41590: xmlResetLastError();
41591: if (mem_base != xmlMemBlocks()) {
41592: printf("Leak of %d blocks found in xmlUCSIsRunic",
41593: xmlMemBlocks() - mem_base);
41594: test_ret++;
41595: printf(" %d", n_code);
41596: printf("\n");
41597: }
41598: }
41599: function_tests++;
41600: #endif
41601:
41602: return(test_ret);
41603: }
41604:
41605:
41606: static int
41607: test_xmlUCSIsShavian(void) {
41608: int test_ret = 0;
41609:
41610: #if defined(LIBXML_UNICODE_ENABLED)
41611: int mem_base;
41612: int ret_val;
41613: int code; /* UCS code point */
41614: int n_code;
41615:
41616: for (n_code = 0;n_code < gen_nb_int;n_code++) {
41617: mem_base = xmlMemBlocks();
41618: code = gen_int(n_code, 0);
41619:
41620: ret_val = xmlUCSIsShavian(code);
41621: desret_int(ret_val);
41622: call_tests++;
41623: des_int(n_code, code, 0);
41624: xmlResetLastError();
41625: if (mem_base != xmlMemBlocks()) {
41626: printf("Leak of %d blocks found in xmlUCSIsShavian",
41627: xmlMemBlocks() - mem_base);
41628: test_ret++;
41629: printf(" %d", n_code);
41630: printf("\n");
41631: }
41632: }
41633: function_tests++;
41634: #endif
41635:
41636: return(test_ret);
41637: }
41638:
41639:
41640: static int
41641: test_xmlUCSIsSinhala(void) {
41642: int test_ret = 0;
41643:
41644: #if defined(LIBXML_UNICODE_ENABLED)
41645: int mem_base;
41646: int ret_val;
41647: int code; /* UCS code point */
41648: int n_code;
41649:
41650: for (n_code = 0;n_code < gen_nb_int;n_code++) {
41651: mem_base = xmlMemBlocks();
41652: code = gen_int(n_code, 0);
41653:
41654: ret_val = xmlUCSIsSinhala(code);
41655: desret_int(ret_val);
41656: call_tests++;
41657: des_int(n_code, code, 0);
41658: xmlResetLastError();
41659: if (mem_base != xmlMemBlocks()) {
41660: printf("Leak of %d blocks found in xmlUCSIsSinhala",
41661: xmlMemBlocks() - mem_base);
41662: test_ret++;
41663: printf(" %d", n_code);
41664: printf("\n");
41665: }
41666: }
41667: function_tests++;
41668: #endif
41669:
41670: return(test_ret);
41671: }
41672:
41673:
41674: static int
41675: test_xmlUCSIsSmallFormVariants(void) {
41676: int test_ret = 0;
41677:
41678: #if defined(LIBXML_UNICODE_ENABLED)
41679: int mem_base;
41680: int ret_val;
41681: int code; /* UCS code point */
41682: int n_code;
41683:
41684: for (n_code = 0;n_code < gen_nb_int;n_code++) {
41685: mem_base = xmlMemBlocks();
41686: code = gen_int(n_code, 0);
41687:
41688: ret_val = xmlUCSIsSmallFormVariants(code);
41689: desret_int(ret_val);
41690: call_tests++;
41691: des_int(n_code, code, 0);
41692: xmlResetLastError();
41693: if (mem_base != xmlMemBlocks()) {
41694: printf("Leak of %d blocks found in xmlUCSIsSmallFormVariants",
41695: xmlMemBlocks() - mem_base);
41696: test_ret++;
41697: printf(" %d", n_code);
41698: printf("\n");
41699: }
41700: }
41701: function_tests++;
41702: #endif
41703:
41704: return(test_ret);
41705: }
41706:
41707:
41708: static int
41709: test_xmlUCSIsSpacingModifierLetters(void) {
41710: int test_ret = 0;
41711:
41712: #if defined(LIBXML_UNICODE_ENABLED)
41713: int mem_base;
41714: int ret_val;
41715: int code; /* UCS code point */
41716: int n_code;
41717:
41718: for (n_code = 0;n_code < gen_nb_int;n_code++) {
41719: mem_base = xmlMemBlocks();
41720: code = gen_int(n_code, 0);
41721:
41722: ret_val = xmlUCSIsSpacingModifierLetters(code);
41723: desret_int(ret_val);
41724: call_tests++;
41725: des_int(n_code, code, 0);
41726: xmlResetLastError();
41727: if (mem_base != xmlMemBlocks()) {
41728: printf("Leak of %d blocks found in xmlUCSIsSpacingModifierLetters",
41729: xmlMemBlocks() - mem_base);
41730: test_ret++;
41731: printf(" %d", n_code);
41732: printf("\n");
41733: }
41734: }
41735: function_tests++;
41736: #endif
41737:
41738: return(test_ret);
41739: }
41740:
41741:
41742: static int
41743: test_xmlUCSIsSpecials(void) {
41744: int test_ret = 0;
41745:
41746: #if defined(LIBXML_UNICODE_ENABLED)
41747: int mem_base;
41748: int ret_val;
41749: int code; /* UCS code point */
41750: int n_code;
41751:
41752: for (n_code = 0;n_code < gen_nb_int;n_code++) {
41753: mem_base = xmlMemBlocks();
41754: code = gen_int(n_code, 0);
41755:
41756: ret_val = xmlUCSIsSpecials(code);
41757: desret_int(ret_val);
41758: call_tests++;
41759: des_int(n_code, code, 0);
41760: xmlResetLastError();
41761: if (mem_base != xmlMemBlocks()) {
41762: printf("Leak of %d blocks found in xmlUCSIsSpecials",
41763: xmlMemBlocks() - mem_base);
41764: test_ret++;
41765: printf(" %d", n_code);
41766: printf("\n");
41767: }
41768: }
41769: function_tests++;
41770: #endif
41771:
41772: return(test_ret);
41773: }
41774:
41775:
41776: static int
41777: test_xmlUCSIsSuperscriptsandSubscripts(void) {
41778: int test_ret = 0;
41779:
41780: #if defined(LIBXML_UNICODE_ENABLED)
41781: int mem_base;
41782: int ret_val;
41783: int code; /* UCS code point */
41784: int n_code;
41785:
41786: for (n_code = 0;n_code < gen_nb_int;n_code++) {
41787: mem_base = xmlMemBlocks();
41788: code = gen_int(n_code, 0);
41789:
41790: ret_val = xmlUCSIsSuperscriptsandSubscripts(code);
41791: desret_int(ret_val);
41792: call_tests++;
41793: des_int(n_code, code, 0);
41794: xmlResetLastError();
41795: if (mem_base != xmlMemBlocks()) {
41796: printf("Leak of %d blocks found in xmlUCSIsSuperscriptsandSubscripts",
41797: xmlMemBlocks() - mem_base);
41798: test_ret++;
41799: printf(" %d", n_code);
41800: printf("\n");
41801: }
41802: }
41803: function_tests++;
41804: #endif
41805:
41806: return(test_ret);
41807: }
41808:
41809:
41810: static int
41811: test_xmlUCSIsSupplementalArrowsA(void) {
41812: int test_ret = 0;
41813:
41814: #if defined(LIBXML_UNICODE_ENABLED)
41815: int mem_base;
41816: int ret_val;
41817: int code; /* UCS code point */
41818: int n_code;
41819:
41820: for (n_code = 0;n_code < gen_nb_int;n_code++) {
41821: mem_base = xmlMemBlocks();
41822: code = gen_int(n_code, 0);
41823:
41824: ret_val = xmlUCSIsSupplementalArrowsA(code);
41825: desret_int(ret_val);
41826: call_tests++;
41827: des_int(n_code, code, 0);
41828: xmlResetLastError();
41829: if (mem_base != xmlMemBlocks()) {
41830: printf("Leak of %d blocks found in xmlUCSIsSupplementalArrowsA",
41831: xmlMemBlocks() - mem_base);
41832: test_ret++;
41833: printf(" %d", n_code);
41834: printf("\n");
41835: }
41836: }
41837: function_tests++;
41838: #endif
41839:
41840: return(test_ret);
41841: }
41842:
41843:
41844: static int
41845: test_xmlUCSIsSupplementalArrowsB(void) {
41846: int test_ret = 0;
41847:
41848: #if defined(LIBXML_UNICODE_ENABLED)
41849: int mem_base;
41850: int ret_val;
41851: int code; /* UCS code point */
41852: int n_code;
41853:
41854: for (n_code = 0;n_code < gen_nb_int;n_code++) {
41855: mem_base = xmlMemBlocks();
41856: code = gen_int(n_code, 0);
41857:
41858: ret_val = xmlUCSIsSupplementalArrowsB(code);
41859: desret_int(ret_val);
41860: call_tests++;
41861: des_int(n_code, code, 0);
41862: xmlResetLastError();
41863: if (mem_base != xmlMemBlocks()) {
41864: printf("Leak of %d blocks found in xmlUCSIsSupplementalArrowsB",
41865: xmlMemBlocks() - mem_base);
41866: test_ret++;
41867: printf(" %d", n_code);
41868: printf("\n");
41869: }
41870: }
41871: function_tests++;
41872: #endif
41873:
41874: return(test_ret);
41875: }
41876:
41877:
41878: static int
41879: test_xmlUCSIsSupplementalMathematicalOperators(void) {
41880: int test_ret = 0;
41881:
41882: #if defined(LIBXML_UNICODE_ENABLED)
41883: int mem_base;
41884: int ret_val;
41885: int code; /* UCS code point */
41886: int n_code;
41887:
41888: for (n_code = 0;n_code < gen_nb_int;n_code++) {
41889: mem_base = xmlMemBlocks();
41890: code = gen_int(n_code, 0);
41891:
41892: ret_val = xmlUCSIsSupplementalMathematicalOperators(code);
41893: desret_int(ret_val);
41894: call_tests++;
41895: des_int(n_code, code, 0);
41896: xmlResetLastError();
41897: if (mem_base != xmlMemBlocks()) {
41898: printf("Leak of %d blocks found in xmlUCSIsSupplementalMathematicalOperators",
41899: xmlMemBlocks() - mem_base);
41900: test_ret++;
41901: printf(" %d", n_code);
41902: printf("\n");
41903: }
41904: }
41905: function_tests++;
41906: #endif
41907:
41908: return(test_ret);
41909: }
41910:
41911:
41912: static int
41913: test_xmlUCSIsSupplementaryPrivateUseAreaA(void) {
41914: int test_ret = 0;
41915:
41916: #if defined(LIBXML_UNICODE_ENABLED)
41917: int mem_base;
41918: int ret_val;
41919: int code; /* UCS code point */
41920: int n_code;
41921:
41922: for (n_code = 0;n_code < gen_nb_int;n_code++) {
41923: mem_base = xmlMemBlocks();
41924: code = gen_int(n_code, 0);
41925:
41926: ret_val = xmlUCSIsSupplementaryPrivateUseAreaA(code);
41927: desret_int(ret_val);
41928: call_tests++;
41929: des_int(n_code, code, 0);
41930: xmlResetLastError();
41931: if (mem_base != xmlMemBlocks()) {
41932: printf("Leak of %d blocks found in xmlUCSIsSupplementaryPrivateUseAreaA",
41933: xmlMemBlocks() - mem_base);
41934: test_ret++;
41935: printf(" %d", n_code);
41936: printf("\n");
41937: }
41938: }
41939: function_tests++;
41940: #endif
41941:
41942: return(test_ret);
41943: }
41944:
41945:
41946: static int
41947: test_xmlUCSIsSupplementaryPrivateUseAreaB(void) {
41948: int test_ret = 0;
41949:
41950: #if defined(LIBXML_UNICODE_ENABLED)
41951: int mem_base;
41952: int ret_val;
41953: int code; /* UCS code point */
41954: int n_code;
41955:
41956: for (n_code = 0;n_code < gen_nb_int;n_code++) {
41957: mem_base = xmlMemBlocks();
41958: code = gen_int(n_code, 0);
41959:
41960: ret_val = xmlUCSIsSupplementaryPrivateUseAreaB(code);
41961: desret_int(ret_val);
41962: call_tests++;
41963: des_int(n_code, code, 0);
41964: xmlResetLastError();
41965: if (mem_base != xmlMemBlocks()) {
41966: printf("Leak of %d blocks found in xmlUCSIsSupplementaryPrivateUseAreaB",
41967: xmlMemBlocks() - mem_base);
41968: test_ret++;
41969: printf(" %d", n_code);
41970: printf("\n");
41971: }
41972: }
41973: function_tests++;
41974: #endif
41975:
41976: return(test_ret);
41977: }
41978:
41979:
41980: static int
41981: test_xmlUCSIsSyriac(void) {
41982: int test_ret = 0;
41983:
41984: #if defined(LIBXML_UNICODE_ENABLED)
41985: int mem_base;
41986: int ret_val;
41987: int code; /* UCS code point */
41988: int n_code;
41989:
41990: for (n_code = 0;n_code < gen_nb_int;n_code++) {
41991: mem_base = xmlMemBlocks();
41992: code = gen_int(n_code, 0);
41993:
41994: ret_val = xmlUCSIsSyriac(code);
41995: desret_int(ret_val);
41996: call_tests++;
41997: des_int(n_code, code, 0);
41998: xmlResetLastError();
41999: if (mem_base != xmlMemBlocks()) {
42000: printf("Leak of %d blocks found in xmlUCSIsSyriac",
42001: xmlMemBlocks() - mem_base);
42002: test_ret++;
42003: printf(" %d", n_code);
42004: printf("\n");
42005: }
42006: }
42007: function_tests++;
42008: #endif
42009:
42010: return(test_ret);
42011: }
42012:
42013:
42014: static int
42015: test_xmlUCSIsTagalog(void) {
42016: int test_ret = 0;
42017:
42018: #if defined(LIBXML_UNICODE_ENABLED)
42019: int mem_base;
42020: int ret_val;
42021: int code; /* UCS code point */
42022: int n_code;
42023:
42024: for (n_code = 0;n_code < gen_nb_int;n_code++) {
42025: mem_base = xmlMemBlocks();
42026: code = gen_int(n_code, 0);
42027:
42028: ret_val = xmlUCSIsTagalog(code);
42029: desret_int(ret_val);
42030: call_tests++;
42031: des_int(n_code, code, 0);
42032: xmlResetLastError();
42033: if (mem_base != xmlMemBlocks()) {
42034: printf("Leak of %d blocks found in xmlUCSIsTagalog",
42035: xmlMemBlocks() - mem_base);
42036: test_ret++;
42037: printf(" %d", n_code);
42038: printf("\n");
42039: }
42040: }
42041: function_tests++;
42042: #endif
42043:
42044: return(test_ret);
42045: }
42046:
42047:
42048: static int
42049: test_xmlUCSIsTagbanwa(void) {
42050: int test_ret = 0;
42051:
42052: #if defined(LIBXML_UNICODE_ENABLED)
42053: int mem_base;
42054: int ret_val;
42055: int code; /* UCS code point */
42056: int n_code;
42057:
42058: for (n_code = 0;n_code < gen_nb_int;n_code++) {
42059: mem_base = xmlMemBlocks();
42060: code = gen_int(n_code, 0);
42061:
42062: ret_val = xmlUCSIsTagbanwa(code);
42063: desret_int(ret_val);
42064: call_tests++;
42065: des_int(n_code, code, 0);
42066: xmlResetLastError();
42067: if (mem_base != xmlMemBlocks()) {
42068: printf("Leak of %d blocks found in xmlUCSIsTagbanwa",
42069: xmlMemBlocks() - mem_base);
42070: test_ret++;
42071: printf(" %d", n_code);
42072: printf("\n");
42073: }
42074: }
42075: function_tests++;
42076: #endif
42077:
42078: return(test_ret);
42079: }
42080:
42081:
42082: static int
42083: test_xmlUCSIsTags(void) {
42084: int test_ret = 0;
42085:
42086: #if defined(LIBXML_UNICODE_ENABLED)
42087: int mem_base;
42088: int ret_val;
42089: int code; /* UCS code point */
42090: int n_code;
42091:
42092: for (n_code = 0;n_code < gen_nb_int;n_code++) {
42093: mem_base = xmlMemBlocks();
42094: code = gen_int(n_code, 0);
42095:
42096: ret_val = xmlUCSIsTags(code);
42097: desret_int(ret_val);
42098: call_tests++;
42099: des_int(n_code, code, 0);
42100: xmlResetLastError();
42101: if (mem_base != xmlMemBlocks()) {
42102: printf("Leak of %d blocks found in xmlUCSIsTags",
42103: xmlMemBlocks() - mem_base);
42104: test_ret++;
42105: printf(" %d", n_code);
42106: printf("\n");
42107: }
42108: }
42109: function_tests++;
42110: #endif
42111:
42112: return(test_ret);
42113: }
42114:
42115:
42116: static int
42117: test_xmlUCSIsTaiLe(void) {
42118: int test_ret = 0;
42119:
42120: #if defined(LIBXML_UNICODE_ENABLED)
42121: int mem_base;
42122: int ret_val;
42123: int code; /* UCS code point */
42124: int n_code;
42125:
42126: for (n_code = 0;n_code < gen_nb_int;n_code++) {
42127: mem_base = xmlMemBlocks();
42128: code = gen_int(n_code, 0);
42129:
42130: ret_val = xmlUCSIsTaiLe(code);
42131: desret_int(ret_val);
42132: call_tests++;
42133: des_int(n_code, code, 0);
42134: xmlResetLastError();
42135: if (mem_base != xmlMemBlocks()) {
42136: printf("Leak of %d blocks found in xmlUCSIsTaiLe",
42137: xmlMemBlocks() - mem_base);
42138: test_ret++;
42139: printf(" %d", n_code);
42140: printf("\n");
42141: }
42142: }
42143: function_tests++;
42144: #endif
42145:
42146: return(test_ret);
42147: }
42148:
42149:
42150: static int
42151: test_xmlUCSIsTaiXuanJingSymbols(void) {
42152: int test_ret = 0;
42153:
42154: #if defined(LIBXML_UNICODE_ENABLED)
42155: int mem_base;
42156: int ret_val;
42157: int code; /* UCS code point */
42158: int n_code;
42159:
42160: for (n_code = 0;n_code < gen_nb_int;n_code++) {
42161: mem_base = xmlMemBlocks();
42162: code = gen_int(n_code, 0);
42163:
42164: ret_val = xmlUCSIsTaiXuanJingSymbols(code);
42165: desret_int(ret_val);
42166: call_tests++;
42167: des_int(n_code, code, 0);
42168: xmlResetLastError();
42169: if (mem_base != xmlMemBlocks()) {
42170: printf("Leak of %d blocks found in xmlUCSIsTaiXuanJingSymbols",
42171: xmlMemBlocks() - mem_base);
42172: test_ret++;
42173: printf(" %d", n_code);
42174: printf("\n");
42175: }
42176: }
42177: function_tests++;
42178: #endif
42179:
42180: return(test_ret);
42181: }
42182:
42183:
42184: static int
42185: test_xmlUCSIsTamil(void) {
42186: int test_ret = 0;
42187:
42188: #if defined(LIBXML_UNICODE_ENABLED)
42189: int mem_base;
42190: int ret_val;
42191: int code; /* UCS code point */
42192: int n_code;
42193:
42194: for (n_code = 0;n_code < gen_nb_int;n_code++) {
42195: mem_base = xmlMemBlocks();
42196: code = gen_int(n_code, 0);
42197:
42198: ret_val = xmlUCSIsTamil(code);
42199: desret_int(ret_val);
42200: call_tests++;
42201: des_int(n_code, code, 0);
42202: xmlResetLastError();
42203: if (mem_base != xmlMemBlocks()) {
42204: printf("Leak of %d blocks found in xmlUCSIsTamil",
42205: xmlMemBlocks() - mem_base);
42206: test_ret++;
42207: printf(" %d", n_code);
42208: printf("\n");
42209: }
42210: }
42211: function_tests++;
42212: #endif
42213:
42214: return(test_ret);
42215: }
42216:
42217:
42218: static int
42219: test_xmlUCSIsTelugu(void) {
42220: int test_ret = 0;
42221:
42222: #if defined(LIBXML_UNICODE_ENABLED)
42223: int mem_base;
42224: int ret_val;
42225: int code; /* UCS code point */
42226: int n_code;
42227:
42228: for (n_code = 0;n_code < gen_nb_int;n_code++) {
42229: mem_base = xmlMemBlocks();
42230: code = gen_int(n_code, 0);
42231:
42232: ret_val = xmlUCSIsTelugu(code);
42233: desret_int(ret_val);
42234: call_tests++;
42235: des_int(n_code, code, 0);
42236: xmlResetLastError();
42237: if (mem_base != xmlMemBlocks()) {
42238: printf("Leak of %d blocks found in xmlUCSIsTelugu",
42239: xmlMemBlocks() - mem_base);
42240: test_ret++;
42241: printf(" %d", n_code);
42242: printf("\n");
42243: }
42244: }
42245: function_tests++;
42246: #endif
42247:
42248: return(test_ret);
42249: }
42250:
42251:
42252: static int
42253: test_xmlUCSIsThaana(void) {
42254: int test_ret = 0;
42255:
42256: #if defined(LIBXML_UNICODE_ENABLED)
42257: int mem_base;
42258: int ret_val;
42259: int code; /* UCS code point */
42260: int n_code;
42261:
42262: for (n_code = 0;n_code < gen_nb_int;n_code++) {
42263: mem_base = xmlMemBlocks();
42264: code = gen_int(n_code, 0);
42265:
42266: ret_val = xmlUCSIsThaana(code);
42267: desret_int(ret_val);
42268: call_tests++;
42269: des_int(n_code, code, 0);
42270: xmlResetLastError();
42271: if (mem_base != xmlMemBlocks()) {
42272: printf("Leak of %d blocks found in xmlUCSIsThaana",
42273: xmlMemBlocks() - mem_base);
42274: test_ret++;
42275: printf(" %d", n_code);
42276: printf("\n");
42277: }
42278: }
42279: function_tests++;
42280: #endif
42281:
42282: return(test_ret);
42283: }
42284:
42285:
42286: static int
42287: test_xmlUCSIsThai(void) {
42288: int test_ret = 0;
42289:
42290: #if defined(LIBXML_UNICODE_ENABLED)
42291: int mem_base;
42292: int ret_val;
42293: int code; /* UCS code point */
42294: int n_code;
42295:
42296: for (n_code = 0;n_code < gen_nb_int;n_code++) {
42297: mem_base = xmlMemBlocks();
42298: code = gen_int(n_code, 0);
42299:
42300: ret_val = xmlUCSIsThai(code);
42301: desret_int(ret_val);
42302: call_tests++;
42303: des_int(n_code, code, 0);
42304: xmlResetLastError();
42305: if (mem_base != xmlMemBlocks()) {
42306: printf("Leak of %d blocks found in xmlUCSIsThai",
42307: xmlMemBlocks() - mem_base);
42308: test_ret++;
42309: printf(" %d", n_code);
42310: printf("\n");
42311: }
42312: }
42313: function_tests++;
42314: #endif
42315:
42316: return(test_ret);
42317: }
42318:
42319:
42320: static int
42321: test_xmlUCSIsTibetan(void) {
42322: int test_ret = 0;
42323:
42324: #if defined(LIBXML_UNICODE_ENABLED)
42325: int mem_base;
42326: int ret_val;
42327: int code; /* UCS code point */
42328: int n_code;
42329:
42330: for (n_code = 0;n_code < gen_nb_int;n_code++) {
42331: mem_base = xmlMemBlocks();
42332: code = gen_int(n_code, 0);
42333:
42334: ret_val = xmlUCSIsTibetan(code);
42335: desret_int(ret_val);
42336: call_tests++;
42337: des_int(n_code, code, 0);
42338: xmlResetLastError();
42339: if (mem_base != xmlMemBlocks()) {
42340: printf("Leak of %d blocks found in xmlUCSIsTibetan",
42341: xmlMemBlocks() - mem_base);
42342: test_ret++;
42343: printf(" %d", n_code);
42344: printf("\n");
42345: }
42346: }
42347: function_tests++;
42348: #endif
42349:
42350: return(test_ret);
42351: }
42352:
42353:
42354: static int
42355: test_xmlUCSIsUgaritic(void) {
42356: int test_ret = 0;
42357:
42358: #if defined(LIBXML_UNICODE_ENABLED)
42359: int mem_base;
42360: int ret_val;
42361: int code; /* UCS code point */
42362: int n_code;
42363:
42364: for (n_code = 0;n_code < gen_nb_int;n_code++) {
42365: mem_base = xmlMemBlocks();
42366: code = gen_int(n_code, 0);
42367:
42368: ret_val = xmlUCSIsUgaritic(code);
42369: desret_int(ret_val);
42370: call_tests++;
42371: des_int(n_code, code, 0);
42372: xmlResetLastError();
42373: if (mem_base != xmlMemBlocks()) {
42374: printf("Leak of %d blocks found in xmlUCSIsUgaritic",
42375: xmlMemBlocks() - mem_base);
42376: test_ret++;
42377: printf(" %d", n_code);
42378: printf("\n");
42379: }
42380: }
42381: function_tests++;
42382: #endif
42383:
42384: return(test_ret);
42385: }
42386:
42387:
42388: static int
42389: test_xmlUCSIsUnifiedCanadianAboriginalSyllabics(void) {
42390: int test_ret = 0;
42391:
42392: #if defined(LIBXML_UNICODE_ENABLED)
42393: int mem_base;
42394: int ret_val;
42395: int code; /* UCS code point */
42396: int n_code;
42397:
42398: for (n_code = 0;n_code < gen_nb_int;n_code++) {
42399: mem_base = xmlMemBlocks();
42400: code = gen_int(n_code, 0);
42401:
42402: ret_val = xmlUCSIsUnifiedCanadianAboriginalSyllabics(code);
42403: desret_int(ret_val);
42404: call_tests++;
42405: des_int(n_code, code, 0);
42406: xmlResetLastError();
42407: if (mem_base != xmlMemBlocks()) {
42408: printf("Leak of %d blocks found in xmlUCSIsUnifiedCanadianAboriginalSyllabics",
42409: xmlMemBlocks() - mem_base);
42410: test_ret++;
42411: printf(" %d", n_code);
42412: printf("\n");
42413: }
42414: }
42415: function_tests++;
42416: #endif
42417:
42418: return(test_ret);
42419: }
42420:
42421:
42422: static int
42423: test_xmlUCSIsVariationSelectors(void) {
42424: int test_ret = 0;
42425:
42426: #if defined(LIBXML_UNICODE_ENABLED)
42427: int mem_base;
42428: int ret_val;
42429: int code; /* UCS code point */
42430: int n_code;
42431:
42432: for (n_code = 0;n_code < gen_nb_int;n_code++) {
42433: mem_base = xmlMemBlocks();
42434: code = gen_int(n_code, 0);
42435:
42436: ret_val = xmlUCSIsVariationSelectors(code);
42437: desret_int(ret_val);
42438: call_tests++;
42439: des_int(n_code, code, 0);
42440: xmlResetLastError();
42441: if (mem_base != xmlMemBlocks()) {
42442: printf("Leak of %d blocks found in xmlUCSIsVariationSelectors",
42443: xmlMemBlocks() - mem_base);
42444: test_ret++;
42445: printf(" %d", n_code);
42446: printf("\n");
42447: }
42448: }
42449: function_tests++;
42450: #endif
42451:
42452: return(test_ret);
42453: }
42454:
42455:
42456: static int
42457: test_xmlUCSIsVariationSelectorsSupplement(void) {
42458: int test_ret = 0;
42459:
42460: #if defined(LIBXML_UNICODE_ENABLED)
42461: int mem_base;
42462: int ret_val;
42463: int code; /* UCS code point */
42464: int n_code;
42465:
42466: for (n_code = 0;n_code < gen_nb_int;n_code++) {
42467: mem_base = xmlMemBlocks();
42468: code = gen_int(n_code, 0);
42469:
42470: ret_val = xmlUCSIsVariationSelectorsSupplement(code);
42471: desret_int(ret_val);
42472: call_tests++;
42473: des_int(n_code, code, 0);
42474: xmlResetLastError();
42475: if (mem_base != xmlMemBlocks()) {
42476: printf("Leak of %d blocks found in xmlUCSIsVariationSelectorsSupplement",
42477: xmlMemBlocks() - mem_base);
42478: test_ret++;
42479: printf(" %d", n_code);
42480: printf("\n");
42481: }
42482: }
42483: function_tests++;
42484: #endif
42485:
42486: return(test_ret);
42487: }
42488:
42489:
42490: static int
42491: test_xmlUCSIsYiRadicals(void) {
42492: int test_ret = 0;
42493:
42494: #if defined(LIBXML_UNICODE_ENABLED)
42495: int mem_base;
42496: int ret_val;
42497: int code; /* UCS code point */
42498: int n_code;
42499:
42500: for (n_code = 0;n_code < gen_nb_int;n_code++) {
42501: mem_base = xmlMemBlocks();
42502: code = gen_int(n_code, 0);
42503:
42504: ret_val = xmlUCSIsYiRadicals(code);
42505: desret_int(ret_val);
42506: call_tests++;
42507: des_int(n_code, code, 0);
42508: xmlResetLastError();
42509: if (mem_base != xmlMemBlocks()) {
42510: printf("Leak of %d blocks found in xmlUCSIsYiRadicals",
42511: xmlMemBlocks() - mem_base);
42512: test_ret++;
42513: printf(" %d", n_code);
42514: printf("\n");
42515: }
42516: }
42517: function_tests++;
42518: #endif
42519:
42520: return(test_ret);
42521: }
42522:
42523:
42524: static int
42525: test_xmlUCSIsYiSyllables(void) {
42526: int test_ret = 0;
42527:
42528: #if defined(LIBXML_UNICODE_ENABLED)
42529: int mem_base;
42530: int ret_val;
42531: int code; /* UCS code point */
42532: int n_code;
42533:
42534: for (n_code = 0;n_code < gen_nb_int;n_code++) {
42535: mem_base = xmlMemBlocks();
42536: code = gen_int(n_code, 0);
42537:
42538: ret_val = xmlUCSIsYiSyllables(code);
42539: desret_int(ret_val);
42540: call_tests++;
42541: des_int(n_code, code, 0);
42542: xmlResetLastError();
42543: if (mem_base != xmlMemBlocks()) {
42544: printf("Leak of %d blocks found in xmlUCSIsYiSyllables",
42545: xmlMemBlocks() - mem_base);
42546: test_ret++;
42547: printf(" %d", n_code);
42548: printf("\n");
42549: }
42550: }
42551: function_tests++;
42552: #endif
42553:
42554: return(test_ret);
42555: }
42556:
42557:
42558: static int
42559: test_xmlUCSIsYijingHexagramSymbols(void) {
42560: int test_ret = 0;
42561:
42562: #if defined(LIBXML_UNICODE_ENABLED)
42563: int mem_base;
42564: int ret_val;
42565: int code; /* UCS code point */
42566: int n_code;
42567:
42568: for (n_code = 0;n_code < gen_nb_int;n_code++) {
42569: mem_base = xmlMemBlocks();
42570: code = gen_int(n_code, 0);
42571:
42572: ret_val = xmlUCSIsYijingHexagramSymbols(code);
42573: desret_int(ret_val);
42574: call_tests++;
42575: des_int(n_code, code, 0);
42576: xmlResetLastError();
42577: if (mem_base != xmlMemBlocks()) {
42578: printf("Leak of %d blocks found in xmlUCSIsYijingHexagramSymbols",
42579: xmlMemBlocks() - mem_base);
42580: test_ret++;
42581: printf(" %d", n_code);
42582: printf("\n");
42583: }
42584: }
42585: function_tests++;
42586: #endif
42587:
42588: return(test_ret);
42589: }
42590:
42591: static int
42592: test_xmlunicode(void) {
42593: int test_ret = 0;
42594:
42595: if (quiet == 0) printf("Testing xmlunicode : 166 of 166 functions ...\n");
42596: test_ret += test_xmlUCSIsAegeanNumbers();
42597: test_ret += test_xmlUCSIsAlphabeticPresentationForms();
42598: test_ret += test_xmlUCSIsArabic();
42599: test_ret += test_xmlUCSIsArabicPresentationFormsA();
42600: test_ret += test_xmlUCSIsArabicPresentationFormsB();
42601: test_ret += test_xmlUCSIsArmenian();
42602: test_ret += test_xmlUCSIsArrows();
42603: test_ret += test_xmlUCSIsBasicLatin();
42604: test_ret += test_xmlUCSIsBengali();
42605: test_ret += test_xmlUCSIsBlock();
42606: test_ret += test_xmlUCSIsBlockElements();
42607: test_ret += test_xmlUCSIsBopomofo();
42608: test_ret += test_xmlUCSIsBopomofoExtended();
42609: test_ret += test_xmlUCSIsBoxDrawing();
42610: test_ret += test_xmlUCSIsBraillePatterns();
42611: test_ret += test_xmlUCSIsBuhid();
42612: test_ret += test_xmlUCSIsByzantineMusicalSymbols();
42613: test_ret += test_xmlUCSIsCJKCompatibility();
42614: test_ret += test_xmlUCSIsCJKCompatibilityForms();
42615: test_ret += test_xmlUCSIsCJKCompatibilityIdeographs();
42616: test_ret += test_xmlUCSIsCJKCompatibilityIdeographsSupplement();
42617: test_ret += test_xmlUCSIsCJKRadicalsSupplement();
42618: test_ret += test_xmlUCSIsCJKSymbolsandPunctuation();
42619: test_ret += test_xmlUCSIsCJKUnifiedIdeographs();
42620: test_ret += test_xmlUCSIsCJKUnifiedIdeographsExtensionA();
42621: test_ret += test_xmlUCSIsCJKUnifiedIdeographsExtensionB();
42622: test_ret += test_xmlUCSIsCat();
42623: test_ret += test_xmlUCSIsCatC();
42624: test_ret += test_xmlUCSIsCatCc();
42625: test_ret += test_xmlUCSIsCatCf();
42626: test_ret += test_xmlUCSIsCatCo();
42627: test_ret += test_xmlUCSIsCatCs();
42628: test_ret += test_xmlUCSIsCatL();
42629: test_ret += test_xmlUCSIsCatLl();
42630: test_ret += test_xmlUCSIsCatLm();
42631: test_ret += test_xmlUCSIsCatLo();
42632: test_ret += test_xmlUCSIsCatLt();
42633: test_ret += test_xmlUCSIsCatLu();
42634: test_ret += test_xmlUCSIsCatM();
42635: test_ret += test_xmlUCSIsCatMc();
42636: test_ret += test_xmlUCSIsCatMe();
42637: test_ret += test_xmlUCSIsCatMn();
42638: test_ret += test_xmlUCSIsCatN();
42639: test_ret += test_xmlUCSIsCatNd();
42640: test_ret += test_xmlUCSIsCatNl();
42641: test_ret += test_xmlUCSIsCatNo();
42642: test_ret += test_xmlUCSIsCatP();
42643: test_ret += test_xmlUCSIsCatPc();
42644: test_ret += test_xmlUCSIsCatPd();
42645: test_ret += test_xmlUCSIsCatPe();
42646: test_ret += test_xmlUCSIsCatPf();
42647: test_ret += test_xmlUCSIsCatPi();
42648: test_ret += test_xmlUCSIsCatPo();
42649: test_ret += test_xmlUCSIsCatPs();
42650: test_ret += test_xmlUCSIsCatS();
42651: test_ret += test_xmlUCSIsCatSc();
42652: test_ret += test_xmlUCSIsCatSk();
42653: test_ret += test_xmlUCSIsCatSm();
42654: test_ret += test_xmlUCSIsCatSo();
42655: test_ret += test_xmlUCSIsCatZ();
42656: test_ret += test_xmlUCSIsCatZl();
42657: test_ret += test_xmlUCSIsCatZp();
42658: test_ret += test_xmlUCSIsCatZs();
42659: test_ret += test_xmlUCSIsCherokee();
42660: test_ret += test_xmlUCSIsCombiningDiacriticalMarks();
42661: test_ret += test_xmlUCSIsCombiningDiacriticalMarksforSymbols();
42662: test_ret += test_xmlUCSIsCombiningHalfMarks();
42663: test_ret += test_xmlUCSIsCombiningMarksforSymbols();
42664: test_ret += test_xmlUCSIsControlPictures();
42665: test_ret += test_xmlUCSIsCurrencySymbols();
42666: test_ret += test_xmlUCSIsCypriotSyllabary();
42667: test_ret += test_xmlUCSIsCyrillic();
42668: test_ret += test_xmlUCSIsCyrillicSupplement();
42669: test_ret += test_xmlUCSIsDeseret();
42670: test_ret += test_xmlUCSIsDevanagari();
42671: test_ret += test_xmlUCSIsDingbats();
42672: test_ret += test_xmlUCSIsEnclosedAlphanumerics();
42673: test_ret += test_xmlUCSIsEnclosedCJKLettersandMonths();
42674: test_ret += test_xmlUCSIsEthiopic();
42675: test_ret += test_xmlUCSIsGeneralPunctuation();
42676: test_ret += test_xmlUCSIsGeometricShapes();
42677: test_ret += test_xmlUCSIsGeorgian();
42678: test_ret += test_xmlUCSIsGothic();
42679: test_ret += test_xmlUCSIsGreek();
42680: test_ret += test_xmlUCSIsGreekExtended();
42681: test_ret += test_xmlUCSIsGreekandCoptic();
42682: test_ret += test_xmlUCSIsGujarati();
42683: test_ret += test_xmlUCSIsGurmukhi();
42684: test_ret += test_xmlUCSIsHalfwidthandFullwidthForms();
42685: test_ret += test_xmlUCSIsHangulCompatibilityJamo();
42686: test_ret += test_xmlUCSIsHangulJamo();
42687: test_ret += test_xmlUCSIsHangulSyllables();
42688: test_ret += test_xmlUCSIsHanunoo();
42689: test_ret += test_xmlUCSIsHebrew();
42690: test_ret += test_xmlUCSIsHighPrivateUseSurrogates();
42691: test_ret += test_xmlUCSIsHighSurrogates();
42692: test_ret += test_xmlUCSIsHiragana();
42693: test_ret += test_xmlUCSIsIPAExtensions();
42694: test_ret += test_xmlUCSIsIdeographicDescriptionCharacters();
42695: test_ret += test_xmlUCSIsKanbun();
42696: test_ret += test_xmlUCSIsKangxiRadicals();
42697: test_ret += test_xmlUCSIsKannada();
42698: test_ret += test_xmlUCSIsKatakana();
42699: test_ret += test_xmlUCSIsKatakanaPhoneticExtensions();
42700: test_ret += test_xmlUCSIsKhmer();
42701: test_ret += test_xmlUCSIsKhmerSymbols();
42702: test_ret += test_xmlUCSIsLao();
42703: test_ret += test_xmlUCSIsLatin1Supplement();
42704: test_ret += test_xmlUCSIsLatinExtendedA();
42705: test_ret += test_xmlUCSIsLatinExtendedAdditional();
42706: test_ret += test_xmlUCSIsLatinExtendedB();
42707: test_ret += test_xmlUCSIsLetterlikeSymbols();
42708: test_ret += test_xmlUCSIsLimbu();
42709: test_ret += test_xmlUCSIsLinearBIdeograms();
42710: test_ret += test_xmlUCSIsLinearBSyllabary();
42711: test_ret += test_xmlUCSIsLowSurrogates();
42712: test_ret += test_xmlUCSIsMalayalam();
42713: test_ret += test_xmlUCSIsMathematicalAlphanumericSymbols();
42714: test_ret += test_xmlUCSIsMathematicalOperators();
42715: test_ret += test_xmlUCSIsMiscellaneousMathematicalSymbolsA();
42716: test_ret += test_xmlUCSIsMiscellaneousMathematicalSymbolsB();
42717: test_ret += test_xmlUCSIsMiscellaneousSymbols();
42718: test_ret += test_xmlUCSIsMiscellaneousSymbolsandArrows();
42719: test_ret += test_xmlUCSIsMiscellaneousTechnical();
42720: test_ret += test_xmlUCSIsMongolian();
42721: test_ret += test_xmlUCSIsMusicalSymbols();
42722: test_ret += test_xmlUCSIsMyanmar();
42723: test_ret += test_xmlUCSIsNumberForms();
42724: test_ret += test_xmlUCSIsOgham();
42725: test_ret += test_xmlUCSIsOldItalic();
42726: test_ret += test_xmlUCSIsOpticalCharacterRecognition();
42727: test_ret += test_xmlUCSIsOriya();
42728: test_ret += test_xmlUCSIsOsmanya();
42729: test_ret += test_xmlUCSIsPhoneticExtensions();
42730: test_ret += test_xmlUCSIsPrivateUse();
42731: test_ret += test_xmlUCSIsPrivateUseArea();
42732: test_ret += test_xmlUCSIsRunic();
42733: test_ret += test_xmlUCSIsShavian();
42734: test_ret += test_xmlUCSIsSinhala();
42735: test_ret += test_xmlUCSIsSmallFormVariants();
42736: test_ret += test_xmlUCSIsSpacingModifierLetters();
42737: test_ret += test_xmlUCSIsSpecials();
42738: test_ret += test_xmlUCSIsSuperscriptsandSubscripts();
42739: test_ret += test_xmlUCSIsSupplementalArrowsA();
42740: test_ret += test_xmlUCSIsSupplementalArrowsB();
42741: test_ret += test_xmlUCSIsSupplementalMathematicalOperators();
42742: test_ret += test_xmlUCSIsSupplementaryPrivateUseAreaA();
42743: test_ret += test_xmlUCSIsSupplementaryPrivateUseAreaB();
42744: test_ret += test_xmlUCSIsSyriac();
42745: test_ret += test_xmlUCSIsTagalog();
42746: test_ret += test_xmlUCSIsTagbanwa();
42747: test_ret += test_xmlUCSIsTags();
42748: test_ret += test_xmlUCSIsTaiLe();
42749: test_ret += test_xmlUCSIsTaiXuanJingSymbols();
42750: test_ret += test_xmlUCSIsTamil();
42751: test_ret += test_xmlUCSIsTelugu();
42752: test_ret += test_xmlUCSIsThaana();
42753: test_ret += test_xmlUCSIsThai();
42754: test_ret += test_xmlUCSIsTibetan();
42755: test_ret += test_xmlUCSIsUgaritic();
42756: test_ret += test_xmlUCSIsUnifiedCanadianAboriginalSyllabics();
42757: test_ret += test_xmlUCSIsVariationSelectors();
42758: test_ret += test_xmlUCSIsVariationSelectorsSupplement();
42759: test_ret += test_xmlUCSIsYiRadicals();
42760: test_ret += test_xmlUCSIsYiSyllables();
42761: test_ret += test_xmlUCSIsYijingHexagramSymbols();
42762:
42763: if (test_ret != 0)
42764: printf("Module xmlunicode: %d errors\n", test_ret);
42765: return(test_ret);
42766: }
42767:
42768: static int
42769: test_xmlNewTextWriter(void) {
42770: int test_ret = 0;
42771:
42772: #if defined(LIBXML_WRITER_ENABLED)
42773: int mem_base;
42774: xmlTextWriterPtr ret_val;
42775: xmlOutputBufferPtr out; /* an xmlOutputBufferPtr */
42776: int n_out;
42777:
42778: for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
42779: mem_base = xmlMemBlocks();
42780: out = gen_xmlOutputBufferPtr(n_out, 0);
42781:
42782: ret_val = xmlNewTextWriter(out);
42783: if (ret_val != NULL) out = NULL;
42784: desret_xmlTextWriterPtr(ret_val);
42785: call_tests++;
42786: des_xmlOutputBufferPtr(n_out, out, 0);
42787: xmlResetLastError();
42788: if (mem_base != xmlMemBlocks()) {
42789: printf("Leak of %d blocks found in xmlNewTextWriter",
42790: xmlMemBlocks() - mem_base);
42791: test_ret++;
42792: printf(" %d", n_out);
42793: printf("\n");
42794: }
42795: }
42796: function_tests++;
42797: #endif
42798:
42799: return(test_ret);
42800: }
42801:
42802:
42803: static int
42804: test_xmlNewTextWriterFilename(void) {
42805: int test_ret = 0;
42806:
42807: #if defined(LIBXML_WRITER_ENABLED)
42808: int mem_base;
42809: xmlTextWriterPtr ret_val;
42810: const char * uri; /* the URI of the resource for the output */
42811: int n_uri;
42812: int compression; /* compress the output? */
42813: int n_compression;
42814:
42815: for (n_uri = 0;n_uri < gen_nb_fileoutput;n_uri++) {
42816: for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
42817: mem_base = xmlMemBlocks();
42818: uri = gen_fileoutput(n_uri, 0);
42819: compression = gen_int(n_compression, 1);
42820:
42821: ret_val = xmlNewTextWriterFilename(uri, compression);
42822: desret_xmlTextWriterPtr(ret_val);
42823: call_tests++;
42824: des_fileoutput(n_uri, uri, 0);
42825: des_int(n_compression, compression, 1);
42826: xmlResetLastError();
42827: if (mem_base != xmlMemBlocks()) {
42828: printf("Leak of %d blocks found in xmlNewTextWriterFilename",
42829: xmlMemBlocks() - mem_base);
42830: test_ret++;
42831: printf(" %d", n_uri);
42832: printf(" %d", n_compression);
42833: printf("\n");
42834: }
42835: }
42836: }
42837: function_tests++;
42838: #endif
42839:
42840: return(test_ret);
42841: }
42842:
42843:
42844: static int
42845: test_xmlNewTextWriterMemory(void) {
42846: int test_ret = 0;
42847:
42848: #if defined(LIBXML_WRITER_ENABLED)
42849: int mem_base;
42850: xmlTextWriterPtr ret_val;
42851: xmlBufferPtr buf; /* xmlBufferPtr */
42852: int n_buf;
42853: int compression; /* compress the output? */
42854: int n_compression;
42855:
42856: for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
42857: for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
42858: mem_base = xmlMemBlocks();
42859: buf = gen_xmlBufferPtr(n_buf, 0);
42860: compression = gen_int(n_compression, 1);
42861:
42862: ret_val = xmlNewTextWriterMemory(buf, compression);
42863: desret_xmlTextWriterPtr(ret_val);
42864: call_tests++;
42865: des_xmlBufferPtr(n_buf, buf, 0);
42866: des_int(n_compression, compression, 1);
42867: xmlResetLastError();
42868: if (mem_base != xmlMemBlocks()) {
42869: printf("Leak of %d blocks found in xmlNewTextWriterMemory",
42870: xmlMemBlocks() - mem_base);
42871: test_ret++;
42872: printf(" %d", n_buf);
42873: printf(" %d", n_compression);
42874: printf("\n");
42875: }
42876: }
42877: }
42878: function_tests++;
42879: #endif
42880:
42881: return(test_ret);
42882: }
42883:
42884:
42885: static int
42886: test_xmlNewTextWriterPushParser(void) {
42887: int test_ret = 0;
42888:
42889: #if defined(LIBXML_WRITER_ENABLED)
42890: int mem_base;
42891: xmlTextWriterPtr ret_val;
42892: xmlParserCtxtPtr ctxt; /* xmlParserCtxtPtr to hold the new XML document tree */
42893: int n_ctxt;
42894: int compression; /* compress the output? */
42895: int n_compression;
42896:
42897: for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
42898: for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
42899: mem_base = xmlMemBlocks();
42900: ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
42901: compression = gen_int(n_compression, 1);
42902:
42903: ret_val = xmlNewTextWriterPushParser(ctxt, compression);
42904: if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;} if (ret_val != NULL) ctxt = NULL;
42905: desret_xmlTextWriterPtr(ret_val);
42906: call_tests++;
42907: des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
42908: des_int(n_compression, compression, 1);
42909: xmlResetLastError();
42910: if (mem_base != xmlMemBlocks()) {
42911: printf("Leak of %d blocks found in xmlNewTextWriterPushParser",
42912: xmlMemBlocks() - mem_base);
42913: test_ret++;
42914: printf(" %d", n_ctxt);
42915: printf(" %d", n_compression);
42916: printf("\n");
42917: }
42918: }
42919: }
42920: function_tests++;
42921: #endif
42922:
42923: return(test_ret);
42924: }
42925:
42926:
42927: static int
42928: test_xmlNewTextWriterTree(void) {
42929: int test_ret = 0;
42930:
42931: #if defined(LIBXML_WRITER_ENABLED)
42932: int mem_base;
42933: xmlTextWriterPtr ret_val;
42934: xmlDocPtr doc; /* xmlDocPtr */
42935: int n_doc;
42936: xmlNodePtr node; /* xmlNodePtr or NULL for doc->children */
42937: int n_node;
42938: int compression; /* compress the output? */
42939: int n_compression;
42940:
42941: for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
42942: for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
42943: for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
42944: mem_base = xmlMemBlocks();
42945: doc = gen_xmlDocPtr(n_doc, 0);
42946: node = gen_xmlNodePtr(n_node, 1);
42947: compression = gen_int(n_compression, 2);
42948:
42949: ret_val = xmlNewTextWriterTree(doc, node, compression);
42950: desret_xmlTextWriterPtr(ret_val);
42951: call_tests++;
42952: des_xmlDocPtr(n_doc, doc, 0);
42953: des_xmlNodePtr(n_node, node, 1);
42954: des_int(n_compression, compression, 2);
42955: xmlResetLastError();
42956: if (mem_base != xmlMemBlocks()) {
42957: printf("Leak of %d blocks found in xmlNewTextWriterTree",
42958: xmlMemBlocks() - mem_base);
42959: test_ret++;
42960: printf(" %d", n_doc);
42961: printf(" %d", n_node);
42962: printf(" %d", n_compression);
42963: printf("\n");
42964: }
42965: }
42966: }
42967: }
42968: function_tests++;
42969: #endif
42970:
42971: return(test_ret);
42972: }
42973:
42974:
42975: static int
42976: test_xmlTextWriterEndAttribute(void) {
42977: int test_ret = 0;
42978:
42979: #if defined(LIBXML_WRITER_ENABLED)
42980: int mem_base;
42981: int ret_val;
42982: xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
42983: int n_writer;
42984:
42985: for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
42986: mem_base = xmlMemBlocks();
42987: writer = gen_xmlTextWriterPtr(n_writer, 0);
42988:
42989: ret_val = xmlTextWriterEndAttribute(writer);
42990: desret_int(ret_val);
42991: call_tests++;
42992: des_xmlTextWriterPtr(n_writer, writer, 0);
42993: xmlResetLastError();
42994: if (mem_base != xmlMemBlocks()) {
42995: printf("Leak of %d blocks found in xmlTextWriterEndAttribute",
42996: xmlMemBlocks() - mem_base);
42997: test_ret++;
42998: printf(" %d", n_writer);
42999: printf("\n");
43000: }
43001: }
43002: function_tests++;
43003: #endif
43004:
43005: return(test_ret);
43006: }
43007:
43008:
43009: static int
43010: test_xmlTextWriterEndCDATA(void) {
43011: int test_ret = 0;
43012:
43013: #if defined(LIBXML_WRITER_ENABLED)
43014: int mem_base;
43015: int ret_val;
43016: xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43017: int n_writer;
43018:
43019: for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43020: mem_base = xmlMemBlocks();
43021: writer = gen_xmlTextWriterPtr(n_writer, 0);
43022:
43023: ret_val = xmlTextWriterEndCDATA(writer);
43024: desret_int(ret_val);
43025: call_tests++;
43026: des_xmlTextWriterPtr(n_writer, writer, 0);
43027: xmlResetLastError();
43028: if (mem_base != xmlMemBlocks()) {
43029: printf("Leak of %d blocks found in xmlTextWriterEndCDATA",
43030: xmlMemBlocks() - mem_base);
43031: test_ret++;
43032: printf(" %d", n_writer);
43033: printf("\n");
43034: }
43035: }
43036: function_tests++;
43037: #endif
43038:
43039: return(test_ret);
43040: }
43041:
43042:
43043: static int
43044: test_xmlTextWriterEndComment(void) {
43045: int test_ret = 0;
43046:
43047: #if defined(LIBXML_WRITER_ENABLED)
43048: int mem_base;
43049: int ret_val;
43050: xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43051: int n_writer;
43052:
43053: for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43054: mem_base = xmlMemBlocks();
43055: writer = gen_xmlTextWriterPtr(n_writer, 0);
43056:
43057: ret_val = xmlTextWriterEndComment(writer);
43058: desret_int(ret_val);
43059: call_tests++;
43060: des_xmlTextWriterPtr(n_writer, writer, 0);
43061: xmlResetLastError();
43062: if (mem_base != xmlMemBlocks()) {
43063: printf("Leak of %d blocks found in xmlTextWriterEndComment",
43064: xmlMemBlocks() - mem_base);
43065: test_ret++;
43066: printf(" %d", n_writer);
43067: printf("\n");
43068: }
43069: }
43070: function_tests++;
43071: #endif
43072:
43073: return(test_ret);
43074: }
43075:
43076:
43077: static int
43078: test_xmlTextWriterEndDTD(void) {
43079: int test_ret = 0;
43080:
43081: #if defined(LIBXML_WRITER_ENABLED)
43082: int mem_base;
43083: int ret_val;
43084: xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43085: int n_writer;
43086:
43087: for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43088: mem_base = xmlMemBlocks();
43089: writer = gen_xmlTextWriterPtr(n_writer, 0);
43090:
43091: ret_val = xmlTextWriterEndDTD(writer);
43092: desret_int(ret_val);
43093: call_tests++;
43094: des_xmlTextWriterPtr(n_writer, writer, 0);
43095: xmlResetLastError();
43096: if (mem_base != xmlMemBlocks()) {
43097: printf("Leak of %d blocks found in xmlTextWriterEndDTD",
43098: xmlMemBlocks() - mem_base);
43099: test_ret++;
43100: printf(" %d", n_writer);
43101: printf("\n");
43102: }
43103: }
43104: function_tests++;
43105: #endif
43106:
43107: return(test_ret);
43108: }
43109:
43110:
43111: static int
43112: test_xmlTextWriterEndDTDAttlist(void) {
43113: int test_ret = 0;
43114:
43115: #if defined(LIBXML_WRITER_ENABLED)
43116: int mem_base;
43117: int ret_val;
43118: xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43119: int n_writer;
43120:
43121: for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43122: mem_base = xmlMemBlocks();
43123: writer = gen_xmlTextWriterPtr(n_writer, 0);
43124:
43125: ret_val = xmlTextWriterEndDTDAttlist(writer);
43126: desret_int(ret_val);
43127: call_tests++;
43128: des_xmlTextWriterPtr(n_writer, writer, 0);
43129: xmlResetLastError();
43130: if (mem_base != xmlMemBlocks()) {
43131: printf("Leak of %d blocks found in xmlTextWriterEndDTDAttlist",
43132: xmlMemBlocks() - mem_base);
43133: test_ret++;
43134: printf(" %d", n_writer);
43135: printf("\n");
43136: }
43137: }
43138: function_tests++;
43139: #endif
43140:
43141: return(test_ret);
43142: }
43143:
43144:
43145: static int
43146: test_xmlTextWriterEndDTDElement(void) {
43147: int test_ret = 0;
43148:
43149: #if defined(LIBXML_WRITER_ENABLED)
43150: int mem_base;
43151: int ret_val;
43152: xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43153: int n_writer;
43154:
43155: for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43156: mem_base = xmlMemBlocks();
43157: writer = gen_xmlTextWriterPtr(n_writer, 0);
43158:
43159: ret_val = xmlTextWriterEndDTDElement(writer);
43160: desret_int(ret_val);
43161: call_tests++;
43162: des_xmlTextWriterPtr(n_writer, writer, 0);
43163: xmlResetLastError();
43164: if (mem_base != xmlMemBlocks()) {
43165: printf("Leak of %d blocks found in xmlTextWriterEndDTDElement",
43166: xmlMemBlocks() - mem_base);
43167: test_ret++;
43168: printf(" %d", n_writer);
43169: printf("\n");
43170: }
43171: }
43172: function_tests++;
43173: #endif
43174:
43175: return(test_ret);
43176: }
43177:
43178:
43179: static int
43180: test_xmlTextWriterEndDTDEntity(void) {
43181: int test_ret = 0;
43182:
43183: #if defined(LIBXML_WRITER_ENABLED)
43184: int mem_base;
43185: int ret_val;
43186: xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43187: int n_writer;
43188:
43189: for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43190: mem_base = xmlMemBlocks();
43191: writer = gen_xmlTextWriterPtr(n_writer, 0);
43192:
43193: ret_val = xmlTextWriterEndDTDEntity(writer);
43194: desret_int(ret_val);
43195: call_tests++;
43196: des_xmlTextWriterPtr(n_writer, writer, 0);
43197: xmlResetLastError();
43198: if (mem_base != xmlMemBlocks()) {
43199: printf("Leak of %d blocks found in xmlTextWriterEndDTDEntity",
43200: xmlMemBlocks() - mem_base);
43201: test_ret++;
43202: printf(" %d", n_writer);
43203: printf("\n");
43204: }
43205: }
43206: function_tests++;
43207: #endif
43208:
43209: return(test_ret);
43210: }
43211:
43212:
43213: static int
43214: test_xmlTextWriterEndDocument(void) {
43215: int test_ret = 0;
43216:
43217: #if defined(LIBXML_WRITER_ENABLED)
43218: int mem_base;
43219: int ret_val;
43220: xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43221: int n_writer;
43222:
43223: for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43224: mem_base = xmlMemBlocks();
43225: writer = gen_xmlTextWriterPtr(n_writer, 0);
43226:
43227: ret_val = xmlTextWriterEndDocument(writer);
43228: desret_int(ret_val);
43229: call_tests++;
43230: des_xmlTextWriterPtr(n_writer, writer, 0);
43231: xmlResetLastError();
43232: if (mem_base != xmlMemBlocks()) {
43233: printf("Leak of %d blocks found in xmlTextWriterEndDocument",
43234: xmlMemBlocks() - mem_base);
43235: test_ret++;
43236: printf(" %d", n_writer);
43237: printf("\n");
43238: }
43239: }
43240: function_tests++;
43241: #endif
43242:
43243: return(test_ret);
43244: }
43245:
43246:
43247: static int
43248: test_xmlTextWriterEndElement(void) {
43249: int test_ret = 0;
43250:
43251: #if defined(LIBXML_WRITER_ENABLED)
43252: int mem_base;
43253: int ret_val;
43254: xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43255: int n_writer;
43256:
43257: for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43258: mem_base = xmlMemBlocks();
43259: writer = gen_xmlTextWriterPtr(n_writer, 0);
43260:
43261: ret_val = xmlTextWriterEndElement(writer);
43262: desret_int(ret_val);
43263: call_tests++;
43264: des_xmlTextWriterPtr(n_writer, writer, 0);
43265: xmlResetLastError();
43266: if (mem_base != xmlMemBlocks()) {
43267: printf("Leak of %d blocks found in xmlTextWriterEndElement",
43268: xmlMemBlocks() - mem_base);
43269: test_ret++;
43270: printf(" %d", n_writer);
43271: printf("\n");
43272: }
43273: }
43274: function_tests++;
43275: #endif
43276:
43277: return(test_ret);
43278: }
43279:
43280:
43281: static int
43282: test_xmlTextWriterEndPI(void) {
43283: int test_ret = 0;
43284:
43285: #if defined(LIBXML_WRITER_ENABLED)
43286: int mem_base;
43287: int ret_val;
43288: xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43289: int n_writer;
43290:
43291: for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43292: mem_base = xmlMemBlocks();
43293: writer = gen_xmlTextWriterPtr(n_writer, 0);
43294:
43295: ret_val = xmlTextWriterEndPI(writer);
43296: desret_int(ret_val);
43297: call_tests++;
43298: des_xmlTextWriterPtr(n_writer, writer, 0);
43299: xmlResetLastError();
43300: if (mem_base != xmlMemBlocks()) {
43301: printf("Leak of %d blocks found in xmlTextWriterEndPI",
43302: xmlMemBlocks() - mem_base);
43303: test_ret++;
43304: printf(" %d", n_writer);
43305: printf("\n");
43306: }
43307: }
43308: function_tests++;
43309: #endif
43310:
43311: return(test_ret);
43312: }
43313:
43314:
43315: static int
43316: test_xmlTextWriterFlush(void) {
43317: int test_ret = 0;
43318:
43319: #if defined(LIBXML_WRITER_ENABLED)
43320: int mem_base;
43321: int ret_val;
43322: xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43323: int n_writer;
43324:
43325: for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43326: mem_base = xmlMemBlocks();
43327: writer = gen_xmlTextWriterPtr(n_writer, 0);
43328:
43329: ret_val = xmlTextWriterFlush(writer);
43330: desret_int(ret_val);
43331: call_tests++;
43332: des_xmlTextWriterPtr(n_writer, writer, 0);
43333: xmlResetLastError();
43334: if (mem_base != xmlMemBlocks()) {
43335: printf("Leak of %d blocks found in xmlTextWriterFlush",
43336: xmlMemBlocks() - mem_base);
43337: test_ret++;
43338: printf(" %d", n_writer);
43339: printf("\n");
43340: }
43341: }
43342: function_tests++;
43343: #endif
43344:
43345: return(test_ret);
43346: }
43347:
43348:
43349: static int
43350: test_xmlTextWriterFullEndElement(void) {
43351: int test_ret = 0;
43352:
43353: #if defined(LIBXML_WRITER_ENABLED)
43354: int mem_base;
43355: int ret_val;
43356: xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43357: int n_writer;
43358:
43359: for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43360: mem_base = xmlMemBlocks();
43361: writer = gen_xmlTextWriterPtr(n_writer, 0);
43362:
43363: ret_val = xmlTextWriterFullEndElement(writer);
43364: desret_int(ret_val);
43365: call_tests++;
43366: des_xmlTextWriterPtr(n_writer, writer, 0);
43367: xmlResetLastError();
43368: if (mem_base != xmlMemBlocks()) {
43369: printf("Leak of %d blocks found in xmlTextWriterFullEndElement",
43370: xmlMemBlocks() - mem_base);
43371: test_ret++;
43372: printf(" %d", n_writer);
43373: printf("\n");
43374: }
43375: }
43376: function_tests++;
43377: #endif
43378:
43379: return(test_ret);
43380: }
43381:
43382:
43383: static int
43384: test_xmlTextWriterSetIndent(void) {
43385: int test_ret = 0;
43386:
43387: #if defined(LIBXML_WRITER_ENABLED)
43388: int mem_base;
43389: int ret_val;
43390: xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43391: int n_writer;
43392: int indent; /* do indentation? */
43393: int n_indent;
43394:
43395: for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43396: for (n_indent = 0;n_indent < gen_nb_int;n_indent++) {
43397: mem_base = xmlMemBlocks();
43398: writer = gen_xmlTextWriterPtr(n_writer, 0);
43399: indent = gen_int(n_indent, 1);
43400:
43401: ret_val = xmlTextWriterSetIndent(writer, indent);
43402: desret_int(ret_val);
43403: call_tests++;
43404: des_xmlTextWriterPtr(n_writer, writer, 0);
43405: des_int(n_indent, indent, 1);
43406: xmlResetLastError();
43407: if (mem_base != xmlMemBlocks()) {
43408: printf("Leak of %d blocks found in xmlTextWriterSetIndent",
43409: xmlMemBlocks() - mem_base);
43410: test_ret++;
43411: printf(" %d", n_writer);
43412: printf(" %d", n_indent);
43413: printf("\n");
43414: }
43415: }
43416: }
43417: function_tests++;
43418: #endif
43419:
43420: return(test_ret);
43421: }
43422:
43423:
43424: static int
43425: test_xmlTextWriterSetIndentString(void) {
43426: int test_ret = 0;
43427:
43428: #if defined(LIBXML_WRITER_ENABLED)
43429: int mem_base;
43430: int ret_val;
43431: xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43432: int n_writer;
43433: xmlChar * str; /* the xmlChar string */
43434: int n_str;
43435:
43436: for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43437: for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
43438: mem_base = xmlMemBlocks();
43439: writer = gen_xmlTextWriterPtr(n_writer, 0);
43440: str = gen_const_xmlChar_ptr(n_str, 1);
43441:
43442: ret_val = xmlTextWriterSetIndentString(writer, (const xmlChar *)str);
43443: desret_int(ret_val);
43444: call_tests++;
43445: des_xmlTextWriterPtr(n_writer, writer, 0);
43446: des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
43447: xmlResetLastError();
43448: if (mem_base != xmlMemBlocks()) {
43449: printf("Leak of %d blocks found in xmlTextWriterSetIndentString",
43450: xmlMemBlocks() - mem_base);
43451: test_ret++;
43452: printf(" %d", n_writer);
43453: printf(" %d", n_str);
43454: printf("\n");
43455: }
43456: }
43457: }
43458: function_tests++;
43459: #endif
43460:
43461: return(test_ret);
43462: }
43463:
43464:
43465: static int
43466: test_xmlTextWriterStartAttribute(void) {
43467: int test_ret = 0;
43468:
43469: #if defined(LIBXML_WRITER_ENABLED)
43470: int mem_base;
43471: int ret_val;
43472: xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43473: int n_writer;
43474: xmlChar * name; /* element name */
43475: int n_name;
43476:
43477: for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43478: for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43479: mem_base = xmlMemBlocks();
43480: writer = gen_xmlTextWriterPtr(n_writer, 0);
43481: name = gen_const_xmlChar_ptr(n_name, 1);
43482:
43483: ret_val = xmlTextWriterStartAttribute(writer, (const xmlChar *)name);
43484: desret_int(ret_val);
43485: call_tests++;
43486: des_xmlTextWriterPtr(n_writer, writer, 0);
43487: des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
43488: xmlResetLastError();
43489: if (mem_base != xmlMemBlocks()) {
43490: printf("Leak of %d blocks found in xmlTextWriterStartAttribute",
43491: xmlMemBlocks() - mem_base);
43492: test_ret++;
43493: printf(" %d", n_writer);
43494: printf(" %d", n_name);
43495: printf("\n");
43496: }
43497: }
43498: }
43499: function_tests++;
43500: #endif
43501:
43502: return(test_ret);
43503: }
43504:
43505:
43506: static int
43507: test_xmlTextWriterStartAttributeNS(void) {
43508: int test_ret = 0;
43509:
43510: #if defined(LIBXML_WRITER_ENABLED)
43511: int mem_base;
43512: int ret_val;
43513: xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43514: int n_writer;
43515: xmlChar * prefix; /* namespace prefix or NULL */
43516: int n_prefix;
43517: xmlChar * name; /* element local name */
43518: int n_name;
43519: xmlChar * namespaceURI; /* namespace URI or NULL */
43520: int n_namespaceURI;
43521:
43522: for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43523: for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
43524: for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43525: for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
43526: mem_base = xmlMemBlocks();
43527: writer = gen_xmlTextWriterPtr(n_writer, 0);
43528: prefix = gen_const_xmlChar_ptr(n_prefix, 1);
43529: name = gen_const_xmlChar_ptr(n_name, 2);
43530: namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3);
43531:
43532: ret_val = xmlTextWriterStartAttributeNS(writer, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)namespaceURI);
43533: desret_int(ret_val);
43534: call_tests++;
43535: des_xmlTextWriterPtr(n_writer, writer, 0);
43536: des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
43537: des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
43538: des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 3);
43539: xmlResetLastError();
43540: if (mem_base != xmlMemBlocks()) {
43541: printf("Leak of %d blocks found in xmlTextWriterStartAttributeNS",
43542: xmlMemBlocks() - mem_base);
43543: test_ret++;
43544: printf(" %d", n_writer);
43545: printf(" %d", n_prefix);
43546: printf(" %d", n_name);
43547: printf(" %d", n_namespaceURI);
43548: printf("\n");
43549: }
43550: }
43551: }
43552: }
43553: }
43554: function_tests++;
43555: #endif
43556:
43557: return(test_ret);
43558: }
43559:
43560:
43561: static int
43562: test_xmlTextWriterStartCDATA(void) {
43563: int test_ret = 0;
43564:
43565: #if defined(LIBXML_WRITER_ENABLED)
43566: int mem_base;
43567: int ret_val;
43568: xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43569: int n_writer;
43570:
43571: for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43572: mem_base = xmlMemBlocks();
43573: writer = gen_xmlTextWriterPtr(n_writer, 0);
43574:
43575: ret_val = xmlTextWriterStartCDATA(writer);
43576: desret_int(ret_val);
43577: call_tests++;
43578: des_xmlTextWriterPtr(n_writer, writer, 0);
43579: xmlResetLastError();
43580: if (mem_base != xmlMemBlocks()) {
43581: printf("Leak of %d blocks found in xmlTextWriterStartCDATA",
43582: xmlMemBlocks() - mem_base);
43583: test_ret++;
43584: printf(" %d", n_writer);
43585: printf("\n");
43586: }
43587: }
43588: function_tests++;
43589: #endif
43590:
43591: return(test_ret);
43592: }
43593:
43594:
43595: static int
43596: test_xmlTextWriterStartComment(void) {
43597: int test_ret = 0;
43598:
43599: #if defined(LIBXML_WRITER_ENABLED)
43600: int mem_base;
43601: int ret_val;
43602: xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43603: int n_writer;
43604:
43605: for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43606: mem_base = xmlMemBlocks();
43607: writer = gen_xmlTextWriterPtr(n_writer, 0);
43608:
43609: ret_val = xmlTextWriterStartComment(writer);
43610: desret_int(ret_val);
43611: call_tests++;
43612: des_xmlTextWriterPtr(n_writer, writer, 0);
43613: xmlResetLastError();
43614: if (mem_base != xmlMemBlocks()) {
43615: printf("Leak of %d blocks found in xmlTextWriterStartComment",
43616: xmlMemBlocks() - mem_base);
43617: test_ret++;
43618: printf(" %d", n_writer);
43619: printf("\n");
43620: }
43621: }
43622: function_tests++;
43623: #endif
43624:
43625: return(test_ret);
43626: }
43627:
43628:
43629: static int
43630: test_xmlTextWriterStartDTD(void) {
43631: int test_ret = 0;
43632:
43633: #if defined(LIBXML_WRITER_ENABLED)
43634: int mem_base;
43635: int ret_val;
43636: xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43637: int n_writer;
43638: xmlChar * name; /* the name of the DTD */
43639: int n_name;
43640: xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
43641: int n_pubid;
43642: xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
43643: int n_sysid;
43644:
43645: for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43646: for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43647: for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
43648: for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
43649: mem_base = xmlMemBlocks();
43650: writer = gen_xmlTextWriterPtr(n_writer, 0);
43651: name = gen_const_xmlChar_ptr(n_name, 1);
43652: pubid = gen_const_xmlChar_ptr(n_pubid, 2);
43653: sysid = gen_const_xmlChar_ptr(n_sysid, 3);
43654:
43655: ret_val = xmlTextWriterStartDTD(writer, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid);
43656: desret_int(ret_val);
43657: call_tests++;
43658: des_xmlTextWriterPtr(n_writer, writer, 0);
43659: des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
43660: des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 2);
43661: des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 3);
43662: xmlResetLastError();
43663: if (mem_base != xmlMemBlocks()) {
43664: printf("Leak of %d blocks found in xmlTextWriterStartDTD",
43665: xmlMemBlocks() - mem_base);
43666: test_ret++;
43667: printf(" %d", n_writer);
43668: printf(" %d", n_name);
43669: printf(" %d", n_pubid);
43670: printf(" %d", n_sysid);
43671: printf("\n");
43672: }
43673: }
43674: }
43675: }
43676: }
43677: function_tests++;
43678: #endif
43679:
43680: return(test_ret);
43681: }
43682:
43683:
43684: static int
43685: test_xmlTextWriterStartDTDAttlist(void) {
43686: int test_ret = 0;
43687:
43688: #if defined(LIBXML_WRITER_ENABLED)
43689: int mem_base;
43690: int ret_val;
43691: xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43692: int n_writer;
43693: xmlChar * name; /* the name of the DTD ATTLIST */
43694: int n_name;
43695:
43696: for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43697: for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43698: mem_base = xmlMemBlocks();
43699: writer = gen_xmlTextWriterPtr(n_writer, 0);
43700: name = gen_const_xmlChar_ptr(n_name, 1);
43701:
43702: ret_val = xmlTextWriterStartDTDAttlist(writer, (const xmlChar *)name);
43703: desret_int(ret_val);
43704: call_tests++;
43705: des_xmlTextWriterPtr(n_writer, writer, 0);
43706: des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
43707: xmlResetLastError();
43708: if (mem_base != xmlMemBlocks()) {
43709: printf("Leak of %d blocks found in xmlTextWriterStartDTDAttlist",
43710: xmlMemBlocks() - mem_base);
43711: test_ret++;
43712: printf(" %d", n_writer);
43713: printf(" %d", n_name);
43714: printf("\n");
43715: }
43716: }
43717: }
43718: function_tests++;
43719: #endif
43720:
43721: return(test_ret);
43722: }
43723:
43724:
43725: static int
43726: test_xmlTextWriterStartDTDElement(void) {
43727: int test_ret = 0;
43728:
43729: #if defined(LIBXML_WRITER_ENABLED)
43730: int mem_base;
43731: int ret_val;
43732: xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43733: int n_writer;
43734: xmlChar * name; /* the name of the DTD element */
43735: int n_name;
43736:
43737: for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43738: for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43739: mem_base = xmlMemBlocks();
43740: writer = gen_xmlTextWriterPtr(n_writer, 0);
43741: name = gen_const_xmlChar_ptr(n_name, 1);
43742:
43743: ret_val = xmlTextWriterStartDTDElement(writer, (const xmlChar *)name);
43744: desret_int(ret_val);
43745: call_tests++;
43746: des_xmlTextWriterPtr(n_writer, writer, 0);
43747: des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
43748: xmlResetLastError();
43749: if (mem_base != xmlMemBlocks()) {
43750: printf("Leak of %d blocks found in xmlTextWriterStartDTDElement",
43751: xmlMemBlocks() - mem_base);
43752: test_ret++;
43753: printf(" %d", n_writer);
43754: printf(" %d", n_name);
43755: printf("\n");
43756: }
43757: }
43758: }
43759: function_tests++;
43760: #endif
43761:
43762: return(test_ret);
43763: }
43764:
43765:
43766: static int
43767: test_xmlTextWriterStartDTDEntity(void) {
43768: int test_ret = 0;
43769:
43770: #if defined(LIBXML_WRITER_ENABLED)
43771: int mem_base;
43772: int ret_val;
43773: xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43774: int n_writer;
43775: int pe; /* TRUE if this is a parameter entity, FALSE if not */
43776: int n_pe;
43777: xmlChar * name; /* the name of the DTD ATTLIST */
43778: int n_name;
43779:
43780: for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43781: for (n_pe = 0;n_pe < gen_nb_int;n_pe++) {
43782: for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43783: mem_base = xmlMemBlocks();
43784: writer = gen_xmlTextWriterPtr(n_writer, 0);
43785: pe = gen_int(n_pe, 1);
43786: name = gen_const_xmlChar_ptr(n_name, 2);
43787:
43788: ret_val = xmlTextWriterStartDTDEntity(writer, pe, (const xmlChar *)name);
43789: desret_int(ret_val);
43790: call_tests++;
43791: des_xmlTextWriterPtr(n_writer, writer, 0);
43792: des_int(n_pe, pe, 1);
43793: des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
43794: xmlResetLastError();
43795: if (mem_base != xmlMemBlocks()) {
43796: printf("Leak of %d blocks found in xmlTextWriterStartDTDEntity",
43797: xmlMemBlocks() - mem_base);
43798: test_ret++;
43799: printf(" %d", n_writer);
43800: printf(" %d", n_pe);
43801: printf(" %d", n_name);
43802: printf("\n");
43803: }
43804: }
43805: }
43806: }
43807: function_tests++;
43808: #endif
43809:
43810: return(test_ret);
43811: }
43812:
43813:
43814: static int
43815: test_xmlTextWriterStartDocument(void) {
43816: int test_ret = 0;
43817:
43818: #if defined(LIBXML_WRITER_ENABLED)
43819: int mem_base;
43820: int ret_val;
43821: xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43822: int n_writer;
43823: char * version; /* the xml version ("1.0") or NULL for default ("1.0") */
43824: int n_version;
43825: char * encoding; /* the encoding or NULL for default */
43826: int n_encoding;
43827: char * standalone; /* "yes" or "no" or NULL for default */
43828: int n_standalone;
43829:
43830: for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43831: for (n_version = 0;n_version < gen_nb_const_char_ptr;n_version++) {
43832: for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
43833: for (n_standalone = 0;n_standalone < gen_nb_const_char_ptr;n_standalone++) {
43834: mem_base = xmlMemBlocks();
43835: writer = gen_xmlTextWriterPtr(n_writer, 0);
43836: version = gen_const_char_ptr(n_version, 1);
43837: encoding = gen_const_char_ptr(n_encoding, 2);
43838: standalone = gen_const_char_ptr(n_standalone, 3);
43839:
43840: ret_val = xmlTextWriterStartDocument(writer, (const char *)version, (const char *)encoding, (const char *)standalone);
43841: desret_int(ret_val);
43842: call_tests++;
43843: des_xmlTextWriterPtr(n_writer, writer, 0);
43844: des_const_char_ptr(n_version, (const char *)version, 1);
43845: des_const_char_ptr(n_encoding, (const char *)encoding, 2);
43846: des_const_char_ptr(n_standalone, (const char *)standalone, 3);
43847: xmlResetLastError();
43848: if (mem_base != xmlMemBlocks()) {
43849: printf("Leak of %d blocks found in xmlTextWriterStartDocument",
43850: xmlMemBlocks() - mem_base);
43851: test_ret++;
43852: printf(" %d", n_writer);
43853: printf(" %d", n_version);
43854: printf(" %d", n_encoding);
43855: printf(" %d", n_standalone);
43856: printf("\n");
43857: }
43858: }
43859: }
43860: }
43861: }
43862: function_tests++;
43863: #endif
43864:
43865: return(test_ret);
43866: }
43867:
43868:
43869: static int
43870: test_xmlTextWriterStartElement(void) {
43871: int test_ret = 0;
43872:
43873: #if defined(LIBXML_WRITER_ENABLED)
43874: int mem_base;
43875: int ret_val;
43876: xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43877: int n_writer;
43878: xmlChar * name; /* element name */
43879: int n_name;
43880:
43881: for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43882: for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43883: mem_base = xmlMemBlocks();
43884: writer = gen_xmlTextWriterPtr(n_writer, 0);
43885: name = gen_const_xmlChar_ptr(n_name, 1);
43886:
43887: ret_val = xmlTextWriterStartElement(writer, (const xmlChar *)name);
43888: desret_int(ret_val);
43889: call_tests++;
43890: des_xmlTextWriterPtr(n_writer, writer, 0);
43891: des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
43892: xmlResetLastError();
43893: if (mem_base != xmlMemBlocks()) {
43894: printf("Leak of %d blocks found in xmlTextWriterStartElement",
43895: xmlMemBlocks() - mem_base);
43896: test_ret++;
43897: printf(" %d", n_writer);
43898: printf(" %d", n_name);
43899: printf("\n");
43900: }
43901: }
43902: }
43903: function_tests++;
43904: #endif
43905:
43906: return(test_ret);
43907: }
43908:
43909:
43910: static int
43911: test_xmlTextWriterStartElementNS(void) {
43912: int test_ret = 0;
43913:
43914: #if defined(LIBXML_WRITER_ENABLED)
43915: int mem_base;
43916: int ret_val;
43917: xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43918: int n_writer;
43919: xmlChar * prefix; /* namespace prefix or NULL */
43920: int n_prefix;
43921: xmlChar * name; /* element local name */
43922: int n_name;
43923: xmlChar * namespaceURI; /* namespace URI or NULL */
43924: int n_namespaceURI;
43925:
43926: for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43927: for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
43928: for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43929: for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
43930: mem_base = xmlMemBlocks();
43931: writer = gen_xmlTextWriterPtr(n_writer, 0);
43932: prefix = gen_const_xmlChar_ptr(n_prefix, 1);
43933: name = gen_const_xmlChar_ptr(n_name, 2);
43934: namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3);
43935:
43936: ret_val = xmlTextWriterStartElementNS(writer, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)namespaceURI);
43937: desret_int(ret_val);
43938: call_tests++;
43939: des_xmlTextWriterPtr(n_writer, writer, 0);
43940: des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
43941: des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
43942: des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 3);
43943: xmlResetLastError();
43944: if (mem_base != xmlMemBlocks()) {
43945: printf("Leak of %d blocks found in xmlTextWriterStartElementNS",
43946: xmlMemBlocks() - mem_base);
43947: test_ret++;
43948: printf(" %d", n_writer);
43949: printf(" %d", n_prefix);
43950: printf(" %d", n_name);
43951: printf(" %d", n_namespaceURI);
43952: printf("\n");
43953: }
43954: }
43955: }
43956: }
43957: }
43958: function_tests++;
43959: #endif
43960:
43961: return(test_ret);
43962: }
43963:
43964:
43965: static int
43966: test_xmlTextWriterStartPI(void) {
43967: int test_ret = 0;
43968:
43969: #if defined(LIBXML_WRITER_ENABLED)
43970: int mem_base;
43971: int ret_val;
43972: xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43973: int n_writer;
43974: xmlChar * target; /* PI target */
43975: int n_target;
43976:
43977: for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43978: for (n_target = 0;n_target < gen_nb_const_xmlChar_ptr;n_target++) {
43979: mem_base = xmlMemBlocks();
43980: writer = gen_xmlTextWriterPtr(n_writer, 0);
43981: target = gen_const_xmlChar_ptr(n_target, 1);
43982:
43983: ret_val = xmlTextWriterStartPI(writer, (const xmlChar *)target);
43984: desret_int(ret_val);
43985: call_tests++;
43986: des_xmlTextWriterPtr(n_writer, writer, 0);
43987: des_const_xmlChar_ptr(n_target, (const xmlChar *)target, 1);
43988: xmlResetLastError();
43989: if (mem_base != xmlMemBlocks()) {
43990: printf("Leak of %d blocks found in xmlTextWriterStartPI",
43991: xmlMemBlocks() - mem_base);
43992: test_ret++;
43993: printf(" %d", n_writer);
43994: printf(" %d", n_target);
43995: printf("\n");
43996: }
43997: }
43998: }
43999: function_tests++;
44000: #endif
44001:
44002: return(test_ret);
44003: }
44004:
44005:
44006: static int
44007: test_xmlTextWriterWriteAttribute(void) {
44008: int test_ret = 0;
44009:
44010: #if defined(LIBXML_WRITER_ENABLED)
44011: int mem_base;
44012: int ret_val;
44013: xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44014: int n_writer;
44015: xmlChar * name; /* attribute name */
44016: int n_name;
44017: xmlChar * content; /* attribute content */
44018: int n_content;
44019:
44020: for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44021: for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44022: for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44023: mem_base = xmlMemBlocks();
44024: writer = gen_xmlTextWriterPtr(n_writer, 0);
44025: name = gen_const_xmlChar_ptr(n_name, 1);
44026: content = gen_const_xmlChar_ptr(n_content, 2);
44027:
44028: ret_val = xmlTextWriterWriteAttribute(writer, (const xmlChar *)name, (const xmlChar *)content);
44029: desret_int(ret_val);
44030: call_tests++;
44031: des_xmlTextWriterPtr(n_writer, writer, 0);
44032: des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
44033: des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
44034: xmlResetLastError();
44035: if (mem_base != xmlMemBlocks()) {
44036: printf("Leak of %d blocks found in xmlTextWriterWriteAttribute",
44037: xmlMemBlocks() - mem_base);
44038: test_ret++;
44039: printf(" %d", n_writer);
44040: printf(" %d", n_name);
44041: printf(" %d", n_content);
44042: printf("\n");
44043: }
44044: }
44045: }
44046: }
44047: function_tests++;
44048: #endif
44049:
44050: return(test_ret);
44051: }
44052:
44053:
44054: static int
44055: test_xmlTextWriterWriteAttributeNS(void) {
44056: int test_ret = 0;
44057:
44058: #if defined(LIBXML_WRITER_ENABLED)
44059: int mem_base;
44060: int ret_val;
44061: xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44062: int n_writer;
44063: xmlChar * prefix; /* namespace prefix */
44064: int n_prefix;
44065: xmlChar * name; /* attribute local name */
44066: int n_name;
44067: xmlChar * namespaceURI; /* namespace URI */
44068: int n_namespaceURI;
44069: xmlChar * content; /* attribute content */
44070: int n_content;
44071:
44072: for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44073: for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
44074: for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44075: for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
44076: for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44077: mem_base = xmlMemBlocks();
44078: writer = gen_xmlTextWriterPtr(n_writer, 0);
44079: prefix = gen_const_xmlChar_ptr(n_prefix, 1);
44080: name = gen_const_xmlChar_ptr(n_name, 2);
44081: namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3);
44082: content = gen_const_xmlChar_ptr(n_content, 4);
44083:
44084: ret_val = xmlTextWriterWriteAttributeNS(writer, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)namespaceURI, (const xmlChar *)content);
44085: desret_int(ret_val);
44086: call_tests++;
44087: des_xmlTextWriterPtr(n_writer, writer, 0);
44088: des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
44089: des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
44090: des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 3);
44091: des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 4);
44092: xmlResetLastError();
44093: if (mem_base != xmlMemBlocks()) {
44094: printf("Leak of %d blocks found in xmlTextWriterWriteAttributeNS",
44095: xmlMemBlocks() - mem_base);
44096: test_ret++;
44097: printf(" %d", n_writer);
44098: printf(" %d", n_prefix);
44099: printf(" %d", n_name);
44100: printf(" %d", n_namespaceURI);
44101: printf(" %d", n_content);
44102: printf("\n");
44103: }
44104: }
44105: }
44106: }
44107: }
44108: }
44109: function_tests++;
44110: #endif
44111:
44112: return(test_ret);
44113: }
44114:
44115:
44116: static int
44117: test_xmlTextWriterWriteBase64(void) {
44118: int test_ret = 0;
44119:
44120: #if defined(LIBXML_WRITER_ENABLED)
44121: int mem_base;
44122: int ret_val;
44123: xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44124: int n_writer;
44125: char * data; /* binary data */
44126: int n_data;
44127: int start; /* the position within the data of the first byte to encode */
44128: int n_start;
44129: int len; /* the number of bytes to encode */
44130: int n_len;
44131:
44132: for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44133: for (n_data = 0;n_data < gen_nb_const_char_ptr;n_data++) {
44134: for (n_start = 0;n_start < gen_nb_int;n_start++) {
44135: for (n_len = 0;n_len < gen_nb_int;n_len++) {
44136: mem_base = xmlMemBlocks();
44137: writer = gen_xmlTextWriterPtr(n_writer, 0);
44138: data = gen_const_char_ptr(n_data, 1);
44139: start = gen_int(n_start, 2);
44140: len = gen_int(n_len, 3);
44141:
44142: ret_val = xmlTextWriterWriteBase64(writer, (const char *)data, start, len);
44143: desret_int(ret_val);
44144: call_tests++;
44145: des_xmlTextWriterPtr(n_writer, writer, 0);
44146: des_const_char_ptr(n_data, (const char *)data, 1);
44147: des_int(n_start, start, 2);
44148: des_int(n_len, len, 3);
44149: xmlResetLastError();
44150: if (mem_base != xmlMemBlocks()) {
44151: printf("Leak of %d blocks found in xmlTextWriterWriteBase64",
44152: xmlMemBlocks() - mem_base);
44153: test_ret++;
44154: printf(" %d", n_writer);
44155: printf(" %d", n_data);
44156: printf(" %d", n_start);
44157: printf(" %d", n_len);
44158: printf("\n");
44159: }
44160: }
44161: }
44162: }
44163: }
44164: function_tests++;
44165: #endif
44166:
44167: return(test_ret);
44168: }
44169:
44170:
44171: static int
44172: test_xmlTextWriterWriteBinHex(void) {
44173: int test_ret = 0;
44174:
44175: #if defined(LIBXML_WRITER_ENABLED)
44176: int mem_base;
44177: int ret_val;
44178: xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44179: int n_writer;
44180: char * data; /* binary data */
44181: int n_data;
44182: int start; /* the position within the data of the first byte to encode */
44183: int n_start;
44184: int len; /* the number of bytes to encode */
44185: int n_len;
44186:
44187: for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44188: for (n_data = 0;n_data < gen_nb_const_char_ptr;n_data++) {
44189: for (n_start = 0;n_start < gen_nb_int;n_start++) {
44190: for (n_len = 0;n_len < gen_nb_int;n_len++) {
44191: mem_base = xmlMemBlocks();
44192: writer = gen_xmlTextWriterPtr(n_writer, 0);
44193: data = gen_const_char_ptr(n_data, 1);
44194: start = gen_int(n_start, 2);
44195: len = gen_int(n_len, 3);
44196:
44197: ret_val = xmlTextWriterWriteBinHex(writer, (const char *)data, start, len);
44198: desret_int(ret_val);
44199: call_tests++;
44200: des_xmlTextWriterPtr(n_writer, writer, 0);
44201: des_const_char_ptr(n_data, (const char *)data, 1);
44202: des_int(n_start, start, 2);
44203: des_int(n_len, len, 3);
44204: xmlResetLastError();
44205: if (mem_base != xmlMemBlocks()) {
44206: printf("Leak of %d blocks found in xmlTextWriterWriteBinHex",
44207: xmlMemBlocks() - mem_base);
44208: test_ret++;
44209: printf(" %d", n_writer);
44210: printf(" %d", n_data);
44211: printf(" %d", n_start);
44212: printf(" %d", n_len);
44213: printf("\n");
44214: }
44215: }
44216: }
44217: }
44218: }
44219: function_tests++;
44220: #endif
44221:
44222: return(test_ret);
44223: }
44224:
44225:
44226: static int
44227: test_xmlTextWriterWriteCDATA(void) {
44228: int test_ret = 0;
44229:
44230: #if defined(LIBXML_WRITER_ENABLED)
44231: int mem_base;
44232: int ret_val;
44233: xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44234: int n_writer;
44235: xmlChar * content; /* CDATA content */
44236: int n_content;
44237:
44238: for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44239: for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44240: mem_base = xmlMemBlocks();
44241: writer = gen_xmlTextWriterPtr(n_writer, 0);
44242: content = gen_const_xmlChar_ptr(n_content, 1);
44243:
44244: ret_val = xmlTextWriterWriteCDATA(writer, (const xmlChar *)content);
44245: desret_int(ret_val);
44246: call_tests++;
44247: des_xmlTextWriterPtr(n_writer, writer, 0);
44248: des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
44249: xmlResetLastError();
44250: if (mem_base != xmlMemBlocks()) {
44251: printf("Leak of %d blocks found in xmlTextWriterWriteCDATA",
44252: xmlMemBlocks() - mem_base);
44253: test_ret++;
44254: printf(" %d", n_writer);
44255: printf(" %d", n_content);
44256: printf("\n");
44257: }
44258: }
44259: }
44260: function_tests++;
44261: #endif
44262:
44263: return(test_ret);
44264: }
44265:
44266:
44267: static int
44268: test_xmlTextWriterWriteComment(void) {
44269: int test_ret = 0;
44270:
44271: #if defined(LIBXML_WRITER_ENABLED)
44272: int mem_base;
44273: int ret_val;
44274: xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44275: int n_writer;
44276: xmlChar * content; /* comment string */
44277: int n_content;
44278:
44279: for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44280: for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44281: mem_base = xmlMemBlocks();
44282: writer = gen_xmlTextWriterPtr(n_writer, 0);
44283: content = gen_const_xmlChar_ptr(n_content, 1);
44284:
44285: ret_val = xmlTextWriterWriteComment(writer, (const xmlChar *)content);
44286: desret_int(ret_val);
44287: call_tests++;
44288: des_xmlTextWriterPtr(n_writer, writer, 0);
44289: des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
44290: xmlResetLastError();
44291: if (mem_base != xmlMemBlocks()) {
44292: printf("Leak of %d blocks found in xmlTextWriterWriteComment",
44293: xmlMemBlocks() - mem_base);
44294: test_ret++;
44295: printf(" %d", n_writer);
44296: printf(" %d", n_content);
44297: printf("\n");
44298: }
44299: }
44300: }
44301: function_tests++;
44302: #endif
44303:
44304: return(test_ret);
44305: }
44306:
44307:
44308: static int
44309: test_xmlTextWriterWriteDTD(void) {
44310: int test_ret = 0;
44311:
44312: #if defined(LIBXML_WRITER_ENABLED)
44313: int mem_base;
44314: int ret_val;
44315: xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44316: int n_writer;
44317: xmlChar * name; /* the name of the DTD */
44318: int n_name;
44319: xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
44320: int n_pubid;
44321: xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
44322: int n_sysid;
44323: xmlChar * subset; /* string content of the DTD */
44324: int n_subset;
44325:
44326: for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44327: for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44328: for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
44329: for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
44330: for (n_subset = 0;n_subset < gen_nb_const_xmlChar_ptr;n_subset++) {
44331: mem_base = xmlMemBlocks();
44332: writer = gen_xmlTextWriterPtr(n_writer, 0);
44333: name = gen_const_xmlChar_ptr(n_name, 1);
44334: pubid = gen_const_xmlChar_ptr(n_pubid, 2);
44335: sysid = gen_const_xmlChar_ptr(n_sysid, 3);
44336: subset = gen_const_xmlChar_ptr(n_subset, 4);
44337:
44338: ret_val = xmlTextWriterWriteDTD(writer, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid, (const xmlChar *)subset);
44339: desret_int(ret_val);
44340: call_tests++;
44341: des_xmlTextWriterPtr(n_writer, writer, 0);
44342: des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
44343: des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 2);
44344: des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 3);
44345: des_const_xmlChar_ptr(n_subset, (const xmlChar *)subset, 4);
44346: xmlResetLastError();
44347: if (mem_base != xmlMemBlocks()) {
44348: printf("Leak of %d blocks found in xmlTextWriterWriteDTD",
44349: xmlMemBlocks() - mem_base);
44350: test_ret++;
44351: printf(" %d", n_writer);
44352: printf(" %d", n_name);
44353: printf(" %d", n_pubid);
44354: printf(" %d", n_sysid);
44355: printf(" %d", n_subset);
44356: printf("\n");
44357: }
44358: }
44359: }
44360: }
44361: }
44362: }
44363: function_tests++;
44364: #endif
44365:
44366: return(test_ret);
44367: }
44368:
44369:
44370: static int
44371: test_xmlTextWriterWriteDTDAttlist(void) {
44372: int test_ret = 0;
44373:
44374: #if defined(LIBXML_WRITER_ENABLED)
44375: int mem_base;
44376: int ret_val;
44377: xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44378: int n_writer;
44379: xmlChar * name; /* the name of the DTD ATTLIST */
44380: int n_name;
44381: xmlChar * content; /* content of the ATTLIST */
44382: int n_content;
44383:
44384: for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44385: for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44386: for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44387: mem_base = xmlMemBlocks();
44388: writer = gen_xmlTextWriterPtr(n_writer, 0);
44389: name = gen_const_xmlChar_ptr(n_name, 1);
44390: content = gen_const_xmlChar_ptr(n_content, 2);
44391:
44392: ret_val = xmlTextWriterWriteDTDAttlist(writer, (const xmlChar *)name, (const xmlChar *)content);
44393: desret_int(ret_val);
44394: call_tests++;
44395: des_xmlTextWriterPtr(n_writer, writer, 0);
44396: des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
44397: des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
44398: xmlResetLastError();
44399: if (mem_base != xmlMemBlocks()) {
44400: printf("Leak of %d blocks found in xmlTextWriterWriteDTDAttlist",
44401: xmlMemBlocks() - mem_base);
44402: test_ret++;
44403: printf(" %d", n_writer);
44404: printf(" %d", n_name);
44405: printf(" %d", n_content);
44406: printf("\n");
44407: }
44408: }
44409: }
44410: }
44411: function_tests++;
44412: #endif
44413:
44414: return(test_ret);
44415: }
44416:
44417:
44418: static int
44419: test_xmlTextWriterWriteDTDElement(void) {
44420: int test_ret = 0;
44421:
44422: #if defined(LIBXML_WRITER_ENABLED)
44423: int mem_base;
44424: int ret_val;
44425: xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44426: int n_writer;
44427: xmlChar * name; /* the name of the DTD element */
44428: int n_name;
44429: xmlChar * content; /* content of the element */
44430: int n_content;
44431:
44432: for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44433: for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44434: for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44435: mem_base = xmlMemBlocks();
44436: writer = gen_xmlTextWriterPtr(n_writer, 0);
44437: name = gen_const_xmlChar_ptr(n_name, 1);
44438: content = gen_const_xmlChar_ptr(n_content, 2);
44439:
44440: ret_val = xmlTextWriterWriteDTDElement(writer, (const xmlChar *)name, (const xmlChar *)content);
44441: desret_int(ret_val);
44442: call_tests++;
44443: des_xmlTextWriterPtr(n_writer, writer, 0);
44444: des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
44445: des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
44446: xmlResetLastError();
44447: if (mem_base != xmlMemBlocks()) {
44448: printf("Leak of %d blocks found in xmlTextWriterWriteDTDElement",
44449: xmlMemBlocks() - mem_base);
44450: test_ret++;
44451: printf(" %d", n_writer);
44452: printf(" %d", n_name);
44453: printf(" %d", n_content);
44454: printf("\n");
44455: }
44456: }
44457: }
44458: }
44459: function_tests++;
44460: #endif
44461:
44462: return(test_ret);
44463: }
44464:
44465:
44466: static int
44467: test_xmlTextWriterWriteDTDEntity(void) {
44468: int test_ret = 0;
44469:
44470: #if defined(LIBXML_WRITER_ENABLED)
44471: int mem_base;
44472: int ret_val;
44473: xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44474: int n_writer;
44475: int pe; /* TRUE if this is a parameter entity, FALSE if not */
44476: int n_pe;
44477: xmlChar * name; /* the name of the DTD entity */
44478: int n_name;
44479: xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
44480: int n_pubid;
44481: xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
44482: int n_sysid;
44483: xmlChar * ndataid; /* the xml notation name. */
44484: int n_ndataid;
44485: xmlChar * content; /* content of the entity */
44486: int n_content;
44487:
44488: for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44489: for (n_pe = 0;n_pe < gen_nb_int;n_pe++) {
44490: for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44491: for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
44492: for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
44493: for (n_ndataid = 0;n_ndataid < gen_nb_const_xmlChar_ptr;n_ndataid++) {
44494: for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44495: mem_base = xmlMemBlocks();
44496: writer = gen_xmlTextWriterPtr(n_writer, 0);
44497: pe = gen_int(n_pe, 1);
44498: name = gen_const_xmlChar_ptr(n_name, 2);
44499: pubid = gen_const_xmlChar_ptr(n_pubid, 3);
44500: sysid = gen_const_xmlChar_ptr(n_sysid, 4);
44501: ndataid = gen_const_xmlChar_ptr(n_ndataid, 5);
44502: content = gen_const_xmlChar_ptr(n_content, 6);
44503:
44504: ret_val = xmlTextWriterWriteDTDEntity(writer, pe, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid, (const xmlChar *)ndataid, (const xmlChar *)content);
44505: desret_int(ret_val);
44506: call_tests++;
44507: des_xmlTextWriterPtr(n_writer, writer, 0);
44508: des_int(n_pe, pe, 1);
44509: des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
44510: des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 3);
44511: des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 4);
44512: des_const_xmlChar_ptr(n_ndataid, (const xmlChar *)ndataid, 5);
44513: des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 6);
44514: xmlResetLastError();
44515: if (mem_base != xmlMemBlocks()) {
44516: printf("Leak of %d blocks found in xmlTextWriterWriteDTDEntity",
44517: xmlMemBlocks() - mem_base);
44518: test_ret++;
44519: printf(" %d", n_writer);
44520: printf(" %d", n_pe);
44521: printf(" %d", n_name);
44522: printf(" %d", n_pubid);
44523: printf(" %d", n_sysid);
44524: printf(" %d", n_ndataid);
44525: printf(" %d", n_content);
44526: printf("\n");
44527: }
44528: }
44529: }
44530: }
44531: }
44532: }
44533: }
44534: }
44535: function_tests++;
44536: #endif
44537:
44538: return(test_ret);
44539: }
44540:
44541:
44542: static int
44543: test_xmlTextWriterWriteDTDExternalEntity(void) {
44544: int test_ret = 0;
44545:
44546: #if defined(LIBXML_WRITER_ENABLED)
44547: int mem_base;
44548: int ret_val;
44549: xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44550: int n_writer;
44551: int pe; /* TRUE if this is a parameter entity, FALSE if not */
44552: int n_pe;
44553: xmlChar * name; /* the name of the DTD entity */
44554: int n_name;
44555: xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
44556: int n_pubid;
44557: xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
44558: int n_sysid;
44559: xmlChar * ndataid; /* the xml notation name. */
44560: int n_ndataid;
44561:
44562: for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44563: for (n_pe = 0;n_pe < gen_nb_int;n_pe++) {
44564: for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44565: for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
44566: for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
44567: for (n_ndataid = 0;n_ndataid < gen_nb_const_xmlChar_ptr;n_ndataid++) {
44568: mem_base = xmlMemBlocks();
44569: writer = gen_xmlTextWriterPtr(n_writer, 0);
44570: pe = gen_int(n_pe, 1);
44571: name = gen_const_xmlChar_ptr(n_name, 2);
44572: pubid = gen_const_xmlChar_ptr(n_pubid, 3);
44573: sysid = gen_const_xmlChar_ptr(n_sysid, 4);
44574: ndataid = gen_const_xmlChar_ptr(n_ndataid, 5);
44575:
44576: ret_val = xmlTextWriterWriteDTDExternalEntity(writer, pe, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid, (const xmlChar *)ndataid);
44577: desret_int(ret_val);
44578: call_tests++;
44579: des_xmlTextWriterPtr(n_writer, writer, 0);
44580: des_int(n_pe, pe, 1);
44581: des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
44582: des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 3);
44583: des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 4);
44584: des_const_xmlChar_ptr(n_ndataid, (const xmlChar *)ndataid, 5);
44585: xmlResetLastError();
44586: if (mem_base != xmlMemBlocks()) {
44587: printf("Leak of %d blocks found in xmlTextWriterWriteDTDExternalEntity",
44588: xmlMemBlocks() - mem_base);
44589: test_ret++;
44590: printf(" %d", n_writer);
44591: printf(" %d", n_pe);
44592: printf(" %d", n_name);
44593: printf(" %d", n_pubid);
44594: printf(" %d", n_sysid);
44595: printf(" %d", n_ndataid);
44596: printf("\n");
44597: }
44598: }
44599: }
44600: }
44601: }
44602: }
44603: }
44604: function_tests++;
44605: #endif
44606:
44607: return(test_ret);
44608: }
44609:
44610:
44611: static int
44612: test_xmlTextWriterWriteDTDExternalEntityContents(void) {
44613: int test_ret = 0;
44614:
44615: #if defined(LIBXML_WRITER_ENABLED)
44616: int mem_base;
44617: int ret_val;
44618: xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44619: int n_writer;
44620: xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
44621: int n_pubid;
44622: xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
44623: int n_sysid;
44624: xmlChar * ndataid; /* the xml notation name. */
44625: int n_ndataid;
44626:
44627: for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44628: for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
44629: for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
44630: for (n_ndataid = 0;n_ndataid < gen_nb_const_xmlChar_ptr;n_ndataid++) {
44631: mem_base = xmlMemBlocks();
44632: writer = gen_xmlTextWriterPtr(n_writer, 0);
44633: pubid = gen_const_xmlChar_ptr(n_pubid, 1);
44634: sysid = gen_const_xmlChar_ptr(n_sysid, 2);
44635: ndataid = gen_const_xmlChar_ptr(n_ndataid, 3);
44636:
44637: ret_val = xmlTextWriterWriteDTDExternalEntityContents(writer, (const xmlChar *)pubid, (const xmlChar *)sysid, (const xmlChar *)ndataid);
44638: desret_int(ret_val);
44639: call_tests++;
44640: des_xmlTextWriterPtr(n_writer, writer, 0);
44641: des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 1);
44642: des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 2);
44643: des_const_xmlChar_ptr(n_ndataid, (const xmlChar *)ndataid, 3);
44644: xmlResetLastError();
44645: if (mem_base != xmlMemBlocks()) {
44646: printf("Leak of %d blocks found in xmlTextWriterWriteDTDExternalEntityContents",
44647: xmlMemBlocks() - mem_base);
44648: test_ret++;
44649: printf(" %d", n_writer);
44650: printf(" %d", n_pubid);
44651: printf(" %d", n_sysid);
44652: printf(" %d", n_ndataid);
44653: printf("\n");
44654: }
44655: }
44656: }
44657: }
44658: }
44659: function_tests++;
44660: #endif
44661:
44662: return(test_ret);
44663: }
44664:
44665:
44666: static int
44667: test_xmlTextWriterWriteDTDInternalEntity(void) {
44668: int test_ret = 0;
44669:
44670: #if defined(LIBXML_WRITER_ENABLED)
44671: int mem_base;
44672: int ret_val;
44673: xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44674: int n_writer;
44675: int pe; /* TRUE if this is a parameter entity, FALSE if not */
44676: int n_pe;
44677: xmlChar * name; /* the name of the DTD entity */
44678: int n_name;
44679: xmlChar * content; /* content of the entity */
44680: int n_content;
44681:
44682: for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44683: for (n_pe = 0;n_pe < gen_nb_int;n_pe++) {
44684: for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44685: for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44686: mem_base = xmlMemBlocks();
44687: writer = gen_xmlTextWriterPtr(n_writer, 0);
44688: pe = gen_int(n_pe, 1);
44689: name = gen_const_xmlChar_ptr(n_name, 2);
44690: content = gen_const_xmlChar_ptr(n_content, 3);
44691:
44692: ret_val = xmlTextWriterWriteDTDInternalEntity(writer, pe, (const xmlChar *)name, (const xmlChar *)content);
44693: desret_int(ret_val);
44694: call_tests++;
44695: des_xmlTextWriterPtr(n_writer, writer, 0);
44696: des_int(n_pe, pe, 1);
44697: des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
44698: des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
44699: xmlResetLastError();
44700: if (mem_base != xmlMemBlocks()) {
44701: printf("Leak of %d blocks found in xmlTextWriterWriteDTDInternalEntity",
44702: xmlMemBlocks() - mem_base);
44703: test_ret++;
44704: printf(" %d", n_writer);
44705: printf(" %d", n_pe);
44706: printf(" %d", n_name);
44707: printf(" %d", n_content);
44708: printf("\n");
44709: }
44710: }
44711: }
44712: }
44713: }
44714: function_tests++;
44715: #endif
44716:
44717: return(test_ret);
44718: }
44719:
44720:
44721: static int
44722: test_xmlTextWriterWriteDTDNotation(void) {
44723: int test_ret = 0;
44724:
44725: #if defined(LIBXML_WRITER_ENABLED)
44726: int mem_base;
44727: int ret_val;
44728: xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44729: int n_writer;
44730: xmlChar * name; /* the name of the xml notation */
44731: int n_name;
44732: xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
44733: int n_pubid;
44734: xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
44735: int n_sysid;
44736:
44737: for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44738: for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44739: for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
44740: for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
44741: mem_base = xmlMemBlocks();
44742: writer = gen_xmlTextWriterPtr(n_writer, 0);
44743: name = gen_const_xmlChar_ptr(n_name, 1);
44744: pubid = gen_const_xmlChar_ptr(n_pubid, 2);
44745: sysid = gen_const_xmlChar_ptr(n_sysid, 3);
44746:
44747: ret_val = xmlTextWriterWriteDTDNotation(writer, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid);
44748: desret_int(ret_val);
44749: call_tests++;
44750: des_xmlTextWriterPtr(n_writer, writer, 0);
44751: des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
44752: des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 2);
44753: des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 3);
44754: xmlResetLastError();
44755: if (mem_base != xmlMemBlocks()) {
44756: printf("Leak of %d blocks found in xmlTextWriterWriteDTDNotation",
44757: xmlMemBlocks() - mem_base);
44758: test_ret++;
44759: printf(" %d", n_writer);
44760: printf(" %d", n_name);
44761: printf(" %d", n_pubid);
44762: printf(" %d", n_sysid);
44763: printf("\n");
44764: }
44765: }
44766: }
44767: }
44768: }
44769: function_tests++;
44770: #endif
44771:
44772: return(test_ret);
44773: }
44774:
44775:
44776: static int
44777: test_xmlTextWriterWriteElement(void) {
44778: int test_ret = 0;
44779:
44780: #if defined(LIBXML_WRITER_ENABLED)
44781: int mem_base;
44782: int ret_val;
44783: xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44784: int n_writer;
44785: xmlChar * name; /* element name */
44786: int n_name;
44787: xmlChar * content; /* element content */
44788: int n_content;
44789:
44790: for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44791: for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44792: for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44793: mem_base = xmlMemBlocks();
44794: writer = gen_xmlTextWriterPtr(n_writer, 0);
44795: name = gen_const_xmlChar_ptr(n_name, 1);
44796: content = gen_const_xmlChar_ptr(n_content, 2);
44797:
44798: ret_val = xmlTextWriterWriteElement(writer, (const xmlChar *)name, (const xmlChar *)content);
44799: desret_int(ret_val);
44800: call_tests++;
44801: des_xmlTextWriterPtr(n_writer, writer, 0);
44802: des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
44803: des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
44804: xmlResetLastError();
44805: if (mem_base != xmlMemBlocks()) {
44806: printf("Leak of %d blocks found in xmlTextWriterWriteElement",
44807: xmlMemBlocks() - mem_base);
44808: test_ret++;
44809: printf(" %d", n_writer);
44810: printf(" %d", n_name);
44811: printf(" %d", n_content);
44812: printf("\n");
44813: }
44814: }
44815: }
44816: }
44817: function_tests++;
44818: #endif
44819:
44820: return(test_ret);
44821: }
44822:
44823:
44824: static int
44825: test_xmlTextWriterWriteElementNS(void) {
44826: int test_ret = 0;
44827:
44828: #if defined(LIBXML_WRITER_ENABLED)
44829: int mem_base;
44830: int ret_val;
44831: xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44832: int n_writer;
44833: xmlChar * prefix; /* namespace prefix */
44834: int n_prefix;
44835: xmlChar * name; /* element local name */
44836: int n_name;
44837: xmlChar * namespaceURI; /* namespace URI */
44838: int n_namespaceURI;
44839: xmlChar * content; /* element content */
44840: int n_content;
44841:
44842: for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44843: for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
44844: for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44845: for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
44846: for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44847: mem_base = xmlMemBlocks();
44848: writer = gen_xmlTextWriterPtr(n_writer, 0);
44849: prefix = gen_const_xmlChar_ptr(n_prefix, 1);
44850: name = gen_const_xmlChar_ptr(n_name, 2);
44851: namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3);
44852: content = gen_const_xmlChar_ptr(n_content, 4);
44853:
44854: ret_val = xmlTextWriterWriteElementNS(writer, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)namespaceURI, (const xmlChar *)content);
44855: desret_int(ret_val);
44856: call_tests++;
44857: des_xmlTextWriterPtr(n_writer, writer, 0);
44858: des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
44859: des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
44860: des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 3);
44861: des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 4);
44862: xmlResetLastError();
44863: if (mem_base != xmlMemBlocks()) {
44864: printf("Leak of %d blocks found in xmlTextWriterWriteElementNS",
44865: xmlMemBlocks() - mem_base);
44866: test_ret++;
44867: printf(" %d", n_writer);
44868: printf(" %d", n_prefix);
44869: printf(" %d", n_name);
44870: printf(" %d", n_namespaceURI);
44871: printf(" %d", n_content);
44872: printf("\n");
44873: }
44874: }
44875: }
44876: }
44877: }
44878: }
44879: function_tests++;
44880: #endif
44881:
44882: return(test_ret);
44883: }
44884:
44885:
44886: static int
44887: test_xmlTextWriterWriteFormatAttribute(void) {
44888: int test_ret = 0;
44889:
44890:
44891: /* missing type support */
44892: return(test_ret);
44893: }
44894:
44895:
44896: static int
44897: test_xmlTextWriterWriteFormatAttributeNS(void) {
44898: int test_ret = 0;
44899:
44900:
44901: /* missing type support */
44902: return(test_ret);
44903: }
44904:
44905:
44906: static int
44907: test_xmlTextWriterWriteFormatCDATA(void) {
44908: int test_ret = 0;
44909:
44910:
44911: /* missing type support */
44912: return(test_ret);
44913: }
44914:
44915:
44916: static int
44917: test_xmlTextWriterWriteFormatComment(void) {
44918: int test_ret = 0;
44919:
44920:
44921: /* missing type support */
44922: return(test_ret);
44923: }
44924:
44925:
44926: static int
44927: test_xmlTextWriterWriteFormatDTD(void) {
44928: int test_ret = 0;
44929:
44930:
44931: /* missing type support */
44932: return(test_ret);
44933: }
44934:
44935:
44936: static int
44937: test_xmlTextWriterWriteFormatDTDAttlist(void) {
44938: int test_ret = 0;
44939:
44940:
44941: /* missing type support */
44942: return(test_ret);
44943: }
44944:
44945:
44946: static int
44947: test_xmlTextWriterWriteFormatDTDElement(void) {
44948: int test_ret = 0;
44949:
44950:
44951: /* missing type support */
44952: return(test_ret);
44953: }
44954:
44955:
44956: static int
44957: test_xmlTextWriterWriteFormatDTDInternalEntity(void) {
44958: int test_ret = 0;
44959:
44960:
44961: /* missing type support */
44962: return(test_ret);
44963: }
44964:
44965:
44966: static int
44967: test_xmlTextWriterWriteFormatElement(void) {
44968: int test_ret = 0;
44969:
44970:
44971: /* missing type support */
44972: return(test_ret);
44973: }
44974:
44975:
44976: static int
44977: test_xmlTextWriterWriteFormatElementNS(void) {
44978: int test_ret = 0;
44979:
44980:
44981: /* missing type support */
44982: return(test_ret);
44983: }
44984:
44985:
44986: static int
44987: test_xmlTextWriterWriteFormatPI(void) {
44988: int test_ret = 0;
44989:
44990:
44991: /* missing type support */
44992: return(test_ret);
44993: }
44994:
44995:
44996: static int
44997: test_xmlTextWriterWriteFormatRaw(void) {
44998: int test_ret = 0;
44999:
45000:
45001: /* missing type support */
45002: return(test_ret);
45003: }
45004:
45005:
45006: static int
45007: test_xmlTextWriterWriteFormatString(void) {
45008: int test_ret = 0;
45009:
45010:
45011: /* missing type support */
45012: return(test_ret);
45013: }
45014:
45015:
45016: static int
45017: test_xmlTextWriterWritePI(void) {
45018: int test_ret = 0;
45019:
45020: #if defined(LIBXML_WRITER_ENABLED)
45021: int mem_base;
45022: int ret_val;
45023: xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45024: int n_writer;
45025: xmlChar * target; /* PI target */
45026: int n_target;
45027: xmlChar * content; /* PI content */
45028: int n_content;
45029:
45030: for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45031: for (n_target = 0;n_target < gen_nb_const_xmlChar_ptr;n_target++) {
45032: for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
45033: mem_base = xmlMemBlocks();
45034: writer = gen_xmlTextWriterPtr(n_writer, 0);
45035: target = gen_const_xmlChar_ptr(n_target, 1);
45036: content = gen_const_xmlChar_ptr(n_content, 2);
45037:
45038: ret_val = xmlTextWriterWritePI(writer, (const xmlChar *)target, (const xmlChar *)content);
45039: desret_int(ret_val);
45040: call_tests++;
45041: des_xmlTextWriterPtr(n_writer, writer, 0);
45042: des_const_xmlChar_ptr(n_target, (const xmlChar *)target, 1);
45043: des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
45044: xmlResetLastError();
45045: if (mem_base != xmlMemBlocks()) {
45046: printf("Leak of %d blocks found in xmlTextWriterWritePI",
45047: xmlMemBlocks() - mem_base);
45048: test_ret++;
45049: printf(" %d", n_writer);
45050: printf(" %d", n_target);
45051: printf(" %d", n_content);
45052: printf("\n");
45053: }
45054: }
45055: }
45056: }
45057: function_tests++;
45058: #endif
45059:
45060: return(test_ret);
45061: }
45062:
45063:
45064: static int
45065: test_xmlTextWriterWriteRaw(void) {
45066: int test_ret = 0;
45067:
45068: #if defined(LIBXML_WRITER_ENABLED)
45069: int mem_base;
45070: int ret_val;
45071: xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45072: int n_writer;
45073: xmlChar * content; /* text string */
45074: int n_content;
45075:
45076: for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45077: for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
45078: mem_base = xmlMemBlocks();
45079: writer = gen_xmlTextWriterPtr(n_writer, 0);
45080: content = gen_const_xmlChar_ptr(n_content, 1);
45081:
45082: ret_val = xmlTextWriterWriteRaw(writer, (const xmlChar *)content);
45083: desret_int(ret_val);
45084: call_tests++;
45085: des_xmlTextWriterPtr(n_writer, writer, 0);
45086: des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
45087: xmlResetLastError();
45088: if (mem_base != xmlMemBlocks()) {
45089: printf("Leak of %d blocks found in xmlTextWriterWriteRaw",
45090: xmlMemBlocks() - mem_base);
45091: test_ret++;
45092: printf(" %d", n_writer);
45093: printf(" %d", n_content);
45094: printf("\n");
45095: }
45096: }
45097: }
45098: function_tests++;
45099: #endif
45100:
45101: return(test_ret);
45102: }
45103:
45104:
45105: static int
45106: test_xmlTextWriterWriteRawLen(void) {
45107: int test_ret = 0;
45108:
45109: #if defined(LIBXML_WRITER_ENABLED)
45110: int mem_base;
45111: int ret_val;
45112: xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45113: int n_writer;
45114: xmlChar * content; /* text string */
45115: int n_content;
45116: int len; /* length of the text string */
45117: int n_len;
45118:
45119: for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45120: for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
45121: for (n_len = 0;n_len < gen_nb_int;n_len++) {
45122: mem_base = xmlMemBlocks();
45123: writer = gen_xmlTextWriterPtr(n_writer, 0);
45124: content = gen_const_xmlChar_ptr(n_content, 1);
45125: len = gen_int(n_len, 2);
45126:
45127: ret_val = xmlTextWriterWriteRawLen(writer, (const xmlChar *)content, len);
45128: desret_int(ret_val);
45129: call_tests++;
45130: des_xmlTextWriterPtr(n_writer, writer, 0);
45131: des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
45132: des_int(n_len, len, 2);
45133: xmlResetLastError();
45134: if (mem_base != xmlMemBlocks()) {
45135: printf("Leak of %d blocks found in xmlTextWriterWriteRawLen",
45136: xmlMemBlocks() - mem_base);
45137: test_ret++;
45138: printf(" %d", n_writer);
45139: printf(" %d", n_content);
45140: printf(" %d", n_len);
45141: printf("\n");
45142: }
45143: }
45144: }
45145: }
45146: function_tests++;
45147: #endif
45148:
45149: return(test_ret);
45150: }
45151:
45152:
45153: static int
45154: test_xmlTextWriterWriteString(void) {
45155: int test_ret = 0;
45156:
45157: #if defined(LIBXML_WRITER_ENABLED)
45158: int mem_base;
45159: int ret_val;
45160: xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45161: int n_writer;
45162: xmlChar * content; /* text string */
45163: int n_content;
45164:
45165: for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45166: for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
45167: mem_base = xmlMemBlocks();
45168: writer = gen_xmlTextWriterPtr(n_writer, 0);
45169: content = gen_const_xmlChar_ptr(n_content, 1);
45170:
45171: ret_val = xmlTextWriterWriteString(writer, (const xmlChar *)content);
45172: desret_int(ret_val);
45173: call_tests++;
45174: des_xmlTextWriterPtr(n_writer, writer, 0);
45175: des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
45176: xmlResetLastError();
45177: if (mem_base != xmlMemBlocks()) {
45178: printf("Leak of %d blocks found in xmlTextWriterWriteString",
45179: xmlMemBlocks() - mem_base);
45180: test_ret++;
45181: printf(" %d", n_writer);
45182: printf(" %d", n_content);
45183: printf("\n");
45184: }
45185: }
45186: }
45187: function_tests++;
45188: #endif
45189:
45190: return(test_ret);
45191: }
45192:
45193:
45194: static int
45195: test_xmlTextWriterWriteVFormatAttribute(void) {
45196: int test_ret = 0;
45197:
45198:
45199: /* missing type support */
45200: return(test_ret);
45201: }
45202:
45203:
45204: static int
45205: test_xmlTextWriterWriteVFormatAttributeNS(void) {
45206: int test_ret = 0;
45207:
45208:
45209: /* missing type support */
45210: return(test_ret);
45211: }
45212:
45213:
45214: static int
45215: test_xmlTextWriterWriteVFormatCDATA(void) {
45216: int test_ret = 0;
45217:
45218:
45219: /* missing type support */
45220: return(test_ret);
45221: }
45222:
45223:
45224: static int
45225: test_xmlTextWriterWriteVFormatComment(void) {
45226: int test_ret = 0;
45227:
45228:
45229: /* missing type support */
45230: return(test_ret);
45231: }
45232:
45233:
45234: static int
45235: test_xmlTextWriterWriteVFormatDTD(void) {
45236: int test_ret = 0;
45237:
45238:
45239: /* missing type support */
45240: return(test_ret);
45241: }
45242:
45243:
45244: static int
45245: test_xmlTextWriterWriteVFormatDTDAttlist(void) {
45246: int test_ret = 0;
45247:
45248:
45249: /* missing type support */
45250: return(test_ret);
45251: }
45252:
45253:
45254: static int
45255: test_xmlTextWriterWriteVFormatDTDElement(void) {
45256: int test_ret = 0;
45257:
45258:
45259: /* missing type support */
45260: return(test_ret);
45261: }
45262:
45263:
45264: static int
45265: test_xmlTextWriterWriteVFormatDTDInternalEntity(void) {
45266: int test_ret = 0;
45267:
45268:
45269: /* missing type support */
45270: return(test_ret);
45271: }
45272:
45273:
45274: static int
45275: test_xmlTextWriterWriteVFormatElement(void) {
45276: int test_ret = 0;
45277:
45278:
45279: /* missing type support */
45280: return(test_ret);
45281: }
45282:
45283:
45284: static int
45285: test_xmlTextWriterWriteVFormatElementNS(void) {
45286: int test_ret = 0;
45287:
45288:
45289: /* missing type support */
45290: return(test_ret);
45291: }
45292:
45293:
45294: static int
45295: test_xmlTextWriterWriteVFormatPI(void) {
45296: int test_ret = 0;
45297:
45298:
45299: /* missing type support */
45300: return(test_ret);
45301: }
45302:
45303:
45304: static int
45305: test_xmlTextWriterWriteVFormatRaw(void) {
45306: int test_ret = 0;
45307:
45308:
45309: /* missing type support */
45310: return(test_ret);
45311: }
45312:
45313:
45314: static int
45315: test_xmlTextWriterWriteVFormatString(void) {
45316: int test_ret = 0;
45317:
45318:
45319: /* missing type support */
45320: return(test_ret);
45321: }
45322:
45323: static int
45324: test_xmlwriter(void) {
45325: int test_ret = 0;
45326:
45327: if (quiet == 0) printf("Testing xmlwriter : 51 of 79 functions ...\n");
45328: test_ret += test_xmlNewTextWriter();
45329: test_ret += test_xmlNewTextWriterFilename();
45330: test_ret += test_xmlNewTextWriterMemory();
45331: test_ret += test_xmlNewTextWriterPushParser();
45332: test_ret += test_xmlNewTextWriterTree();
45333: test_ret += test_xmlTextWriterEndAttribute();
45334: test_ret += test_xmlTextWriterEndCDATA();
45335: test_ret += test_xmlTextWriterEndComment();
45336: test_ret += test_xmlTextWriterEndDTD();
45337: test_ret += test_xmlTextWriterEndDTDAttlist();
45338: test_ret += test_xmlTextWriterEndDTDElement();
45339: test_ret += test_xmlTextWriterEndDTDEntity();
45340: test_ret += test_xmlTextWriterEndDocument();
45341: test_ret += test_xmlTextWriterEndElement();
45342: test_ret += test_xmlTextWriterEndPI();
45343: test_ret += test_xmlTextWriterFlush();
45344: test_ret += test_xmlTextWriterFullEndElement();
45345: test_ret += test_xmlTextWriterSetIndent();
45346: test_ret += test_xmlTextWriterSetIndentString();
45347: test_ret += test_xmlTextWriterStartAttribute();
45348: test_ret += test_xmlTextWriterStartAttributeNS();
45349: test_ret += test_xmlTextWriterStartCDATA();
45350: test_ret += test_xmlTextWriterStartComment();
45351: test_ret += test_xmlTextWriterStartDTD();
45352: test_ret += test_xmlTextWriterStartDTDAttlist();
45353: test_ret += test_xmlTextWriterStartDTDElement();
45354: test_ret += test_xmlTextWriterStartDTDEntity();
45355: test_ret += test_xmlTextWriterStartDocument();
45356: test_ret += test_xmlTextWriterStartElement();
45357: test_ret += test_xmlTextWriterStartElementNS();
45358: test_ret += test_xmlTextWriterStartPI();
45359: test_ret += test_xmlTextWriterWriteAttribute();
45360: test_ret += test_xmlTextWriterWriteAttributeNS();
45361: test_ret += test_xmlTextWriterWriteBase64();
45362: test_ret += test_xmlTextWriterWriteBinHex();
45363: test_ret += test_xmlTextWriterWriteCDATA();
45364: test_ret += test_xmlTextWriterWriteComment();
45365: test_ret += test_xmlTextWriterWriteDTD();
45366: test_ret += test_xmlTextWriterWriteDTDAttlist();
45367: test_ret += test_xmlTextWriterWriteDTDElement();
45368: test_ret += test_xmlTextWriterWriteDTDEntity();
45369: test_ret += test_xmlTextWriterWriteDTDExternalEntity();
45370: test_ret += test_xmlTextWriterWriteDTDExternalEntityContents();
45371: test_ret += test_xmlTextWriterWriteDTDInternalEntity();
45372: test_ret += test_xmlTextWriterWriteDTDNotation();
45373: test_ret += test_xmlTextWriterWriteElement();
45374: test_ret += test_xmlTextWriterWriteElementNS();
45375: test_ret += test_xmlTextWriterWriteFormatAttribute();
45376: test_ret += test_xmlTextWriterWriteFormatAttributeNS();
45377: test_ret += test_xmlTextWriterWriteFormatCDATA();
45378: test_ret += test_xmlTextWriterWriteFormatComment();
45379: test_ret += test_xmlTextWriterWriteFormatDTD();
45380: test_ret += test_xmlTextWriterWriteFormatDTDAttlist();
45381: test_ret += test_xmlTextWriterWriteFormatDTDElement();
45382: test_ret += test_xmlTextWriterWriteFormatDTDInternalEntity();
45383: test_ret += test_xmlTextWriterWriteFormatElement();
45384: test_ret += test_xmlTextWriterWriteFormatElementNS();
45385: test_ret += test_xmlTextWriterWriteFormatPI();
45386: test_ret += test_xmlTextWriterWriteFormatRaw();
45387: test_ret += test_xmlTextWriterWriteFormatString();
45388: test_ret += test_xmlTextWriterWritePI();
45389: test_ret += test_xmlTextWriterWriteRaw();
45390: test_ret += test_xmlTextWriterWriteRawLen();
45391: test_ret += test_xmlTextWriterWriteString();
45392: test_ret += test_xmlTextWriterWriteVFormatAttribute();
45393: test_ret += test_xmlTextWriterWriteVFormatAttributeNS();
45394: test_ret += test_xmlTextWriterWriteVFormatCDATA();
45395: test_ret += test_xmlTextWriterWriteVFormatComment();
45396: test_ret += test_xmlTextWriterWriteVFormatDTD();
45397: test_ret += test_xmlTextWriterWriteVFormatDTDAttlist();
45398: test_ret += test_xmlTextWriterWriteVFormatDTDElement();
45399: test_ret += test_xmlTextWriterWriteVFormatDTDInternalEntity();
45400: test_ret += test_xmlTextWriterWriteVFormatElement();
45401: test_ret += test_xmlTextWriterWriteVFormatElementNS();
45402: test_ret += test_xmlTextWriterWriteVFormatPI();
45403: test_ret += test_xmlTextWriterWriteVFormatRaw();
45404: test_ret += test_xmlTextWriterWriteVFormatString();
45405:
45406: if (test_ret != 0)
45407: printf("Module xmlwriter: %d errors\n", test_ret);
45408: return(test_ret);
45409: }
45410:
45411: static int
45412: test_xmlXPathCastBooleanToNumber(void) {
45413: int test_ret = 0;
45414:
45415: #if defined(LIBXML_XPATH_ENABLED)
45416: int mem_base;
45417: double ret_val;
45418: int val; /* a boolean */
45419: int n_val;
45420:
45421: for (n_val = 0;n_val < gen_nb_int;n_val++) {
45422: mem_base = xmlMemBlocks();
45423: val = gen_int(n_val, 0);
45424:
45425: ret_val = xmlXPathCastBooleanToNumber(val);
45426: desret_double(ret_val);
45427: call_tests++;
45428: des_int(n_val, val, 0);
45429: xmlResetLastError();
45430: if (mem_base != xmlMemBlocks()) {
45431: printf("Leak of %d blocks found in xmlXPathCastBooleanToNumber",
45432: xmlMemBlocks() - mem_base);
45433: test_ret++;
45434: printf(" %d", n_val);
45435: printf("\n");
45436: }
45437: }
45438: function_tests++;
45439: #endif
45440:
45441: return(test_ret);
45442: }
45443:
45444:
45445: static int
45446: test_xmlXPathCastBooleanToString(void) {
45447: int test_ret = 0;
45448:
45449: #if defined(LIBXML_XPATH_ENABLED)
45450: int mem_base;
45451: xmlChar * ret_val;
45452: int val; /* a boolean */
45453: int n_val;
45454:
45455: for (n_val = 0;n_val < gen_nb_int;n_val++) {
45456: mem_base = xmlMemBlocks();
45457: val = gen_int(n_val, 0);
45458:
45459: ret_val = xmlXPathCastBooleanToString(val);
45460: desret_xmlChar_ptr(ret_val);
45461: call_tests++;
45462: des_int(n_val, val, 0);
45463: xmlResetLastError();
45464: if (mem_base != xmlMemBlocks()) {
45465: printf("Leak of %d blocks found in xmlXPathCastBooleanToString",
45466: xmlMemBlocks() - mem_base);
45467: test_ret++;
45468: printf(" %d", n_val);
45469: printf("\n");
45470: }
45471: }
45472: function_tests++;
45473: #endif
45474:
45475: return(test_ret);
45476: }
45477:
45478:
45479: static int
45480: test_xmlXPathCastNodeSetToBoolean(void) {
45481: int test_ret = 0;
45482:
45483: #if defined(LIBXML_XPATH_ENABLED)
45484: int mem_base;
45485: int ret_val;
45486: xmlNodeSetPtr ns; /* a node-set */
45487: int n_ns;
45488:
45489: for (n_ns = 0;n_ns < gen_nb_xmlNodeSetPtr;n_ns++) {
45490: mem_base = xmlMemBlocks();
45491: ns = gen_xmlNodeSetPtr(n_ns, 0);
45492:
45493: ret_val = xmlXPathCastNodeSetToBoolean(ns);
45494: desret_int(ret_val);
45495: call_tests++;
45496: des_xmlNodeSetPtr(n_ns, ns, 0);
45497: xmlResetLastError();
45498: if (mem_base != xmlMemBlocks()) {
45499: printf("Leak of %d blocks found in xmlXPathCastNodeSetToBoolean",
45500: xmlMemBlocks() - mem_base);
45501: test_ret++;
45502: printf(" %d", n_ns);
45503: printf("\n");
45504: }
45505: }
45506: function_tests++;
45507: #endif
45508:
45509: return(test_ret);
45510: }
45511:
45512:
45513: static int
45514: test_xmlXPathCastNodeSetToNumber(void) {
45515: int test_ret = 0;
45516:
45517: #if defined(LIBXML_XPATH_ENABLED)
45518: int mem_base;
45519: double ret_val;
45520: xmlNodeSetPtr ns; /* a node-set */
45521: int n_ns;
45522:
45523: for (n_ns = 0;n_ns < gen_nb_xmlNodeSetPtr;n_ns++) {
45524: mem_base = xmlMemBlocks();
45525: ns = gen_xmlNodeSetPtr(n_ns, 0);
45526:
45527: ret_val = xmlXPathCastNodeSetToNumber(ns);
45528: desret_double(ret_val);
45529: call_tests++;
45530: des_xmlNodeSetPtr(n_ns, ns, 0);
45531: xmlResetLastError();
45532: if (mem_base != xmlMemBlocks()) {
45533: printf("Leak of %d blocks found in xmlXPathCastNodeSetToNumber",
45534: xmlMemBlocks() - mem_base);
45535: test_ret++;
45536: printf(" %d", n_ns);
45537: printf("\n");
45538: }
45539: }
45540: function_tests++;
45541: #endif
45542:
45543: return(test_ret);
45544: }
45545:
45546:
45547: static int
45548: test_xmlXPathCastNodeSetToString(void) {
45549: int test_ret = 0;
45550:
45551: #if defined(LIBXML_XPATH_ENABLED)
45552: int mem_base;
45553: xmlChar * ret_val;
45554: xmlNodeSetPtr ns; /* a node-set */
45555: int n_ns;
45556:
45557: for (n_ns = 0;n_ns < gen_nb_xmlNodeSetPtr;n_ns++) {
45558: mem_base = xmlMemBlocks();
45559: ns = gen_xmlNodeSetPtr(n_ns, 0);
45560:
45561: ret_val = xmlXPathCastNodeSetToString(ns);
45562: desret_xmlChar_ptr(ret_val);
45563: call_tests++;
45564: des_xmlNodeSetPtr(n_ns, ns, 0);
45565: xmlResetLastError();
45566: if (mem_base != xmlMemBlocks()) {
45567: printf("Leak of %d blocks found in xmlXPathCastNodeSetToString",
45568: xmlMemBlocks() - mem_base);
45569: test_ret++;
45570: printf(" %d", n_ns);
45571: printf("\n");
45572: }
45573: }
45574: function_tests++;
45575: #endif
45576:
45577: return(test_ret);
45578: }
45579:
45580:
45581: static int
45582: test_xmlXPathCastNodeToNumber(void) {
45583: int test_ret = 0;
45584:
45585: #if defined(LIBXML_XPATH_ENABLED)
45586: int mem_base;
45587: double ret_val;
45588: xmlNodePtr node; /* a node */
45589: int n_node;
45590:
45591: for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
45592: mem_base = xmlMemBlocks();
45593: node = gen_xmlNodePtr(n_node, 0);
45594:
45595: ret_val = xmlXPathCastNodeToNumber(node);
45596: desret_double(ret_val);
45597: call_tests++;
45598: des_xmlNodePtr(n_node, node, 0);
45599: xmlResetLastError();
45600: if (mem_base != xmlMemBlocks()) {
45601: printf("Leak of %d blocks found in xmlXPathCastNodeToNumber",
45602: xmlMemBlocks() - mem_base);
45603: test_ret++;
45604: printf(" %d", n_node);
45605: printf("\n");
45606: }
45607: }
45608: function_tests++;
45609: #endif
45610:
45611: return(test_ret);
45612: }
45613:
45614:
45615: static int
45616: test_xmlXPathCastNodeToString(void) {
45617: int test_ret = 0;
45618:
45619: #if defined(LIBXML_XPATH_ENABLED)
45620: int mem_base;
45621: xmlChar * ret_val;
45622: xmlNodePtr node; /* a node */
45623: int n_node;
45624:
45625: for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
45626: mem_base = xmlMemBlocks();
45627: node = gen_xmlNodePtr(n_node, 0);
45628:
45629: ret_val = xmlXPathCastNodeToString(node);
45630: desret_xmlChar_ptr(ret_val);
45631: call_tests++;
45632: des_xmlNodePtr(n_node, node, 0);
45633: xmlResetLastError();
45634: if (mem_base != xmlMemBlocks()) {
45635: printf("Leak of %d blocks found in xmlXPathCastNodeToString",
45636: xmlMemBlocks() - mem_base);
45637: test_ret++;
45638: printf(" %d", n_node);
45639: printf("\n");
45640: }
45641: }
45642: function_tests++;
45643: #endif
45644:
45645: return(test_ret);
45646: }
45647:
45648:
45649: static int
45650: test_xmlXPathCastNumberToBoolean(void) {
45651: int test_ret = 0;
45652:
45653: #if defined(LIBXML_XPATH_ENABLED)
45654: int mem_base;
45655: int ret_val;
45656: double val; /* a number */
45657: int n_val;
45658:
45659: for (n_val = 0;n_val < gen_nb_double;n_val++) {
45660: mem_base = xmlMemBlocks();
45661: val = gen_double(n_val, 0);
45662:
45663: ret_val = xmlXPathCastNumberToBoolean(val);
45664: desret_int(ret_val);
45665: call_tests++;
45666: des_double(n_val, val, 0);
45667: xmlResetLastError();
45668: if (mem_base != xmlMemBlocks()) {
45669: printf("Leak of %d blocks found in xmlXPathCastNumberToBoolean",
45670: xmlMemBlocks() - mem_base);
45671: test_ret++;
45672: printf(" %d", n_val);
45673: printf("\n");
45674: }
45675: }
45676: function_tests++;
45677: #endif
45678:
45679: return(test_ret);
45680: }
45681:
45682:
45683: static int
45684: test_xmlXPathCastNumberToString(void) {
45685: int test_ret = 0;
45686:
45687: #if defined(LIBXML_XPATH_ENABLED)
45688: int mem_base;
45689: xmlChar * ret_val;
45690: double val; /* a number */
45691: int n_val;
45692:
45693: for (n_val = 0;n_val < gen_nb_double;n_val++) {
45694: mem_base = xmlMemBlocks();
45695: val = gen_double(n_val, 0);
45696:
45697: ret_val = xmlXPathCastNumberToString(val);
45698: desret_xmlChar_ptr(ret_val);
45699: call_tests++;
45700: des_double(n_val, val, 0);
45701: xmlResetLastError();
45702: if (mem_base != xmlMemBlocks()) {
45703: printf("Leak of %d blocks found in xmlXPathCastNumberToString",
45704: xmlMemBlocks() - mem_base);
45705: test_ret++;
45706: printf(" %d", n_val);
45707: printf("\n");
45708: }
45709: }
45710: function_tests++;
45711: #endif
45712:
45713: return(test_ret);
45714: }
45715:
45716:
45717: static int
45718: test_xmlXPathCastStringToBoolean(void) {
45719: int test_ret = 0;
45720:
45721: #if defined(LIBXML_XPATH_ENABLED)
45722: int mem_base;
45723: int ret_val;
45724: xmlChar * val; /* a string */
45725: int n_val;
45726:
45727: for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
45728: mem_base = xmlMemBlocks();
45729: val = gen_const_xmlChar_ptr(n_val, 0);
45730:
45731: ret_val = xmlXPathCastStringToBoolean((const xmlChar *)val);
45732: desret_int(ret_val);
45733: call_tests++;
45734: des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 0);
45735: xmlResetLastError();
45736: if (mem_base != xmlMemBlocks()) {
45737: printf("Leak of %d blocks found in xmlXPathCastStringToBoolean",
45738: xmlMemBlocks() - mem_base);
45739: test_ret++;
45740: printf(" %d", n_val);
45741: printf("\n");
45742: }
45743: }
45744: function_tests++;
45745: #endif
45746:
45747: return(test_ret);
45748: }
45749:
45750:
45751: static int
45752: test_xmlXPathCastStringToNumber(void) {
45753: int test_ret = 0;
45754:
45755: #if defined(LIBXML_XPATH_ENABLED)
45756: int mem_base;
45757: double ret_val;
45758: xmlChar * val; /* a string */
45759: int n_val;
45760:
45761: for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
45762: mem_base = xmlMemBlocks();
45763: val = gen_const_xmlChar_ptr(n_val, 0);
45764:
45765: ret_val = xmlXPathCastStringToNumber((const xmlChar *)val);
45766: desret_double(ret_val);
45767: call_tests++;
45768: des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 0);
45769: xmlResetLastError();
45770: if (mem_base != xmlMemBlocks()) {
45771: printf("Leak of %d blocks found in xmlXPathCastStringToNumber",
45772: xmlMemBlocks() - mem_base);
45773: test_ret++;
45774: printf(" %d", n_val);
45775: printf("\n");
45776: }
45777: }
45778: function_tests++;
45779: #endif
45780:
45781: return(test_ret);
45782: }
45783:
45784:
45785: static int
45786: test_xmlXPathCastToBoolean(void) {
45787: int test_ret = 0;
45788:
45789: #if defined(LIBXML_XPATH_ENABLED)
45790: int mem_base;
45791: int ret_val;
45792: xmlXPathObjectPtr val; /* an XPath object */
45793: int n_val;
45794:
45795: for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
45796: mem_base = xmlMemBlocks();
45797: val = gen_xmlXPathObjectPtr(n_val, 0);
45798:
45799: ret_val = xmlXPathCastToBoolean(val);
45800: desret_int(ret_val);
45801: call_tests++;
45802: des_xmlXPathObjectPtr(n_val, val, 0);
45803: xmlResetLastError();
45804: if (mem_base != xmlMemBlocks()) {
45805: printf("Leak of %d blocks found in xmlXPathCastToBoolean",
45806: xmlMemBlocks() - mem_base);
45807: test_ret++;
45808: printf(" %d", n_val);
45809: printf("\n");
45810: }
45811: }
45812: function_tests++;
45813: #endif
45814:
45815: return(test_ret);
45816: }
45817:
45818:
45819: static int
45820: test_xmlXPathCastToNumber(void) {
45821: int test_ret = 0;
45822:
45823: #if defined(LIBXML_XPATH_ENABLED)
45824: int mem_base;
45825: double ret_val;
45826: xmlXPathObjectPtr val; /* an XPath object */
45827: int n_val;
45828:
45829: for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
45830: mem_base = xmlMemBlocks();
45831: val = gen_xmlXPathObjectPtr(n_val, 0);
45832:
45833: ret_val = xmlXPathCastToNumber(val);
45834: desret_double(ret_val);
45835: call_tests++;
45836: des_xmlXPathObjectPtr(n_val, val, 0);
45837: xmlResetLastError();
45838: if (mem_base != xmlMemBlocks()) {
45839: printf("Leak of %d blocks found in xmlXPathCastToNumber",
45840: xmlMemBlocks() - mem_base);
45841: test_ret++;
45842: printf(" %d", n_val);
45843: printf("\n");
45844: }
45845: }
45846: function_tests++;
45847: #endif
45848:
45849: return(test_ret);
45850: }
45851:
45852:
45853: static int
45854: test_xmlXPathCastToString(void) {
45855: int test_ret = 0;
45856:
45857: #if defined(LIBXML_XPATH_ENABLED)
45858: int mem_base;
45859: xmlChar * ret_val;
45860: xmlXPathObjectPtr val; /* an XPath object */
45861: int n_val;
45862:
45863: for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
45864: mem_base = xmlMemBlocks();
45865: val = gen_xmlXPathObjectPtr(n_val, 0);
45866:
45867: ret_val = xmlXPathCastToString(val);
45868: desret_xmlChar_ptr(ret_val);
45869: call_tests++;
45870: des_xmlXPathObjectPtr(n_val, val, 0);
45871: xmlResetLastError();
45872: if (mem_base != xmlMemBlocks()) {
45873: printf("Leak of %d blocks found in xmlXPathCastToString",
45874: xmlMemBlocks() - mem_base);
45875: test_ret++;
45876: printf(" %d", n_val);
45877: printf("\n");
45878: }
45879: }
45880: function_tests++;
45881: #endif
45882:
45883: return(test_ret);
45884: }
45885:
45886:
45887: static int
45888: test_xmlXPathCmpNodes(void) {
45889: int test_ret = 0;
45890:
45891: #if defined(LIBXML_XPATH_ENABLED)
45892: int mem_base;
45893: int ret_val;
45894: xmlNodePtr node1; /* the first node */
45895: int n_node1;
45896: xmlNodePtr node2; /* the second node */
45897: int n_node2;
45898:
45899: for (n_node1 = 0;n_node1 < gen_nb_xmlNodePtr;n_node1++) {
45900: for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
45901: mem_base = xmlMemBlocks();
45902: node1 = gen_xmlNodePtr(n_node1, 0);
45903: node2 = gen_xmlNodePtr(n_node2, 1);
45904:
45905: ret_val = xmlXPathCmpNodes(node1, node2);
45906: desret_int(ret_val);
45907: call_tests++;
45908: des_xmlNodePtr(n_node1, node1, 0);
45909: des_xmlNodePtr(n_node2, node2, 1);
45910: xmlResetLastError();
45911: if (mem_base != xmlMemBlocks()) {
45912: printf("Leak of %d blocks found in xmlXPathCmpNodes",
45913: xmlMemBlocks() - mem_base);
45914: test_ret++;
45915: printf(" %d", n_node1);
45916: printf(" %d", n_node2);
45917: printf("\n");
45918: }
45919: }
45920: }
45921: function_tests++;
45922: #endif
45923:
45924: return(test_ret);
45925: }
45926:
45927:
45928: static int
45929: test_xmlXPathCompile(void) {
45930: int test_ret = 0;
45931:
45932:
45933: /* missing type support */
45934: return(test_ret);
45935: }
45936:
45937: #ifdef LIBXML_XPATH_ENABLED
45938:
45939: #define gen_nb_xmlXPathCompExprPtr 1
45940: static xmlXPathCompExprPtr gen_xmlXPathCompExprPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
45941: return(NULL);
45942: }
45943: static void des_xmlXPathCompExprPtr(int no ATTRIBUTE_UNUSED, xmlXPathCompExprPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
45944: }
45945: #endif
45946:
45947: #ifdef LIBXML_XPATH_ENABLED
45948:
45949: #define gen_nb_xmlXPathContextPtr 1
45950: static xmlXPathContextPtr gen_xmlXPathContextPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
45951: return(NULL);
45952: }
45953: static void des_xmlXPathContextPtr(int no ATTRIBUTE_UNUSED, xmlXPathContextPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
45954: }
45955: #endif
45956:
45957:
45958: static int
45959: test_xmlXPathCompiledEval(void) {
45960: int test_ret = 0;
45961:
45962: #if defined(LIBXML_XPATH_ENABLED)
45963: int mem_base;
45964: xmlXPathObjectPtr ret_val;
45965: xmlXPathCompExprPtr comp; /* the compiled XPath expression */
45966: int n_comp;
45967: xmlXPathContextPtr ctx; /* the XPath context */
45968: int n_ctx;
45969:
45970: for (n_comp = 0;n_comp < gen_nb_xmlXPathCompExprPtr;n_comp++) {
45971: for (n_ctx = 0;n_ctx < gen_nb_xmlXPathContextPtr;n_ctx++) {
45972: mem_base = xmlMemBlocks();
45973: comp = gen_xmlXPathCompExprPtr(n_comp, 0);
45974: ctx = gen_xmlXPathContextPtr(n_ctx, 1);
45975:
45976: ret_val = xmlXPathCompiledEval(comp, ctx);
45977: desret_xmlXPathObjectPtr(ret_val);
45978: call_tests++;
45979: des_xmlXPathCompExprPtr(n_comp, comp, 0);
45980: des_xmlXPathContextPtr(n_ctx, ctx, 1);
45981: xmlResetLastError();
45982: if (mem_base != xmlMemBlocks()) {
45983: printf("Leak of %d blocks found in xmlXPathCompiledEval",
45984: xmlMemBlocks() - mem_base);
45985: test_ret++;
45986: printf(" %d", n_comp);
45987: printf(" %d", n_ctx);
45988: printf("\n");
45989: }
45990: }
45991: }
45992: function_tests++;
45993: #endif
45994:
45995: return(test_ret);
45996: }
45997:
45998:
45999: static int
46000: test_xmlXPathCompiledEvalToBoolean(void) {
46001: int test_ret = 0;
46002:
46003: #if defined(LIBXML_XPATH_ENABLED)
46004: int mem_base;
46005: int ret_val;
46006: xmlXPathCompExprPtr comp; /* the compiled XPath expression */
46007: int n_comp;
46008: xmlXPathContextPtr ctxt; /* the XPath context */
46009: int n_ctxt;
46010:
46011: for (n_comp = 0;n_comp < gen_nb_xmlXPathCompExprPtr;n_comp++) {
46012: for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
46013: mem_base = xmlMemBlocks();
46014: comp = gen_xmlXPathCompExprPtr(n_comp, 0);
46015: ctxt = gen_xmlXPathContextPtr(n_ctxt, 1);
46016:
46017: ret_val = xmlXPathCompiledEvalToBoolean(comp, ctxt);
46018: desret_int(ret_val);
46019: call_tests++;
46020: des_xmlXPathCompExprPtr(n_comp, comp, 0);
46021: des_xmlXPathContextPtr(n_ctxt, ctxt, 1);
46022: xmlResetLastError();
46023: if (mem_base != xmlMemBlocks()) {
46024: printf("Leak of %d blocks found in xmlXPathCompiledEvalToBoolean",
46025: xmlMemBlocks() - mem_base);
46026: test_ret++;
46027: printf(" %d", n_comp);
46028: printf(" %d", n_ctxt);
46029: printf("\n");
46030: }
46031: }
46032: }
46033: function_tests++;
46034: #endif
46035:
46036: return(test_ret);
46037: }
46038:
46039:
46040: static int
46041: test_xmlXPathContextSetCache(void) {
46042: int test_ret = 0;
46043:
46044: #if defined(LIBXML_XPATH_ENABLED)
46045: int mem_base;
46046: int ret_val;
46047: xmlXPathContextPtr ctxt; /* the XPath context */
46048: int n_ctxt;
46049: int active; /* enables/disables (creates/frees) the cache */
46050: int n_active;
46051: int value; /* a value with semantics dependant on @options */
46052: int n_value;
46053: int options; /* options (currently only the value 0 is used) */
46054: int n_options;
46055:
46056: for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
46057: for (n_active = 0;n_active < gen_nb_int;n_active++) {
46058: for (n_value = 0;n_value < gen_nb_int;n_value++) {
46059: for (n_options = 0;n_options < gen_nb_int;n_options++) {
46060: mem_base = xmlMemBlocks();
46061: ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
46062: active = gen_int(n_active, 1);
46063: value = gen_int(n_value, 2);
46064: options = gen_int(n_options, 3);
46065:
46066: ret_val = xmlXPathContextSetCache(ctxt, active, value, options);
46067: desret_int(ret_val);
46068: call_tests++;
46069: des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
46070: des_int(n_active, active, 1);
46071: des_int(n_value, value, 2);
46072: des_int(n_options, options, 3);
46073: xmlResetLastError();
46074: if (mem_base != xmlMemBlocks()) {
46075: printf("Leak of %d blocks found in xmlXPathContextSetCache",
46076: xmlMemBlocks() - mem_base);
46077: test_ret++;
46078: printf(" %d", n_ctxt);
46079: printf(" %d", n_active);
46080: printf(" %d", n_value);
46081: printf(" %d", n_options);
46082: printf("\n");
46083: }
46084: }
46085: }
46086: }
46087: }
46088: function_tests++;
46089: #endif
46090:
46091: return(test_ret);
46092: }
46093:
46094:
46095: static int
46096: test_xmlXPathConvertBoolean(void) {
46097: int test_ret = 0;
46098:
46099: #if defined(LIBXML_XPATH_ENABLED)
46100: int mem_base;
46101: xmlXPathObjectPtr ret_val;
46102: xmlXPathObjectPtr val; /* an XPath object */
46103: int n_val;
46104:
46105: for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
46106: mem_base = xmlMemBlocks();
46107: val = gen_xmlXPathObjectPtr(n_val, 0);
46108:
46109: ret_val = xmlXPathConvertBoolean(val);
46110: val = NULL;
46111: desret_xmlXPathObjectPtr(ret_val);
46112: call_tests++;
46113: des_xmlXPathObjectPtr(n_val, val, 0);
46114: xmlResetLastError();
46115: if (mem_base != xmlMemBlocks()) {
46116: printf("Leak of %d blocks found in xmlXPathConvertBoolean",
46117: xmlMemBlocks() - mem_base);
46118: test_ret++;
46119: printf(" %d", n_val);
46120: printf("\n");
46121: }
46122: }
46123: function_tests++;
46124: #endif
46125:
46126: return(test_ret);
46127: }
46128:
46129:
46130: static int
46131: test_xmlXPathConvertNumber(void) {
46132: int test_ret = 0;
46133:
46134: #if defined(LIBXML_XPATH_ENABLED)
46135: int mem_base;
46136: xmlXPathObjectPtr ret_val;
46137: xmlXPathObjectPtr val; /* an XPath object */
46138: int n_val;
46139:
46140: for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
46141: mem_base = xmlMemBlocks();
46142: val = gen_xmlXPathObjectPtr(n_val, 0);
46143:
46144: ret_val = xmlXPathConvertNumber(val);
46145: val = NULL;
46146: desret_xmlXPathObjectPtr(ret_val);
46147: call_tests++;
46148: des_xmlXPathObjectPtr(n_val, val, 0);
46149: xmlResetLastError();
46150: if (mem_base != xmlMemBlocks()) {
46151: printf("Leak of %d blocks found in xmlXPathConvertNumber",
46152: xmlMemBlocks() - mem_base);
46153: test_ret++;
46154: printf(" %d", n_val);
46155: printf("\n");
46156: }
46157: }
46158: function_tests++;
46159: #endif
46160:
46161: return(test_ret);
46162: }
46163:
46164:
46165: static int
46166: test_xmlXPathConvertString(void) {
46167: int test_ret = 0;
46168:
46169: #if defined(LIBXML_XPATH_ENABLED)
46170: int mem_base;
46171: xmlXPathObjectPtr ret_val;
46172: xmlXPathObjectPtr val; /* an XPath object */
46173: int n_val;
46174:
46175: for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
46176: mem_base = xmlMemBlocks();
46177: val = gen_xmlXPathObjectPtr(n_val, 0);
46178:
46179: ret_val = xmlXPathConvertString(val);
46180: val = NULL;
46181: desret_xmlXPathObjectPtr(ret_val);
46182: call_tests++;
46183: des_xmlXPathObjectPtr(n_val, val, 0);
46184: xmlResetLastError();
46185: if (mem_base != xmlMemBlocks()) {
46186: printf("Leak of %d blocks found in xmlXPathConvertString",
46187: xmlMemBlocks() - mem_base);
46188: test_ret++;
46189: printf(" %d", n_val);
46190: printf("\n");
46191: }
46192: }
46193: function_tests++;
46194: #endif
46195:
46196: return(test_ret);
46197: }
46198:
46199:
46200: static int
46201: test_xmlXPathCtxtCompile(void) {
46202: int test_ret = 0;
46203:
46204:
46205: /* missing type support */
46206: return(test_ret);
46207: }
46208:
46209:
46210: static int
46211: test_xmlXPathEval(void) {
46212: int test_ret = 0;
46213:
46214: #if defined(LIBXML_XPATH_ENABLED)
46215: int mem_base;
46216: xmlXPathObjectPtr ret_val;
46217: xmlChar * str; /* the XPath expression */
46218: int n_str;
46219: xmlXPathContextPtr ctx; /* the XPath context */
46220: int n_ctx;
46221:
46222: for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
46223: for (n_ctx = 0;n_ctx < gen_nb_xmlXPathContextPtr;n_ctx++) {
46224: mem_base = xmlMemBlocks();
46225: str = gen_const_xmlChar_ptr(n_str, 0);
46226: ctx = gen_xmlXPathContextPtr(n_ctx, 1);
46227:
46228: ret_val = xmlXPathEval((const xmlChar *)str, ctx);
46229: desret_xmlXPathObjectPtr(ret_val);
46230: call_tests++;
46231: des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
46232: des_xmlXPathContextPtr(n_ctx, ctx, 1);
46233: xmlResetLastError();
46234: if (mem_base != xmlMemBlocks()) {
46235: printf("Leak of %d blocks found in xmlXPathEval",
46236: xmlMemBlocks() - mem_base);
46237: test_ret++;
46238: printf(" %d", n_str);
46239: printf(" %d", n_ctx);
46240: printf("\n");
46241: }
46242: }
46243: }
46244: function_tests++;
46245: #endif
46246:
46247: return(test_ret);
46248: }
46249:
46250:
46251: static int
46252: test_xmlXPathEvalExpression(void) {
46253: int test_ret = 0;
46254:
46255: #if defined(LIBXML_XPATH_ENABLED)
46256: int mem_base;
46257: xmlXPathObjectPtr ret_val;
46258: xmlChar * str; /* the XPath expression */
46259: int n_str;
46260: xmlXPathContextPtr ctxt; /* the XPath context */
46261: int n_ctxt;
46262:
46263: for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
46264: for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
46265: mem_base = xmlMemBlocks();
46266: str = gen_const_xmlChar_ptr(n_str, 0);
46267: ctxt = gen_xmlXPathContextPtr(n_ctxt, 1);
46268:
46269: ret_val = xmlXPathEvalExpression((const xmlChar *)str, ctxt);
46270: desret_xmlXPathObjectPtr(ret_val);
46271: call_tests++;
46272: des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
46273: des_xmlXPathContextPtr(n_ctxt, ctxt, 1);
46274: xmlResetLastError();
46275: if (mem_base != xmlMemBlocks()) {
46276: printf("Leak of %d blocks found in xmlXPathEvalExpression",
46277: xmlMemBlocks() - mem_base);
46278: test_ret++;
46279: printf(" %d", n_str);
46280: printf(" %d", n_ctxt);
46281: printf("\n");
46282: }
46283: }
46284: }
46285: function_tests++;
46286: #endif
46287:
46288: return(test_ret);
46289: }
46290:
46291:
46292: static int
46293: test_xmlXPathEvalPredicate(void) {
46294: int test_ret = 0;
46295:
46296: #if defined(LIBXML_XPATH_ENABLED)
46297: int mem_base;
46298: int ret_val;
46299: xmlXPathContextPtr ctxt; /* the XPath context */
46300: int n_ctxt;
46301: xmlXPathObjectPtr res; /* the Predicate Expression evaluation result */
46302: int n_res;
46303:
46304: for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
46305: for (n_res = 0;n_res < gen_nb_xmlXPathObjectPtr;n_res++) {
46306: mem_base = xmlMemBlocks();
46307: ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
46308: res = gen_xmlXPathObjectPtr(n_res, 1);
46309:
46310: ret_val = xmlXPathEvalPredicate(ctxt, res);
46311: desret_int(ret_val);
46312: call_tests++;
46313: des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
46314: des_xmlXPathObjectPtr(n_res, res, 1);
46315: xmlResetLastError();
46316: if (mem_base != xmlMemBlocks()) {
46317: printf("Leak of %d blocks found in xmlXPathEvalPredicate",
46318: xmlMemBlocks() - mem_base);
46319: test_ret++;
46320: printf(" %d", n_ctxt);
46321: printf(" %d", n_res);
46322: printf("\n");
46323: }
46324: }
46325: }
46326: function_tests++;
46327: #endif
46328:
46329: return(test_ret);
46330: }
46331:
46332:
46333: static int
46334: test_xmlXPathInit(void) {
46335: int test_ret = 0;
46336:
46337: #if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
46338: int mem_base;
46339:
46340: mem_base = xmlMemBlocks();
46341:
46342: xmlXPathInit();
46343: call_tests++;
46344: xmlResetLastError();
46345: if (mem_base != xmlMemBlocks()) {
46346: printf("Leak of %d blocks found in xmlXPathInit",
46347: xmlMemBlocks() - mem_base);
46348: test_ret++;
46349: printf("\n");
46350: }
46351: function_tests++;
46352: #endif
46353:
46354: return(test_ret);
46355: }
46356:
46357:
46358: static int
46359: test_xmlXPathIsInf(void) {
46360: int test_ret = 0;
46361:
46362: #if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
46363: int mem_base;
46364: int ret_val;
46365: double val; /* a double value */
46366: int n_val;
46367:
46368: for (n_val = 0;n_val < gen_nb_double;n_val++) {
46369: mem_base = xmlMemBlocks();
46370: val = gen_double(n_val, 0);
46371:
46372: ret_val = xmlXPathIsInf(val);
46373: desret_int(ret_val);
46374: call_tests++;
46375: des_double(n_val, val, 0);
46376: xmlResetLastError();
46377: if (mem_base != xmlMemBlocks()) {
46378: printf("Leak of %d blocks found in xmlXPathIsInf",
46379: xmlMemBlocks() - mem_base);
46380: test_ret++;
46381: printf(" %d", n_val);
46382: printf("\n");
46383: }
46384: }
46385: function_tests++;
46386: #endif
46387:
46388: return(test_ret);
46389: }
46390:
46391:
46392: static int
46393: test_xmlXPathIsNaN(void) {
46394: int test_ret = 0;
46395:
46396: #if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
46397: int mem_base;
46398: int ret_val;
46399: double val; /* a double value */
46400: int n_val;
46401:
46402: for (n_val = 0;n_val < gen_nb_double;n_val++) {
46403: mem_base = xmlMemBlocks();
46404: val = gen_double(n_val, 0);
46405:
46406: ret_val = xmlXPathIsNaN(val);
46407: desret_int(ret_val);
46408: call_tests++;
46409: des_double(n_val, val, 0);
46410: xmlResetLastError();
46411: if (mem_base != xmlMemBlocks()) {
46412: printf("Leak of %d blocks found in xmlXPathIsNaN",
46413: xmlMemBlocks() - mem_base);
46414: test_ret++;
46415: printf(" %d", n_val);
46416: printf("\n");
46417: }
46418: }
46419: function_tests++;
46420: #endif
46421:
46422: return(test_ret);
46423: }
46424:
46425:
46426: static int
46427: test_xmlXPathNewContext(void) {
46428: int test_ret = 0;
46429:
46430:
46431: /* missing type support */
46432: return(test_ret);
46433: }
46434:
46435:
46436: static int
46437: test_xmlXPathNodeSetCreate(void) {
46438: int test_ret = 0;
46439:
46440: #if defined(LIBXML_XPATH_ENABLED)
46441: int mem_base;
46442: xmlNodeSetPtr ret_val;
46443: xmlNodePtr val; /* an initial xmlNodePtr, or NULL */
46444: int n_val;
46445:
46446: for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
46447: mem_base = xmlMemBlocks();
46448: val = gen_xmlNodePtr(n_val, 0);
46449:
46450: ret_val = xmlXPathNodeSetCreate(val);
46451: desret_xmlNodeSetPtr(ret_val);
46452: call_tests++;
46453: des_xmlNodePtr(n_val, val, 0);
46454: xmlResetLastError();
46455: if (mem_base != xmlMemBlocks()) {
46456: printf("Leak of %d blocks found in xmlXPathNodeSetCreate",
46457: xmlMemBlocks() - mem_base);
46458: test_ret++;
46459: printf(" %d", n_val);
46460: printf("\n");
46461: }
46462: }
46463: function_tests++;
46464: #endif
46465:
46466: return(test_ret);
46467: }
46468:
46469:
46470: static int
46471: test_xmlXPathObjectCopy(void) {
46472: int test_ret = 0;
46473:
46474: #if defined(LIBXML_XPATH_ENABLED)
46475: int mem_base;
46476: xmlXPathObjectPtr ret_val;
46477: xmlXPathObjectPtr val; /* the original object */
46478: int n_val;
46479:
46480: for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
46481: mem_base = xmlMemBlocks();
46482: val = gen_xmlXPathObjectPtr(n_val, 0);
46483:
46484: ret_val = xmlXPathObjectCopy(val);
46485: desret_xmlXPathObjectPtr(ret_val);
46486: call_tests++;
46487: des_xmlXPathObjectPtr(n_val, val, 0);
46488: xmlResetLastError();
46489: if (mem_base != xmlMemBlocks()) {
46490: printf("Leak of %d blocks found in xmlXPathObjectCopy",
46491: xmlMemBlocks() - mem_base);
46492: test_ret++;
46493: printf(" %d", n_val);
46494: printf("\n");
46495: }
46496: }
46497: function_tests++;
46498: #endif
46499:
46500: return(test_ret);
46501: }
46502:
46503:
46504: static int
46505: test_xmlXPathOrderDocElems(void) {
46506: int test_ret = 0;
46507:
46508: #if defined(LIBXML_XPATH_ENABLED)
46509: int mem_base;
46510: long ret_val;
46511: xmlDocPtr doc; /* an input document */
46512: int n_doc;
46513:
46514: for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
46515: mem_base = xmlMemBlocks();
46516: doc = gen_xmlDocPtr(n_doc, 0);
46517:
46518: ret_val = xmlXPathOrderDocElems(doc);
46519: desret_long(ret_val);
46520: call_tests++;
46521: des_xmlDocPtr(n_doc, doc, 0);
46522: xmlResetLastError();
46523: if (mem_base != xmlMemBlocks()) {
46524: printf("Leak of %d blocks found in xmlXPathOrderDocElems",
46525: xmlMemBlocks() - mem_base);
46526: test_ret++;
46527: printf(" %d", n_doc);
46528: printf("\n");
46529: }
46530: }
46531: function_tests++;
46532: #endif
46533:
46534: return(test_ret);
46535: }
46536:
46537: static int
46538: test_xpath(void) {
46539: int test_ret = 0;
46540:
46541: if (quiet == 0) printf("Testing xpath : 30 of 38 functions ...\n");
46542: test_ret += test_xmlXPathCastBooleanToNumber();
46543: test_ret += test_xmlXPathCastBooleanToString();
46544: test_ret += test_xmlXPathCastNodeSetToBoolean();
46545: test_ret += test_xmlXPathCastNodeSetToNumber();
46546: test_ret += test_xmlXPathCastNodeSetToString();
46547: test_ret += test_xmlXPathCastNodeToNumber();
46548: test_ret += test_xmlXPathCastNodeToString();
46549: test_ret += test_xmlXPathCastNumberToBoolean();
46550: test_ret += test_xmlXPathCastNumberToString();
46551: test_ret += test_xmlXPathCastStringToBoolean();
46552: test_ret += test_xmlXPathCastStringToNumber();
46553: test_ret += test_xmlXPathCastToBoolean();
46554: test_ret += test_xmlXPathCastToNumber();
46555: test_ret += test_xmlXPathCastToString();
46556: test_ret += test_xmlXPathCmpNodes();
46557: test_ret += test_xmlXPathCompile();
46558: test_ret += test_xmlXPathCompiledEval();
46559: test_ret += test_xmlXPathCompiledEvalToBoolean();
46560: test_ret += test_xmlXPathContextSetCache();
46561: test_ret += test_xmlXPathConvertBoolean();
46562: test_ret += test_xmlXPathConvertNumber();
46563: test_ret += test_xmlXPathConvertString();
46564: test_ret += test_xmlXPathCtxtCompile();
46565: test_ret += test_xmlXPathEval();
46566: test_ret += test_xmlXPathEvalExpression();
46567: test_ret += test_xmlXPathEvalPredicate();
46568: test_ret += test_xmlXPathInit();
46569: test_ret += test_xmlXPathIsInf();
46570: test_ret += test_xmlXPathIsNaN();
46571: test_ret += test_xmlXPathNewContext();
46572: test_ret += test_xmlXPathNodeSetCreate();
46573: test_ret += test_xmlXPathObjectCopy();
46574: test_ret += test_xmlXPathOrderDocElems();
46575:
46576: if (test_ret != 0)
46577: printf("Module xpath: %d errors\n", test_ret);
46578: return(test_ret);
46579: }
46580: #ifdef LIBXML_XPATH_ENABLED
46581:
46582: #define gen_nb_xmlXPathParserContextPtr 1
46583: static xmlXPathParserContextPtr gen_xmlXPathParserContextPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
46584: return(NULL);
46585: }
46586: static void des_xmlXPathParserContextPtr(int no ATTRIBUTE_UNUSED, xmlXPathParserContextPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
46587: }
46588: #endif
46589:
46590:
46591: static int
46592: test_valuePop(void) {
46593: int test_ret = 0;
46594:
46595: #if defined(LIBXML_XPATH_ENABLED)
46596: int mem_base;
46597: xmlXPathObjectPtr ret_val;
46598: xmlXPathParserContextPtr ctxt; /* an XPath evaluation context */
46599: int n_ctxt;
46600:
46601: for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46602: mem_base = xmlMemBlocks();
46603: ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46604:
46605: ret_val = valuePop(ctxt);
46606: desret_xmlXPathObjectPtr(ret_val);
46607: call_tests++;
46608: des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46609: xmlResetLastError();
46610: if (mem_base != xmlMemBlocks()) {
46611: printf("Leak of %d blocks found in valuePop",
46612: xmlMemBlocks() - mem_base);
46613: test_ret++;
46614: printf(" %d", n_ctxt);
46615: printf("\n");
46616: }
46617: }
46618: function_tests++;
46619: #endif
46620:
46621: return(test_ret);
46622: }
46623:
46624:
46625: static int
46626: test_valuePush(void) {
46627: int test_ret = 0;
46628:
46629: #if defined(LIBXML_XPATH_ENABLED)
46630: int mem_base;
46631: int ret_val;
46632: xmlXPathParserContextPtr ctxt; /* an XPath evaluation context */
46633: int n_ctxt;
46634: xmlXPathObjectPtr value; /* the XPath object */
46635: int n_value;
46636:
46637: for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46638: for (n_value = 0;n_value < gen_nb_xmlXPathObjectPtr;n_value++) {
46639: mem_base = xmlMemBlocks();
46640: ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46641: value = gen_xmlXPathObjectPtr(n_value, 1);
46642:
46643: ret_val = valuePush(ctxt, value);
46644: desret_int(ret_val);
46645: call_tests++;
46646: des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46647: des_xmlXPathObjectPtr(n_value, value, 1);
46648: xmlResetLastError();
46649: if (mem_base != xmlMemBlocks()) {
46650: printf("Leak of %d blocks found in valuePush",
46651: xmlMemBlocks() - mem_base);
46652: test_ret++;
46653: printf(" %d", n_ctxt);
46654: printf(" %d", n_value);
46655: printf("\n");
46656: }
46657: }
46658: }
46659: function_tests++;
46660: #endif
46661:
46662: return(test_ret);
46663: }
46664:
46665:
46666: static int
46667: test_xmlXPathAddValues(void) {
46668: int test_ret = 0;
46669:
46670: #if defined(LIBXML_XPATH_ENABLED)
46671: int mem_base;
46672: xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46673: int n_ctxt;
46674:
46675: for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46676: mem_base = xmlMemBlocks();
46677: ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46678:
46679: xmlXPathAddValues(ctxt);
46680: call_tests++;
46681: des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46682: xmlResetLastError();
46683: if (mem_base != xmlMemBlocks()) {
46684: printf("Leak of %d blocks found in xmlXPathAddValues",
46685: xmlMemBlocks() - mem_base);
46686: test_ret++;
46687: printf(" %d", n_ctxt);
46688: printf("\n");
46689: }
46690: }
46691: function_tests++;
46692: #endif
46693:
46694: return(test_ret);
46695: }
46696:
46697:
46698: static int
46699: test_xmlXPathBooleanFunction(void) {
46700: int test_ret = 0;
46701:
46702: #if defined(LIBXML_XPATH_ENABLED)
46703: int mem_base;
46704: xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46705: int n_ctxt;
46706: int nargs; /* the number of arguments */
46707: int n_nargs;
46708:
46709: for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46710: for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
46711: mem_base = xmlMemBlocks();
46712: ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46713: nargs = gen_int(n_nargs, 1);
46714:
46715: xmlXPathBooleanFunction(ctxt, nargs);
46716: call_tests++;
46717: des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46718: des_int(n_nargs, nargs, 1);
46719: xmlResetLastError();
46720: if (mem_base != xmlMemBlocks()) {
46721: printf("Leak of %d blocks found in xmlXPathBooleanFunction",
46722: xmlMemBlocks() - mem_base);
46723: test_ret++;
46724: printf(" %d", n_ctxt);
46725: printf(" %d", n_nargs);
46726: printf("\n");
46727: }
46728: }
46729: }
46730: function_tests++;
46731: #endif
46732:
46733: return(test_ret);
46734: }
46735:
46736:
46737: static int
46738: test_xmlXPathCeilingFunction(void) {
46739: int test_ret = 0;
46740:
46741: #if defined(LIBXML_XPATH_ENABLED)
46742: int mem_base;
46743: xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46744: int n_ctxt;
46745: int nargs; /* the number of arguments */
46746: int n_nargs;
46747:
46748: for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46749: for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
46750: mem_base = xmlMemBlocks();
46751: ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46752: nargs = gen_int(n_nargs, 1);
46753:
46754: xmlXPathCeilingFunction(ctxt, nargs);
46755: call_tests++;
46756: des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46757: des_int(n_nargs, nargs, 1);
46758: xmlResetLastError();
46759: if (mem_base != xmlMemBlocks()) {
46760: printf("Leak of %d blocks found in xmlXPathCeilingFunction",
46761: xmlMemBlocks() - mem_base);
46762: test_ret++;
46763: printf(" %d", n_ctxt);
46764: printf(" %d", n_nargs);
46765: printf("\n");
46766: }
46767: }
46768: }
46769: function_tests++;
46770: #endif
46771:
46772: return(test_ret);
46773: }
46774:
46775:
46776: static int
46777: test_xmlXPathCompareValues(void) {
46778: int test_ret = 0;
46779:
46780: #if defined(LIBXML_XPATH_ENABLED)
46781: int mem_base;
46782: int ret_val;
46783: xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46784: int n_ctxt;
46785: int inf; /* less than (1) or greater than (0) */
46786: int n_inf;
46787: int strict; /* is the comparison strict */
46788: int n_strict;
46789:
46790: for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46791: for (n_inf = 0;n_inf < gen_nb_int;n_inf++) {
46792: for (n_strict = 0;n_strict < gen_nb_int;n_strict++) {
46793: mem_base = xmlMemBlocks();
46794: ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46795: inf = gen_int(n_inf, 1);
46796: strict = gen_int(n_strict, 2);
46797:
46798: ret_val = xmlXPathCompareValues(ctxt, inf, strict);
46799: desret_int(ret_val);
46800: call_tests++;
46801: des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46802: des_int(n_inf, inf, 1);
46803: des_int(n_strict, strict, 2);
46804: xmlResetLastError();
46805: if (mem_base != xmlMemBlocks()) {
46806: printf("Leak of %d blocks found in xmlXPathCompareValues",
46807: xmlMemBlocks() - mem_base);
46808: test_ret++;
46809: printf(" %d", n_ctxt);
46810: printf(" %d", n_inf);
46811: printf(" %d", n_strict);
46812: printf("\n");
46813: }
46814: }
46815: }
46816: }
46817: function_tests++;
46818: #endif
46819:
46820: return(test_ret);
46821: }
46822:
46823:
46824: static int
46825: test_xmlXPathConcatFunction(void) {
46826: int test_ret = 0;
46827:
46828: #if defined(LIBXML_XPATH_ENABLED)
46829: int mem_base;
46830: xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46831: int n_ctxt;
46832: int nargs; /* the number of arguments */
46833: int n_nargs;
46834:
46835: for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46836: for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
46837: mem_base = xmlMemBlocks();
46838: ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46839: nargs = gen_int(n_nargs, 1);
46840:
46841: xmlXPathConcatFunction(ctxt, nargs);
46842: call_tests++;
46843: des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46844: des_int(n_nargs, nargs, 1);
46845: xmlResetLastError();
46846: if (mem_base != xmlMemBlocks()) {
46847: printf("Leak of %d blocks found in xmlXPathConcatFunction",
46848: xmlMemBlocks() - mem_base);
46849: test_ret++;
46850: printf(" %d", n_ctxt);
46851: printf(" %d", n_nargs);
46852: printf("\n");
46853: }
46854: }
46855: }
46856: function_tests++;
46857: #endif
46858:
46859: return(test_ret);
46860: }
46861:
46862:
46863: static int
46864: test_xmlXPathContainsFunction(void) {
46865: int test_ret = 0;
46866:
46867: #if defined(LIBXML_XPATH_ENABLED)
46868: int mem_base;
46869: xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46870: int n_ctxt;
46871: int nargs; /* the number of arguments */
46872: int n_nargs;
46873:
46874: for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46875: for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
46876: mem_base = xmlMemBlocks();
46877: ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46878: nargs = gen_int(n_nargs, 1);
46879:
46880: xmlXPathContainsFunction(ctxt, nargs);
46881: call_tests++;
46882: des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46883: des_int(n_nargs, nargs, 1);
46884: xmlResetLastError();
46885: if (mem_base != xmlMemBlocks()) {
46886: printf("Leak of %d blocks found in xmlXPathContainsFunction",
46887: xmlMemBlocks() - mem_base);
46888: test_ret++;
46889: printf(" %d", n_ctxt);
46890: printf(" %d", n_nargs);
46891: printf("\n");
46892: }
46893: }
46894: }
46895: function_tests++;
46896: #endif
46897:
46898: return(test_ret);
46899: }
46900:
46901:
46902: static int
46903: test_xmlXPathCountFunction(void) {
46904: int test_ret = 0;
46905:
46906: #if defined(LIBXML_XPATH_ENABLED)
46907: int mem_base;
46908: xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46909: int n_ctxt;
46910: int nargs; /* the number of arguments */
46911: int n_nargs;
46912:
46913: for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46914: for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
46915: mem_base = xmlMemBlocks();
46916: ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46917: nargs = gen_int(n_nargs, 1);
46918:
46919: xmlXPathCountFunction(ctxt, nargs);
46920: call_tests++;
46921: des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46922: des_int(n_nargs, nargs, 1);
46923: xmlResetLastError();
46924: if (mem_base != xmlMemBlocks()) {
46925: printf("Leak of %d blocks found in xmlXPathCountFunction",
46926: xmlMemBlocks() - mem_base);
46927: test_ret++;
46928: printf(" %d", n_ctxt);
46929: printf(" %d", n_nargs);
46930: printf("\n");
46931: }
46932: }
46933: }
46934: function_tests++;
46935: #endif
46936:
46937: return(test_ret);
46938: }
46939:
46940:
46941: static int
46942: test_xmlXPathDebugDumpCompExpr(void) {
46943: int test_ret = 0;
46944:
46945: #if defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_DEBUG_ENABLED)
46946: int mem_base;
46947: FILE * output; /* the FILE * for the output */
46948: int n_output;
46949: xmlXPathCompExprPtr comp; /* the precompiled XPath expression */
46950: int n_comp;
46951: int depth; /* the indentation level. */
46952: int n_depth;
46953:
46954: for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
46955: for (n_comp = 0;n_comp < gen_nb_xmlXPathCompExprPtr;n_comp++) {
46956: for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
46957: mem_base = xmlMemBlocks();
46958: output = gen_FILE_ptr(n_output, 0);
46959: comp = gen_xmlXPathCompExprPtr(n_comp, 1);
46960: depth = gen_int(n_depth, 2);
46961:
46962: xmlXPathDebugDumpCompExpr(output, comp, depth);
46963: call_tests++;
46964: des_FILE_ptr(n_output, output, 0);
46965: des_xmlXPathCompExprPtr(n_comp, comp, 1);
46966: des_int(n_depth, depth, 2);
46967: xmlResetLastError();
46968: if (mem_base != xmlMemBlocks()) {
46969: printf("Leak of %d blocks found in xmlXPathDebugDumpCompExpr",
46970: xmlMemBlocks() - mem_base);
46971: test_ret++;
46972: printf(" %d", n_output);
46973: printf(" %d", n_comp);
46974: printf(" %d", n_depth);
46975: printf("\n");
46976: }
46977: }
46978: }
46979: }
46980: function_tests++;
46981: #endif
46982:
46983: return(test_ret);
46984: }
46985:
46986:
46987: static int
46988: test_xmlXPathDebugDumpObject(void) {
46989: int test_ret = 0;
46990:
46991: #if defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_DEBUG_ENABLED)
46992: int mem_base;
46993: FILE * output; /* the FILE * to dump the output */
46994: int n_output;
46995: xmlXPathObjectPtr cur; /* the object to inspect */
46996: int n_cur;
46997: int depth; /* indentation level */
46998: int n_depth;
46999:
47000: for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
47001: for (n_cur = 0;n_cur < gen_nb_xmlXPathObjectPtr;n_cur++) {
47002: for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
47003: mem_base = xmlMemBlocks();
47004: output = gen_FILE_ptr(n_output, 0);
47005: cur = gen_xmlXPathObjectPtr(n_cur, 1);
47006: depth = gen_int(n_depth, 2);
47007:
47008: xmlXPathDebugDumpObject(output, cur, depth);
47009: call_tests++;
47010: des_FILE_ptr(n_output, output, 0);
47011: des_xmlXPathObjectPtr(n_cur, cur, 1);
47012: des_int(n_depth, depth, 2);
47013: xmlResetLastError();
47014: if (mem_base != xmlMemBlocks()) {
47015: printf("Leak of %d blocks found in xmlXPathDebugDumpObject",
47016: xmlMemBlocks() - mem_base);
47017: test_ret++;
47018: printf(" %d", n_output);
47019: printf(" %d", n_cur);
47020: printf(" %d", n_depth);
47021: printf("\n");
47022: }
47023: }
47024: }
47025: }
47026: function_tests++;
47027: #endif
47028:
47029: return(test_ret);
47030: }
47031:
47032:
47033: static int
47034: test_xmlXPathDifference(void) {
47035: int test_ret = 0;
47036:
47037: #if defined(LIBXML_XPATH_ENABLED)
47038: int mem_base;
47039: xmlNodeSetPtr ret_val;
47040: xmlNodeSetPtr nodes1; /* a node-set */
47041: int n_nodes1;
47042: xmlNodeSetPtr nodes2; /* a node-set */
47043: int n_nodes2;
47044:
47045: for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
47046: for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
47047: mem_base = xmlMemBlocks();
47048: nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
47049: nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
47050:
47051: ret_val = xmlXPathDifference(nodes1, nodes2);
47052: desret_xmlNodeSetPtr(ret_val);
47053: call_tests++;
47054: des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
47055: des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
47056: xmlResetLastError();
47057: if (mem_base != xmlMemBlocks()) {
47058: printf("Leak of %d blocks found in xmlXPathDifference",
47059: xmlMemBlocks() - mem_base);
47060: test_ret++;
47061: printf(" %d", n_nodes1);
47062: printf(" %d", n_nodes2);
47063: printf("\n");
47064: }
47065: }
47066: }
47067: function_tests++;
47068: #endif
47069:
47070: return(test_ret);
47071: }
47072:
47073:
47074: static int
47075: test_xmlXPathDistinct(void) {
47076: int test_ret = 0;
47077:
47078: #if defined(LIBXML_XPATH_ENABLED)
47079: int mem_base;
47080: xmlNodeSetPtr ret_val;
47081: xmlNodeSetPtr nodes; /* a node-set */
47082: int n_nodes;
47083:
47084: for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
47085: mem_base = xmlMemBlocks();
47086: nodes = gen_xmlNodeSetPtr(n_nodes, 0);
47087:
47088: ret_val = xmlXPathDistinct(nodes);
47089: desret_xmlNodeSetPtr(ret_val);
47090: call_tests++;
47091: des_xmlNodeSetPtr(n_nodes, nodes, 0);
47092: xmlResetLastError();
47093: if (mem_base != xmlMemBlocks()) {
47094: printf("Leak of %d blocks found in xmlXPathDistinct",
47095: xmlMemBlocks() - mem_base);
47096: test_ret++;
47097: printf(" %d", n_nodes);
47098: printf("\n");
47099: }
47100: }
47101: function_tests++;
47102: #endif
47103:
47104: return(test_ret);
47105: }
47106:
47107:
47108: static int
47109: test_xmlXPathDistinctSorted(void) {
47110: int test_ret = 0;
47111:
47112: #if defined(LIBXML_XPATH_ENABLED)
47113: int mem_base;
47114: xmlNodeSetPtr ret_val;
47115: xmlNodeSetPtr nodes; /* a node-set, sorted by document order */
47116: int n_nodes;
47117:
47118: for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
47119: mem_base = xmlMemBlocks();
47120: nodes = gen_xmlNodeSetPtr(n_nodes, 0);
47121:
47122: ret_val = xmlXPathDistinctSorted(nodes);
47123: desret_xmlNodeSetPtr(ret_val);
47124: call_tests++;
47125: des_xmlNodeSetPtr(n_nodes, nodes, 0);
47126: xmlResetLastError();
47127: if (mem_base != xmlMemBlocks()) {
47128: printf("Leak of %d blocks found in xmlXPathDistinctSorted",
47129: xmlMemBlocks() - mem_base);
47130: test_ret++;
47131: printf(" %d", n_nodes);
47132: printf("\n");
47133: }
47134: }
47135: function_tests++;
47136: #endif
47137:
47138: return(test_ret);
47139: }
47140:
47141:
47142: static int
47143: test_xmlXPathDivValues(void) {
47144: int test_ret = 0;
47145:
47146: #if defined(LIBXML_XPATH_ENABLED)
47147: int mem_base;
47148: xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47149: int n_ctxt;
47150:
47151: for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47152: mem_base = xmlMemBlocks();
47153: ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47154:
47155: xmlXPathDivValues(ctxt);
47156: call_tests++;
47157: des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47158: xmlResetLastError();
47159: if (mem_base != xmlMemBlocks()) {
47160: printf("Leak of %d blocks found in xmlXPathDivValues",
47161: xmlMemBlocks() - mem_base);
47162: test_ret++;
47163: printf(" %d", n_ctxt);
47164: printf("\n");
47165: }
47166: }
47167: function_tests++;
47168: #endif
47169:
47170: return(test_ret);
47171: }
47172:
47173:
47174: static int
47175: test_xmlXPathEqualValues(void) {
47176: int test_ret = 0;
47177:
47178: #if defined(LIBXML_XPATH_ENABLED)
47179: int mem_base;
47180: int ret_val;
47181: xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47182: int n_ctxt;
47183:
47184: for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47185: mem_base = xmlMemBlocks();
47186: ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47187:
47188: ret_val = xmlXPathEqualValues(ctxt);
47189: desret_int(ret_val);
47190: call_tests++;
47191: des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47192: xmlResetLastError();
47193: if (mem_base != xmlMemBlocks()) {
47194: printf("Leak of %d blocks found in xmlXPathEqualValues",
47195: xmlMemBlocks() - mem_base);
47196: test_ret++;
47197: printf(" %d", n_ctxt);
47198: printf("\n");
47199: }
47200: }
47201: function_tests++;
47202: #endif
47203:
47204: return(test_ret);
47205: }
47206:
47207:
47208: static int
47209: test_xmlXPathErr(void) {
47210: int test_ret = 0;
47211:
47212: #if defined(LIBXML_XPATH_ENABLED)
47213: int mem_base;
47214: xmlXPathParserContextPtr ctxt; /* a XPath parser context */
47215: int n_ctxt;
47216: int error; /* the error code */
47217: int n_error;
47218:
47219: for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47220: for (n_error = 0;n_error < gen_nb_int;n_error++) {
47221: mem_base = xmlMemBlocks();
47222: ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47223: error = gen_int(n_error, 1);
47224:
47225: xmlXPathErr(ctxt, error);
47226: call_tests++;
47227: des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47228: des_int(n_error, error, 1);
47229: xmlResetLastError();
47230: if (mem_base != xmlMemBlocks()) {
47231: printf("Leak of %d blocks found in xmlXPathErr",
47232: xmlMemBlocks() - mem_base);
47233: test_ret++;
47234: printf(" %d", n_ctxt);
47235: printf(" %d", n_error);
47236: printf("\n");
47237: }
47238: }
47239: }
47240: function_tests++;
47241: #endif
47242:
47243: return(test_ret);
47244: }
47245:
47246:
47247: static int
47248: test_xmlXPathEvalExpr(void) {
47249: int test_ret = 0;
47250:
47251: #if defined(LIBXML_XPATH_ENABLED)
47252: int mem_base;
47253: xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47254: int n_ctxt;
47255:
47256: for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47257: mem_base = xmlMemBlocks();
47258: ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47259:
47260: xmlXPathEvalExpr(ctxt);
47261: call_tests++;
47262: des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47263: xmlResetLastError();
47264: if (mem_base != xmlMemBlocks()) {
47265: printf("Leak of %d blocks found in xmlXPathEvalExpr",
47266: xmlMemBlocks() - mem_base);
47267: test_ret++;
47268: printf(" %d", n_ctxt);
47269: printf("\n");
47270: }
47271: }
47272: function_tests++;
47273: #endif
47274:
47275: return(test_ret);
47276: }
47277:
47278:
47279: static int
47280: test_xmlXPathEvaluatePredicateResult(void) {
47281: int test_ret = 0;
47282:
47283: #if defined(LIBXML_XPATH_ENABLED)
47284: int mem_base;
47285: int ret_val;
47286: xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47287: int n_ctxt;
47288: xmlXPathObjectPtr res; /* the Predicate Expression evaluation result */
47289: int n_res;
47290:
47291: for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47292: for (n_res = 0;n_res < gen_nb_xmlXPathObjectPtr;n_res++) {
47293: mem_base = xmlMemBlocks();
47294: ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47295: res = gen_xmlXPathObjectPtr(n_res, 1);
47296:
47297: ret_val = xmlXPathEvaluatePredicateResult(ctxt, res);
47298: desret_int(ret_val);
47299: call_tests++;
47300: des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47301: des_xmlXPathObjectPtr(n_res, res, 1);
47302: xmlResetLastError();
47303: if (mem_base != xmlMemBlocks()) {
47304: printf("Leak of %d blocks found in xmlXPathEvaluatePredicateResult",
47305: xmlMemBlocks() - mem_base);
47306: test_ret++;
47307: printf(" %d", n_ctxt);
47308: printf(" %d", n_res);
47309: printf("\n");
47310: }
47311: }
47312: }
47313: function_tests++;
47314: #endif
47315:
47316: return(test_ret);
47317: }
47318:
47319:
47320: static int
47321: test_xmlXPathFalseFunction(void) {
47322: int test_ret = 0;
47323:
47324: #if defined(LIBXML_XPATH_ENABLED)
47325: int mem_base;
47326: xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47327: int n_ctxt;
47328: int nargs; /* the number of arguments */
47329: int n_nargs;
47330:
47331: for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47332: for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47333: mem_base = xmlMemBlocks();
47334: ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47335: nargs = gen_int(n_nargs, 1);
47336:
47337: xmlXPathFalseFunction(ctxt, nargs);
47338: call_tests++;
47339: des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47340: des_int(n_nargs, nargs, 1);
47341: xmlResetLastError();
47342: if (mem_base != xmlMemBlocks()) {
47343: printf("Leak of %d blocks found in xmlXPathFalseFunction",
47344: xmlMemBlocks() - mem_base);
47345: test_ret++;
47346: printf(" %d", n_ctxt);
47347: printf(" %d", n_nargs);
47348: printf("\n");
47349: }
47350: }
47351: }
47352: function_tests++;
47353: #endif
47354:
47355: return(test_ret);
47356: }
47357:
47358:
47359: static int
47360: test_xmlXPathFloorFunction(void) {
47361: int test_ret = 0;
47362:
47363: #if defined(LIBXML_XPATH_ENABLED)
47364: int mem_base;
47365: xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47366: int n_ctxt;
47367: int nargs; /* the number of arguments */
47368: int n_nargs;
47369:
47370: for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47371: for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47372: mem_base = xmlMemBlocks();
47373: ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47374: nargs = gen_int(n_nargs, 1);
47375:
47376: xmlXPathFloorFunction(ctxt, nargs);
47377: call_tests++;
47378: des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47379: des_int(n_nargs, nargs, 1);
47380: xmlResetLastError();
47381: if (mem_base != xmlMemBlocks()) {
47382: printf("Leak of %d blocks found in xmlXPathFloorFunction",
47383: xmlMemBlocks() - mem_base);
47384: test_ret++;
47385: printf(" %d", n_ctxt);
47386: printf(" %d", n_nargs);
47387: printf("\n");
47388: }
47389: }
47390: }
47391: function_tests++;
47392: #endif
47393:
47394: return(test_ret);
47395: }
47396:
47397:
47398: static int
47399: test_xmlXPathFunctionLookup(void) {
47400: int test_ret = 0;
47401:
47402:
47403: /* missing type support */
47404: return(test_ret);
47405: }
47406:
47407:
47408: static int
47409: test_xmlXPathFunctionLookupNS(void) {
47410: int test_ret = 0;
47411:
47412:
47413: /* missing type support */
47414: return(test_ret);
47415: }
47416:
47417:
47418: static int
47419: test_xmlXPathHasSameNodes(void) {
47420: int test_ret = 0;
47421:
47422: #if defined(LIBXML_XPATH_ENABLED)
47423: int mem_base;
47424: int ret_val;
47425: xmlNodeSetPtr nodes1; /* a node-set */
47426: int n_nodes1;
47427: xmlNodeSetPtr nodes2; /* a node-set */
47428: int n_nodes2;
47429:
47430: for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
47431: for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
47432: mem_base = xmlMemBlocks();
47433: nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
47434: nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
47435:
47436: ret_val = xmlXPathHasSameNodes(nodes1, nodes2);
47437: desret_int(ret_val);
47438: call_tests++;
47439: des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
47440: des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
47441: xmlResetLastError();
47442: if (mem_base != xmlMemBlocks()) {
47443: printf("Leak of %d blocks found in xmlXPathHasSameNodes",
47444: xmlMemBlocks() - mem_base);
47445: test_ret++;
47446: printf(" %d", n_nodes1);
47447: printf(" %d", n_nodes2);
47448: printf("\n");
47449: }
47450: }
47451: }
47452: function_tests++;
47453: #endif
47454:
47455: return(test_ret);
47456: }
47457:
47458:
47459: static int
47460: test_xmlXPathIdFunction(void) {
47461: int test_ret = 0;
47462:
47463: #if defined(LIBXML_XPATH_ENABLED)
47464: int mem_base;
47465: xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47466: int n_ctxt;
47467: int nargs; /* the number of arguments */
47468: int n_nargs;
47469:
47470: for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47471: for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47472: mem_base = xmlMemBlocks();
47473: ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47474: nargs = gen_int(n_nargs, 1);
47475:
47476: xmlXPathIdFunction(ctxt, nargs);
47477: call_tests++;
47478: des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47479: des_int(n_nargs, nargs, 1);
47480: xmlResetLastError();
47481: if (mem_base != xmlMemBlocks()) {
47482: printf("Leak of %d blocks found in xmlXPathIdFunction",
47483: xmlMemBlocks() - mem_base);
47484: test_ret++;
47485: printf(" %d", n_ctxt);
47486: printf(" %d", n_nargs);
47487: printf("\n");
47488: }
47489: }
47490: }
47491: function_tests++;
47492: #endif
47493:
47494: return(test_ret);
47495: }
47496:
47497:
47498: static int
47499: test_xmlXPathIntersection(void) {
47500: int test_ret = 0;
47501:
47502: #if defined(LIBXML_XPATH_ENABLED)
47503: int mem_base;
47504: xmlNodeSetPtr ret_val;
47505: xmlNodeSetPtr nodes1; /* a node-set */
47506: int n_nodes1;
47507: xmlNodeSetPtr nodes2; /* a node-set */
47508: int n_nodes2;
47509:
47510: for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
47511: for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
47512: mem_base = xmlMemBlocks();
47513: nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
47514: nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
47515:
47516: ret_val = xmlXPathIntersection(nodes1, nodes2);
47517: desret_xmlNodeSetPtr(ret_val);
47518: call_tests++;
47519: des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
47520: des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
47521: xmlResetLastError();
47522: if (mem_base != xmlMemBlocks()) {
47523: printf("Leak of %d blocks found in xmlXPathIntersection",
47524: xmlMemBlocks() - mem_base);
47525: test_ret++;
47526: printf(" %d", n_nodes1);
47527: printf(" %d", n_nodes2);
47528: printf("\n");
47529: }
47530: }
47531: }
47532: function_tests++;
47533: #endif
47534:
47535: return(test_ret);
47536: }
47537:
47538:
47539: static int
47540: test_xmlXPathIsNodeType(void) {
47541: int test_ret = 0;
47542:
47543: #if defined(LIBXML_XPATH_ENABLED)
47544: int mem_base;
47545: int ret_val;
47546: xmlChar * name; /* a name string */
47547: int n_name;
47548:
47549: for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
47550: mem_base = xmlMemBlocks();
47551: name = gen_const_xmlChar_ptr(n_name, 0);
47552:
47553: ret_val = xmlXPathIsNodeType((const xmlChar *)name);
47554: desret_int(ret_val);
47555: call_tests++;
47556: des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
47557: xmlResetLastError();
47558: if (mem_base != xmlMemBlocks()) {
47559: printf("Leak of %d blocks found in xmlXPathIsNodeType",
47560: xmlMemBlocks() - mem_base);
47561: test_ret++;
47562: printf(" %d", n_name);
47563: printf("\n");
47564: }
47565: }
47566: function_tests++;
47567: #endif
47568:
47569: return(test_ret);
47570: }
47571:
47572:
47573: static int
47574: test_xmlXPathLangFunction(void) {
47575: int test_ret = 0;
47576:
47577: #if defined(LIBXML_XPATH_ENABLED)
47578: int mem_base;
47579: xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47580: int n_ctxt;
47581: int nargs; /* the number of arguments */
47582: int n_nargs;
47583:
47584: for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47585: for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47586: mem_base = xmlMemBlocks();
47587: ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47588: nargs = gen_int(n_nargs, 1);
47589:
47590: xmlXPathLangFunction(ctxt, nargs);
47591: call_tests++;
47592: des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47593: des_int(n_nargs, nargs, 1);
47594: xmlResetLastError();
47595: if (mem_base != xmlMemBlocks()) {
47596: printf("Leak of %d blocks found in xmlXPathLangFunction",
47597: xmlMemBlocks() - mem_base);
47598: test_ret++;
47599: printf(" %d", n_ctxt);
47600: printf(" %d", n_nargs);
47601: printf("\n");
47602: }
47603: }
47604: }
47605: function_tests++;
47606: #endif
47607:
47608: return(test_ret);
47609: }
47610:
47611:
47612: static int
47613: test_xmlXPathLastFunction(void) {
47614: int test_ret = 0;
47615:
47616: #if defined(LIBXML_XPATH_ENABLED)
47617: int mem_base;
47618: xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47619: int n_ctxt;
47620: int nargs; /* the number of arguments */
47621: int n_nargs;
47622:
47623: for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47624: for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47625: mem_base = xmlMemBlocks();
47626: ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47627: nargs = gen_int(n_nargs, 1);
47628:
47629: xmlXPathLastFunction(ctxt, nargs);
47630: call_tests++;
47631: des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47632: des_int(n_nargs, nargs, 1);
47633: xmlResetLastError();
47634: if (mem_base != xmlMemBlocks()) {
47635: printf("Leak of %d blocks found in xmlXPathLastFunction",
47636: xmlMemBlocks() - mem_base);
47637: test_ret++;
47638: printf(" %d", n_ctxt);
47639: printf(" %d", n_nargs);
47640: printf("\n");
47641: }
47642: }
47643: }
47644: function_tests++;
47645: #endif
47646:
47647: return(test_ret);
47648: }
47649:
47650:
47651: static int
47652: test_xmlXPathLeading(void) {
47653: int test_ret = 0;
47654:
47655: #if defined(LIBXML_XPATH_ENABLED)
47656: int mem_base;
47657: xmlNodeSetPtr ret_val;
47658: xmlNodeSetPtr nodes1; /* a node-set */
47659: int n_nodes1;
47660: xmlNodeSetPtr nodes2; /* a node-set */
47661: int n_nodes2;
47662:
47663: for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
47664: for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
47665: mem_base = xmlMemBlocks();
47666: nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
47667: nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
47668:
47669: ret_val = xmlXPathLeading(nodes1, nodes2);
47670: desret_xmlNodeSetPtr(ret_val);
47671: call_tests++;
47672: des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
47673: des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
47674: xmlResetLastError();
47675: if (mem_base != xmlMemBlocks()) {
47676: printf("Leak of %d blocks found in xmlXPathLeading",
47677: xmlMemBlocks() - mem_base);
47678: test_ret++;
47679: printf(" %d", n_nodes1);
47680: printf(" %d", n_nodes2);
47681: printf("\n");
47682: }
47683: }
47684: }
47685: function_tests++;
47686: #endif
47687:
47688: return(test_ret);
47689: }
47690:
47691:
47692: static int
47693: test_xmlXPathLeadingSorted(void) {
47694: int test_ret = 0;
47695:
47696: #if defined(LIBXML_XPATH_ENABLED)
47697: int mem_base;
47698: xmlNodeSetPtr ret_val;
47699: xmlNodeSetPtr nodes1; /* a node-set, sorted by document order */
47700: int n_nodes1;
47701: xmlNodeSetPtr nodes2; /* a node-set, sorted by document order */
47702: int n_nodes2;
47703:
47704: for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
47705: for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
47706: mem_base = xmlMemBlocks();
47707: nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
47708: nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
47709:
47710: ret_val = xmlXPathLeadingSorted(nodes1, nodes2);
47711: desret_xmlNodeSetPtr(ret_val);
47712: call_tests++;
47713: des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
47714: des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
47715: xmlResetLastError();
47716: if (mem_base != xmlMemBlocks()) {
47717: printf("Leak of %d blocks found in xmlXPathLeadingSorted",
47718: xmlMemBlocks() - mem_base);
47719: test_ret++;
47720: printf(" %d", n_nodes1);
47721: printf(" %d", n_nodes2);
47722: printf("\n");
47723: }
47724: }
47725: }
47726: function_tests++;
47727: #endif
47728:
47729: return(test_ret);
47730: }
47731:
47732:
47733: static int
47734: test_xmlXPathLocalNameFunction(void) {
47735: int test_ret = 0;
47736:
47737: #if defined(LIBXML_XPATH_ENABLED)
47738: int mem_base;
47739: xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47740: int n_ctxt;
47741: int nargs; /* the number of arguments */
47742: int n_nargs;
47743:
47744: for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47745: for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47746: mem_base = xmlMemBlocks();
47747: ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47748: nargs = gen_int(n_nargs, 1);
47749:
47750: xmlXPathLocalNameFunction(ctxt, nargs);
47751: call_tests++;
47752: des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47753: des_int(n_nargs, nargs, 1);
47754: xmlResetLastError();
47755: if (mem_base != xmlMemBlocks()) {
47756: printf("Leak of %d blocks found in xmlXPathLocalNameFunction",
47757: xmlMemBlocks() - mem_base);
47758: test_ret++;
47759: printf(" %d", n_ctxt);
47760: printf(" %d", n_nargs);
47761: printf("\n");
47762: }
47763: }
47764: }
47765: function_tests++;
47766: #endif
47767:
47768: return(test_ret);
47769: }
47770:
47771:
47772: static int
47773: test_xmlXPathModValues(void) {
47774: int test_ret = 0;
47775:
47776: #if defined(LIBXML_XPATH_ENABLED)
47777: int mem_base;
47778: xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47779: int n_ctxt;
47780:
47781: for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47782: mem_base = xmlMemBlocks();
47783: ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47784:
47785: xmlXPathModValues(ctxt);
47786: call_tests++;
47787: des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47788: xmlResetLastError();
47789: if (mem_base != xmlMemBlocks()) {
47790: printf("Leak of %d blocks found in xmlXPathModValues",
47791: xmlMemBlocks() - mem_base);
47792: test_ret++;
47793: printf(" %d", n_ctxt);
47794: printf("\n");
47795: }
47796: }
47797: function_tests++;
47798: #endif
47799:
47800: return(test_ret);
47801: }
47802:
47803:
47804: static int
47805: test_xmlXPathMultValues(void) {
47806: int test_ret = 0;
47807:
47808: #if defined(LIBXML_XPATH_ENABLED)
47809: int mem_base;
47810: xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47811: int n_ctxt;
47812:
47813: for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47814: mem_base = xmlMemBlocks();
47815: ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47816:
47817: xmlXPathMultValues(ctxt);
47818: call_tests++;
47819: des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47820: xmlResetLastError();
47821: if (mem_base != xmlMemBlocks()) {
47822: printf("Leak of %d blocks found in xmlXPathMultValues",
47823: xmlMemBlocks() - mem_base);
47824: test_ret++;
47825: printf(" %d", n_ctxt);
47826: printf("\n");
47827: }
47828: }
47829: function_tests++;
47830: #endif
47831:
47832: return(test_ret);
47833: }
47834:
47835:
47836: static int
47837: test_xmlXPathNamespaceURIFunction(void) {
47838: int test_ret = 0;
47839:
47840: #if defined(LIBXML_XPATH_ENABLED)
47841: int mem_base;
47842: xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47843: int n_ctxt;
47844: int nargs; /* the number of arguments */
47845: int n_nargs;
47846:
47847: for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47848: for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47849: mem_base = xmlMemBlocks();
47850: ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47851: nargs = gen_int(n_nargs, 1);
47852:
47853: xmlXPathNamespaceURIFunction(ctxt, nargs);
47854: call_tests++;
47855: des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47856: des_int(n_nargs, nargs, 1);
47857: xmlResetLastError();
47858: if (mem_base != xmlMemBlocks()) {
47859: printf("Leak of %d blocks found in xmlXPathNamespaceURIFunction",
47860: xmlMemBlocks() - mem_base);
47861: test_ret++;
47862: printf(" %d", n_ctxt);
47863: printf(" %d", n_nargs);
47864: printf("\n");
47865: }
47866: }
47867: }
47868: function_tests++;
47869: #endif
47870:
47871: return(test_ret);
47872: }
47873:
47874:
47875: static int
47876: test_xmlXPathNewBoolean(void) {
47877: int test_ret = 0;
47878:
47879: #if defined(LIBXML_XPATH_ENABLED)
47880: int mem_base;
47881: xmlXPathObjectPtr ret_val;
47882: int val; /* the boolean value */
47883: int n_val;
47884:
47885: for (n_val = 0;n_val < gen_nb_int;n_val++) {
47886: mem_base = xmlMemBlocks();
47887: val = gen_int(n_val, 0);
47888:
47889: ret_val = xmlXPathNewBoolean(val);
47890: desret_xmlXPathObjectPtr(ret_val);
47891: call_tests++;
47892: des_int(n_val, val, 0);
47893: xmlResetLastError();
47894: if (mem_base != xmlMemBlocks()) {
47895: printf("Leak of %d blocks found in xmlXPathNewBoolean",
47896: xmlMemBlocks() - mem_base);
47897: test_ret++;
47898: printf(" %d", n_val);
47899: printf("\n");
47900: }
47901: }
47902: function_tests++;
47903: #endif
47904:
47905: return(test_ret);
47906: }
47907:
47908:
47909: static int
47910: test_xmlXPathNewCString(void) {
47911: int test_ret = 0;
47912:
47913: #if defined(LIBXML_XPATH_ENABLED)
47914: int mem_base;
47915: xmlXPathObjectPtr ret_val;
47916: char * val; /* the char * value */
47917: int n_val;
47918:
47919: for (n_val = 0;n_val < gen_nb_const_char_ptr;n_val++) {
47920: mem_base = xmlMemBlocks();
47921: val = gen_const_char_ptr(n_val, 0);
47922:
47923: ret_val = xmlXPathNewCString((const char *)val);
47924: desret_xmlXPathObjectPtr(ret_val);
47925: call_tests++;
47926: des_const_char_ptr(n_val, (const char *)val, 0);
47927: xmlResetLastError();
47928: if (mem_base != xmlMemBlocks()) {
47929: printf("Leak of %d blocks found in xmlXPathNewCString",
47930: xmlMemBlocks() - mem_base);
47931: test_ret++;
47932: printf(" %d", n_val);
47933: printf("\n");
47934: }
47935: }
47936: function_tests++;
47937: #endif
47938:
47939: return(test_ret);
47940: }
47941:
47942:
47943: static int
47944: test_xmlXPathNewFloat(void) {
47945: int test_ret = 0;
47946:
47947: #if defined(LIBXML_XPATH_ENABLED)
47948: int mem_base;
47949: xmlXPathObjectPtr ret_val;
47950: double val; /* the double value */
47951: int n_val;
47952:
47953: for (n_val = 0;n_val < gen_nb_double;n_val++) {
47954: mem_base = xmlMemBlocks();
47955: val = gen_double(n_val, 0);
47956:
47957: ret_val = xmlXPathNewFloat(val);
47958: desret_xmlXPathObjectPtr(ret_val);
47959: call_tests++;
47960: des_double(n_val, val, 0);
47961: xmlResetLastError();
47962: if (mem_base != xmlMemBlocks()) {
47963: printf("Leak of %d blocks found in xmlXPathNewFloat",
47964: xmlMemBlocks() - mem_base);
47965: test_ret++;
47966: printf(" %d", n_val);
47967: printf("\n");
47968: }
47969: }
47970: function_tests++;
47971: #endif
47972:
47973: return(test_ret);
47974: }
47975:
47976:
47977: static int
47978: test_xmlXPathNewNodeSet(void) {
47979: int test_ret = 0;
47980:
47981: #if defined(LIBXML_XPATH_ENABLED)
47982: int mem_base;
47983: xmlXPathObjectPtr ret_val;
47984: xmlNodePtr val; /* the NodePtr value */
47985: int n_val;
47986:
47987: for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
47988: mem_base = xmlMemBlocks();
47989: val = gen_xmlNodePtr(n_val, 0);
47990:
47991: ret_val = xmlXPathNewNodeSet(val);
47992: desret_xmlXPathObjectPtr(ret_val);
47993: call_tests++;
47994: des_xmlNodePtr(n_val, val, 0);
47995: xmlResetLastError();
47996: if (mem_base != xmlMemBlocks()) {
47997: printf("Leak of %d blocks found in xmlXPathNewNodeSet",
47998: xmlMemBlocks() - mem_base);
47999: test_ret++;
48000: printf(" %d", n_val);
48001: printf("\n");
48002: }
48003: }
48004: function_tests++;
48005: #endif
48006:
48007: return(test_ret);
48008: }
48009:
48010:
48011: static int
48012: test_xmlXPathNewNodeSetList(void) {
48013: int test_ret = 0;
48014:
48015: #if defined(LIBXML_XPATH_ENABLED)
48016: int mem_base;
48017: xmlXPathObjectPtr ret_val;
48018: xmlNodeSetPtr val; /* an existing NodeSet */
48019: int n_val;
48020:
48021: for (n_val = 0;n_val < gen_nb_xmlNodeSetPtr;n_val++) {
48022: mem_base = xmlMemBlocks();
48023: val = gen_xmlNodeSetPtr(n_val, 0);
48024:
48025: ret_val = xmlXPathNewNodeSetList(val);
48026: desret_xmlXPathObjectPtr(ret_val);
48027: call_tests++;
48028: des_xmlNodeSetPtr(n_val, val, 0);
48029: xmlResetLastError();
48030: if (mem_base != xmlMemBlocks()) {
48031: printf("Leak of %d blocks found in xmlXPathNewNodeSetList",
48032: xmlMemBlocks() - mem_base);
48033: test_ret++;
48034: printf(" %d", n_val);
48035: printf("\n");
48036: }
48037: }
48038: function_tests++;
48039: #endif
48040:
48041: return(test_ret);
48042: }
48043:
48044:
48045: static int
48046: test_xmlXPathNewParserContext(void) {
48047: int test_ret = 0;
48048:
48049:
48050: /* missing type support */
48051: return(test_ret);
48052: }
48053:
48054:
48055: static int
48056: test_xmlXPathNewString(void) {
48057: int test_ret = 0;
48058:
48059: #if defined(LIBXML_XPATH_ENABLED)
48060: int mem_base;
48061: xmlXPathObjectPtr ret_val;
48062: xmlChar * val; /* the xmlChar * value */
48063: int n_val;
48064:
48065: for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
48066: mem_base = xmlMemBlocks();
48067: val = gen_const_xmlChar_ptr(n_val, 0);
48068:
48069: ret_val = xmlXPathNewString((const xmlChar *)val);
48070: desret_xmlXPathObjectPtr(ret_val);
48071: call_tests++;
48072: des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 0);
48073: xmlResetLastError();
48074: if (mem_base != xmlMemBlocks()) {
48075: printf("Leak of %d blocks found in xmlXPathNewString",
48076: xmlMemBlocks() - mem_base);
48077: test_ret++;
48078: printf(" %d", n_val);
48079: printf("\n");
48080: }
48081: }
48082: function_tests++;
48083: #endif
48084:
48085: return(test_ret);
48086: }
48087:
48088:
48089: static int
48090: test_xmlXPathNextAncestor(void) {
48091: int test_ret = 0;
48092:
48093: #if defined(LIBXML_XPATH_ENABLED)
48094: int mem_base;
48095: xmlNodePtr ret_val;
48096: xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48097: int n_ctxt;
48098: xmlNodePtr cur; /* the current node in the traversal */
48099: int n_cur;
48100:
48101: for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48102: for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48103: mem_base = xmlMemBlocks();
48104: ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48105: cur = gen_xmlNodePtr(n_cur, 1);
48106:
48107: ret_val = xmlXPathNextAncestor(ctxt, cur);
48108: desret_xmlNodePtr(ret_val);
48109: call_tests++;
48110: des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48111: des_xmlNodePtr(n_cur, cur, 1);
48112: xmlResetLastError();
48113: if (mem_base != xmlMemBlocks()) {
48114: printf("Leak of %d blocks found in xmlXPathNextAncestor",
48115: xmlMemBlocks() - mem_base);
48116: test_ret++;
48117: printf(" %d", n_ctxt);
48118: printf(" %d", n_cur);
48119: printf("\n");
48120: }
48121: }
48122: }
48123: function_tests++;
48124: #endif
48125:
48126: return(test_ret);
48127: }
48128:
48129:
48130: static int
48131: test_xmlXPathNextAncestorOrSelf(void) {
48132: int test_ret = 0;
48133:
48134: #if defined(LIBXML_XPATH_ENABLED)
48135: int mem_base;
48136: xmlNodePtr ret_val;
48137: xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48138: int n_ctxt;
48139: xmlNodePtr cur; /* the current node in the traversal */
48140: int n_cur;
48141:
48142: for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48143: for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48144: mem_base = xmlMemBlocks();
48145: ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48146: cur = gen_xmlNodePtr(n_cur, 1);
48147:
48148: ret_val = xmlXPathNextAncestorOrSelf(ctxt, cur);
48149: desret_xmlNodePtr(ret_val);
48150: call_tests++;
48151: des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48152: des_xmlNodePtr(n_cur, cur, 1);
48153: xmlResetLastError();
48154: if (mem_base != xmlMemBlocks()) {
48155: printf("Leak of %d blocks found in xmlXPathNextAncestorOrSelf",
48156: xmlMemBlocks() - mem_base);
48157: test_ret++;
48158: printf(" %d", n_ctxt);
48159: printf(" %d", n_cur);
48160: printf("\n");
48161: }
48162: }
48163: }
48164: function_tests++;
48165: #endif
48166:
48167: return(test_ret);
48168: }
48169:
48170:
48171: static int
48172: test_xmlXPathNextAttribute(void) {
48173: int test_ret = 0;
48174:
48175: #if defined(LIBXML_XPATH_ENABLED)
48176: int mem_base;
48177: xmlNodePtr ret_val;
48178: xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48179: int n_ctxt;
48180: xmlNodePtr cur; /* the current attribute in the traversal */
48181: int n_cur;
48182:
48183: for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48184: for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48185: mem_base = xmlMemBlocks();
48186: ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48187: cur = gen_xmlNodePtr(n_cur, 1);
48188:
48189: ret_val = xmlXPathNextAttribute(ctxt, cur);
48190: desret_xmlNodePtr(ret_val);
48191: call_tests++;
48192: des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48193: des_xmlNodePtr(n_cur, cur, 1);
48194: xmlResetLastError();
48195: if (mem_base != xmlMemBlocks()) {
48196: printf("Leak of %d blocks found in xmlXPathNextAttribute",
48197: xmlMemBlocks() - mem_base);
48198: test_ret++;
48199: printf(" %d", n_ctxt);
48200: printf(" %d", n_cur);
48201: printf("\n");
48202: }
48203: }
48204: }
48205: function_tests++;
48206: #endif
48207:
48208: return(test_ret);
48209: }
48210:
48211:
48212: static int
48213: test_xmlXPathNextChild(void) {
48214: int test_ret = 0;
48215:
48216: #if defined(LIBXML_XPATH_ENABLED)
48217: int mem_base;
48218: xmlNodePtr ret_val;
48219: xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48220: int n_ctxt;
48221: xmlNodePtr cur; /* the current node in the traversal */
48222: int n_cur;
48223:
48224: for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48225: for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48226: mem_base = xmlMemBlocks();
48227: ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48228: cur = gen_xmlNodePtr(n_cur, 1);
48229:
48230: ret_val = xmlXPathNextChild(ctxt, cur);
48231: desret_xmlNodePtr(ret_val);
48232: call_tests++;
48233: des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48234: des_xmlNodePtr(n_cur, cur, 1);
48235: xmlResetLastError();
48236: if (mem_base != xmlMemBlocks()) {
48237: printf("Leak of %d blocks found in xmlXPathNextChild",
48238: xmlMemBlocks() - mem_base);
48239: test_ret++;
48240: printf(" %d", n_ctxt);
48241: printf(" %d", n_cur);
48242: printf("\n");
48243: }
48244: }
48245: }
48246: function_tests++;
48247: #endif
48248:
48249: return(test_ret);
48250: }
48251:
48252:
48253: static int
48254: test_xmlXPathNextDescendant(void) {
48255: int test_ret = 0;
48256:
48257: #if defined(LIBXML_XPATH_ENABLED)
48258: int mem_base;
48259: xmlNodePtr ret_val;
48260: xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48261: int n_ctxt;
48262: xmlNodePtr cur; /* the current node in the traversal */
48263: int n_cur;
48264:
48265: for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48266: for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48267: mem_base = xmlMemBlocks();
48268: ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48269: cur = gen_xmlNodePtr(n_cur, 1);
48270:
48271: ret_val = xmlXPathNextDescendant(ctxt, cur);
48272: desret_xmlNodePtr(ret_val);
48273: call_tests++;
48274: des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48275: des_xmlNodePtr(n_cur, cur, 1);
48276: xmlResetLastError();
48277: if (mem_base != xmlMemBlocks()) {
48278: printf("Leak of %d blocks found in xmlXPathNextDescendant",
48279: xmlMemBlocks() - mem_base);
48280: test_ret++;
48281: printf(" %d", n_ctxt);
48282: printf(" %d", n_cur);
48283: printf("\n");
48284: }
48285: }
48286: }
48287: function_tests++;
48288: #endif
48289:
48290: return(test_ret);
48291: }
48292:
48293:
48294: static int
48295: test_xmlXPathNextDescendantOrSelf(void) {
48296: int test_ret = 0;
48297:
48298: #if defined(LIBXML_XPATH_ENABLED)
48299: int mem_base;
48300: xmlNodePtr ret_val;
48301: xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48302: int n_ctxt;
48303: xmlNodePtr cur; /* the current node in the traversal */
48304: int n_cur;
48305:
48306: for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48307: for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48308: mem_base = xmlMemBlocks();
48309: ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48310: cur = gen_xmlNodePtr(n_cur, 1);
48311:
48312: ret_val = xmlXPathNextDescendantOrSelf(ctxt, cur);
48313: desret_xmlNodePtr(ret_val);
48314: call_tests++;
48315: des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48316: des_xmlNodePtr(n_cur, cur, 1);
48317: xmlResetLastError();
48318: if (mem_base != xmlMemBlocks()) {
48319: printf("Leak of %d blocks found in xmlXPathNextDescendantOrSelf",
48320: xmlMemBlocks() - mem_base);
48321: test_ret++;
48322: printf(" %d", n_ctxt);
48323: printf(" %d", n_cur);
48324: printf("\n");
48325: }
48326: }
48327: }
48328: function_tests++;
48329: #endif
48330:
48331: return(test_ret);
48332: }
48333:
48334:
48335: static int
48336: test_xmlXPathNextFollowing(void) {
48337: int test_ret = 0;
48338:
48339: #if defined(LIBXML_XPATH_ENABLED)
48340: int mem_base;
48341: xmlNodePtr ret_val;
48342: xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48343: int n_ctxt;
48344: xmlNodePtr cur; /* the current node in the traversal */
48345: int n_cur;
48346:
48347: for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48348: for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48349: mem_base = xmlMemBlocks();
48350: ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48351: cur = gen_xmlNodePtr(n_cur, 1);
48352:
48353: ret_val = xmlXPathNextFollowing(ctxt, cur);
48354: desret_xmlNodePtr(ret_val);
48355: call_tests++;
48356: des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48357: des_xmlNodePtr(n_cur, cur, 1);
48358: xmlResetLastError();
48359: if (mem_base != xmlMemBlocks()) {
48360: printf("Leak of %d blocks found in xmlXPathNextFollowing",
48361: xmlMemBlocks() - mem_base);
48362: test_ret++;
48363: printf(" %d", n_ctxt);
48364: printf(" %d", n_cur);
48365: printf("\n");
48366: }
48367: }
48368: }
48369: function_tests++;
48370: #endif
48371:
48372: return(test_ret);
48373: }
48374:
48375:
48376: static int
48377: test_xmlXPathNextFollowingSibling(void) {
48378: int test_ret = 0;
48379:
48380: #if defined(LIBXML_XPATH_ENABLED)
48381: int mem_base;
48382: xmlNodePtr ret_val;
48383: xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48384: int n_ctxt;
48385: xmlNodePtr cur; /* the current node in the traversal */
48386: int n_cur;
48387:
48388: for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48389: for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48390: mem_base = xmlMemBlocks();
48391: ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48392: cur = gen_xmlNodePtr(n_cur, 1);
48393:
48394: ret_val = xmlXPathNextFollowingSibling(ctxt, cur);
48395: desret_xmlNodePtr(ret_val);
48396: call_tests++;
48397: des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48398: des_xmlNodePtr(n_cur, cur, 1);
48399: xmlResetLastError();
48400: if (mem_base != xmlMemBlocks()) {
48401: printf("Leak of %d blocks found in xmlXPathNextFollowingSibling",
48402: xmlMemBlocks() - mem_base);
48403: test_ret++;
48404: printf(" %d", n_ctxt);
48405: printf(" %d", n_cur);
48406: printf("\n");
48407: }
48408: }
48409: }
48410: function_tests++;
48411: #endif
48412:
48413: return(test_ret);
48414: }
48415:
48416:
48417: static int
48418: test_xmlXPathNextNamespace(void) {
48419: int test_ret = 0;
48420:
48421: #if defined(LIBXML_XPATH_ENABLED)
48422: int mem_base;
48423: xmlNodePtr ret_val;
48424: xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48425: int n_ctxt;
48426: xmlNodePtr cur; /* the current attribute in the traversal */
48427: int n_cur;
48428:
48429: for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48430: for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48431: mem_base = xmlMemBlocks();
48432: ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48433: cur = gen_xmlNodePtr(n_cur, 1);
48434:
48435: ret_val = xmlXPathNextNamespace(ctxt, cur);
48436: desret_xmlNodePtr(ret_val);
48437: call_tests++;
48438: des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48439: des_xmlNodePtr(n_cur, cur, 1);
48440: xmlResetLastError();
48441: if (mem_base != xmlMemBlocks()) {
48442: printf("Leak of %d blocks found in xmlXPathNextNamespace",
48443: xmlMemBlocks() - mem_base);
48444: test_ret++;
48445: printf(" %d", n_ctxt);
48446: printf(" %d", n_cur);
48447: printf("\n");
48448: }
48449: }
48450: }
48451: function_tests++;
48452: #endif
48453:
48454: return(test_ret);
48455: }
48456:
48457:
48458: static int
48459: test_xmlXPathNextParent(void) {
48460: int test_ret = 0;
48461:
48462: #if defined(LIBXML_XPATH_ENABLED)
48463: int mem_base;
48464: xmlNodePtr ret_val;
48465: xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48466: int n_ctxt;
48467: xmlNodePtr cur; /* the current node in the traversal */
48468: int n_cur;
48469:
48470: for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48471: for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48472: mem_base = xmlMemBlocks();
48473: ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48474: cur = gen_xmlNodePtr(n_cur, 1);
48475:
48476: ret_val = xmlXPathNextParent(ctxt, cur);
48477: desret_xmlNodePtr(ret_val);
48478: call_tests++;
48479: des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48480: des_xmlNodePtr(n_cur, cur, 1);
48481: xmlResetLastError();
48482: if (mem_base != xmlMemBlocks()) {
48483: printf("Leak of %d blocks found in xmlXPathNextParent",
48484: xmlMemBlocks() - mem_base);
48485: test_ret++;
48486: printf(" %d", n_ctxt);
48487: printf(" %d", n_cur);
48488: printf("\n");
48489: }
48490: }
48491: }
48492: function_tests++;
48493: #endif
48494:
48495: return(test_ret);
48496: }
48497:
48498:
48499: static int
48500: test_xmlXPathNextPreceding(void) {
48501: int test_ret = 0;
48502:
48503: #if defined(LIBXML_XPATH_ENABLED)
48504: int mem_base;
48505: xmlNodePtr ret_val;
48506: xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48507: int n_ctxt;
48508: xmlNodePtr cur; /* the current node in the traversal */
48509: int n_cur;
48510:
48511: for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48512: for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48513: mem_base = xmlMemBlocks();
48514: ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48515: cur = gen_xmlNodePtr(n_cur, 1);
48516:
48517: ret_val = xmlXPathNextPreceding(ctxt, cur);
48518: desret_xmlNodePtr(ret_val);
48519: call_tests++;
48520: des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48521: des_xmlNodePtr(n_cur, cur, 1);
48522: xmlResetLastError();
48523: if (mem_base != xmlMemBlocks()) {
48524: printf("Leak of %d blocks found in xmlXPathNextPreceding",
48525: xmlMemBlocks() - mem_base);
48526: test_ret++;
48527: printf(" %d", n_ctxt);
48528: printf(" %d", n_cur);
48529: printf("\n");
48530: }
48531: }
48532: }
48533: function_tests++;
48534: #endif
48535:
48536: return(test_ret);
48537: }
48538:
48539:
48540: static int
48541: test_xmlXPathNextPrecedingSibling(void) {
48542: int test_ret = 0;
48543:
48544: #if defined(LIBXML_XPATH_ENABLED)
48545: int mem_base;
48546: xmlNodePtr ret_val;
48547: xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48548: int n_ctxt;
48549: xmlNodePtr cur; /* the current node in the traversal */
48550: int n_cur;
48551:
48552: for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48553: for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48554: mem_base = xmlMemBlocks();
48555: ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48556: cur = gen_xmlNodePtr(n_cur, 1);
48557:
48558: ret_val = xmlXPathNextPrecedingSibling(ctxt, cur);
48559: desret_xmlNodePtr(ret_val);
48560: call_tests++;
48561: des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48562: des_xmlNodePtr(n_cur, cur, 1);
48563: xmlResetLastError();
48564: if (mem_base != xmlMemBlocks()) {
48565: printf("Leak of %d blocks found in xmlXPathNextPrecedingSibling",
48566: xmlMemBlocks() - mem_base);
48567: test_ret++;
48568: printf(" %d", n_ctxt);
48569: printf(" %d", n_cur);
48570: printf("\n");
48571: }
48572: }
48573: }
48574: function_tests++;
48575: #endif
48576:
48577: return(test_ret);
48578: }
48579:
48580:
48581: static int
48582: test_xmlXPathNextSelf(void) {
48583: int test_ret = 0;
48584:
48585: #if defined(LIBXML_XPATH_ENABLED)
48586: int mem_base;
48587: xmlNodePtr ret_val;
48588: xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48589: int n_ctxt;
48590: xmlNodePtr cur; /* the current node in the traversal */
48591: int n_cur;
48592:
48593: for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48594: for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48595: mem_base = xmlMemBlocks();
48596: ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48597: cur = gen_xmlNodePtr(n_cur, 1);
48598:
48599: ret_val = xmlXPathNextSelf(ctxt, cur);
48600: desret_xmlNodePtr(ret_val);
48601: call_tests++;
48602: des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48603: des_xmlNodePtr(n_cur, cur, 1);
48604: xmlResetLastError();
48605: if (mem_base != xmlMemBlocks()) {
48606: printf("Leak of %d blocks found in xmlXPathNextSelf",
48607: xmlMemBlocks() - mem_base);
48608: test_ret++;
48609: printf(" %d", n_ctxt);
48610: printf(" %d", n_cur);
48611: printf("\n");
48612: }
48613: }
48614: }
48615: function_tests++;
48616: #endif
48617:
48618: return(test_ret);
48619: }
48620:
48621:
48622: static int
48623: test_xmlXPathNodeLeading(void) {
48624: int test_ret = 0;
48625:
48626: #if defined(LIBXML_XPATH_ENABLED)
48627: int mem_base;
48628: xmlNodeSetPtr ret_val;
48629: xmlNodeSetPtr nodes; /* a node-set */
48630: int n_nodes;
48631: xmlNodePtr node; /* a node */
48632: int n_node;
48633:
48634: for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
48635: for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
48636: mem_base = xmlMemBlocks();
48637: nodes = gen_xmlNodeSetPtr(n_nodes, 0);
48638: node = gen_xmlNodePtr(n_node, 1);
48639:
48640: ret_val = xmlXPathNodeLeading(nodes, node);
48641: desret_xmlNodeSetPtr(ret_val);
48642: call_tests++;
48643: des_xmlNodeSetPtr(n_nodes, nodes, 0);
48644: des_xmlNodePtr(n_node, node, 1);
48645: xmlResetLastError();
48646: if (mem_base != xmlMemBlocks()) {
48647: printf("Leak of %d blocks found in xmlXPathNodeLeading",
48648: xmlMemBlocks() - mem_base);
48649: test_ret++;
48650: printf(" %d", n_nodes);
48651: printf(" %d", n_node);
48652: printf("\n");
48653: }
48654: }
48655: }
48656: function_tests++;
48657: #endif
48658:
48659: return(test_ret);
48660: }
48661:
48662:
48663: static int
48664: test_xmlXPathNodeLeadingSorted(void) {
48665: int test_ret = 0;
48666:
48667: #if defined(LIBXML_XPATH_ENABLED)
48668: int mem_base;
48669: xmlNodeSetPtr ret_val;
48670: xmlNodeSetPtr nodes; /* a node-set, sorted by document order */
48671: int n_nodes;
48672: xmlNodePtr node; /* a node */
48673: int n_node;
48674:
48675: for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
48676: for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
48677: mem_base = xmlMemBlocks();
48678: nodes = gen_xmlNodeSetPtr(n_nodes, 0);
48679: node = gen_xmlNodePtr(n_node, 1);
48680:
48681: ret_val = xmlXPathNodeLeadingSorted(nodes, node);
48682: desret_xmlNodeSetPtr(ret_val);
48683: call_tests++;
48684: des_xmlNodeSetPtr(n_nodes, nodes, 0);
48685: des_xmlNodePtr(n_node, node, 1);
48686: xmlResetLastError();
48687: if (mem_base != xmlMemBlocks()) {
48688: printf("Leak of %d blocks found in xmlXPathNodeLeadingSorted",
48689: xmlMemBlocks() - mem_base);
48690: test_ret++;
48691: printf(" %d", n_nodes);
48692: printf(" %d", n_node);
48693: printf("\n");
48694: }
48695: }
48696: }
48697: function_tests++;
48698: #endif
48699:
48700: return(test_ret);
48701: }
48702:
48703:
48704: static int
48705: test_xmlXPathNodeSetAdd(void) {
48706: int test_ret = 0;
48707:
48708: #if defined(LIBXML_XPATH_ENABLED)
48709: int mem_base;
48710: xmlNodeSetPtr cur; /* the initial node set */
48711: int n_cur;
48712: xmlNodePtr val; /* a new xmlNodePtr */
48713: int n_val;
48714:
48715: for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
48716: for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
48717: mem_base = xmlMemBlocks();
48718: cur = gen_xmlNodeSetPtr(n_cur, 0);
48719: val = gen_xmlNodePtr(n_val, 1);
48720:
48721: xmlXPathNodeSetAdd(cur, val);
48722: call_tests++;
48723: des_xmlNodeSetPtr(n_cur, cur, 0);
48724: des_xmlNodePtr(n_val, val, 1);
48725: xmlResetLastError();
48726: if (mem_base != xmlMemBlocks()) {
48727: printf("Leak of %d blocks found in xmlXPathNodeSetAdd",
48728: xmlMemBlocks() - mem_base);
48729: test_ret++;
48730: printf(" %d", n_cur);
48731: printf(" %d", n_val);
48732: printf("\n");
48733: }
48734: }
48735: }
48736: function_tests++;
48737: #endif
48738:
48739: return(test_ret);
48740: }
48741:
48742:
48743: static int
48744: test_xmlXPathNodeSetAddNs(void) {
48745: int test_ret = 0;
48746:
48747: #if defined(LIBXML_XPATH_ENABLED)
48748: int mem_base;
48749: xmlNodeSetPtr cur; /* the initial node set */
48750: int n_cur;
48751: xmlNodePtr node; /* the hosting node */
48752: int n_node;
48753: xmlNsPtr ns; /* a the namespace node */
48754: int n_ns;
48755:
48756: for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
48757: for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
48758: for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
48759: mem_base = xmlMemBlocks();
48760: cur = gen_xmlNodeSetPtr(n_cur, 0);
48761: node = gen_xmlNodePtr(n_node, 1);
48762: ns = gen_xmlNsPtr(n_ns, 2);
48763:
48764: xmlXPathNodeSetAddNs(cur, node, ns);
48765: call_tests++;
48766: des_xmlNodeSetPtr(n_cur, cur, 0);
48767: des_xmlNodePtr(n_node, node, 1);
48768: des_xmlNsPtr(n_ns, ns, 2);
48769: xmlResetLastError();
48770: if (mem_base != xmlMemBlocks()) {
48771: printf("Leak of %d blocks found in xmlXPathNodeSetAddNs",
48772: xmlMemBlocks() - mem_base);
48773: test_ret++;
48774: printf(" %d", n_cur);
48775: printf(" %d", n_node);
48776: printf(" %d", n_ns);
48777: printf("\n");
48778: }
48779: }
48780: }
48781: }
48782: function_tests++;
48783: #endif
48784:
48785: return(test_ret);
48786: }
48787:
48788:
48789: static int
48790: test_xmlXPathNodeSetAddUnique(void) {
48791: int test_ret = 0;
48792:
48793: #if defined(LIBXML_XPATH_ENABLED)
48794: int mem_base;
48795: xmlNodeSetPtr cur; /* the initial node set */
48796: int n_cur;
48797: xmlNodePtr val; /* a new xmlNodePtr */
48798: int n_val;
48799:
48800: for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
48801: for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
48802: mem_base = xmlMemBlocks();
48803: cur = gen_xmlNodeSetPtr(n_cur, 0);
48804: val = gen_xmlNodePtr(n_val, 1);
48805:
48806: xmlXPathNodeSetAddUnique(cur, val);
48807: call_tests++;
48808: des_xmlNodeSetPtr(n_cur, cur, 0);
48809: des_xmlNodePtr(n_val, val, 1);
48810: xmlResetLastError();
48811: if (mem_base != xmlMemBlocks()) {
48812: printf("Leak of %d blocks found in xmlXPathNodeSetAddUnique",
48813: xmlMemBlocks() - mem_base);
48814: test_ret++;
48815: printf(" %d", n_cur);
48816: printf(" %d", n_val);
48817: printf("\n");
48818: }
48819: }
48820: }
48821: function_tests++;
48822: #endif
48823:
48824: return(test_ret);
48825: }
48826:
48827:
48828: static int
48829: test_xmlXPathNodeSetContains(void) {
48830: int test_ret = 0;
48831:
48832: #if defined(LIBXML_XPATH_ENABLED)
48833: int mem_base;
48834: int ret_val;
48835: xmlNodeSetPtr cur; /* the node-set */
48836: int n_cur;
48837: xmlNodePtr val; /* the node */
48838: int n_val;
48839:
48840: for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
48841: for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
48842: mem_base = xmlMemBlocks();
48843: cur = gen_xmlNodeSetPtr(n_cur, 0);
48844: val = gen_xmlNodePtr(n_val, 1);
48845:
48846: ret_val = xmlXPathNodeSetContains(cur, val);
48847: desret_int(ret_val);
48848: call_tests++;
48849: des_xmlNodeSetPtr(n_cur, cur, 0);
48850: des_xmlNodePtr(n_val, val, 1);
48851: xmlResetLastError();
48852: if (mem_base != xmlMemBlocks()) {
48853: printf("Leak of %d blocks found in xmlXPathNodeSetContains",
48854: xmlMemBlocks() - mem_base);
48855: test_ret++;
48856: printf(" %d", n_cur);
48857: printf(" %d", n_val);
48858: printf("\n");
48859: }
48860: }
48861: }
48862: function_tests++;
48863: #endif
48864:
48865: return(test_ret);
48866: }
48867:
48868:
48869: static int
48870: test_xmlXPathNodeSetDel(void) {
48871: int test_ret = 0;
48872:
48873: #if defined(LIBXML_XPATH_ENABLED)
48874: int mem_base;
48875: xmlNodeSetPtr cur; /* the initial node set */
48876: int n_cur;
48877: xmlNodePtr val; /* an xmlNodePtr */
48878: int n_val;
48879:
48880: for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
48881: for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
48882: mem_base = xmlMemBlocks();
48883: cur = gen_xmlNodeSetPtr(n_cur, 0);
48884: val = gen_xmlNodePtr(n_val, 1);
48885:
48886: xmlXPathNodeSetDel(cur, val);
48887: call_tests++;
48888: des_xmlNodeSetPtr(n_cur, cur, 0);
48889: des_xmlNodePtr(n_val, val, 1);
48890: xmlResetLastError();
48891: if (mem_base != xmlMemBlocks()) {
48892: printf("Leak of %d blocks found in xmlXPathNodeSetDel",
48893: xmlMemBlocks() - mem_base);
48894: test_ret++;
48895: printf(" %d", n_cur);
48896: printf(" %d", n_val);
48897: printf("\n");
48898: }
48899: }
48900: }
48901: function_tests++;
48902: #endif
48903:
48904: return(test_ret);
48905: }
48906:
48907:
48908: static int
48909: test_xmlXPathNodeSetMerge(void) {
48910: int test_ret = 0;
48911:
48912: #if defined(LIBXML_XPATH_ENABLED)
48913: int mem_base;
48914: xmlNodeSetPtr ret_val;
48915: xmlNodeSetPtr val1; /* the first NodeSet or NULL */
48916: int n_val1;
48917: xmlNodeSetPtr val2; /* the second NodeSet */
48918: int n_val2;
48919:
48920: for (n_val1 = 0;n_val1 < gen_nb_xmlNodeSetPtr;n_val1++) {
48921: for (n_val2 = 0;n_val2 < gen_nb_xmlNodeSetPtr;n_val2++) {
48922: mem_base = xmlMemBlocks();
48923: val1 = gen_xmlNodeSetPtr(n_val1, 0);
48924: val2 = gen_xmlNodeSetPtr(n_val2, 1);
48925:
48926: ret_val = xmlXPathNodeSetMerge(val1, val2);
48927: desret_xmlNodeSetPtr(ret_val);
48928: call_tests++;
48929: des_xmlNodeSetPtr(n_val1, val1, 0);
48930: des_xmlNodeSetPtr(n_val2, val2, 1);
48931: xmlResetLastError();
48932: if (mem_base != xmlMemBlocks()) {
48933: printf("Leak of %d blocks found in xmlXPathNodeSetMerge",
48934: xmlMemBlocks() - mem_base);
48935: test_ret++;
48936: printf(" %d", n_val1);
48937: printf(" %d", n_val2);
48938: printf("\n");
48939: }
48940: }
48941: }
48942: function_tests++;
48943: #endif
48944:
48945: return(test_ret);
48946: }
48947:
48948:
48949: static int
48950: test_xmlXPathNodeSetRemove(void) {
48951: int test_ret = 0;
48952:
48953: #if defined(LIBXML_XPATH_ENABLED)
48954: int mem_base;
48955: xmlNodeSetPtr cur; /* the initial node set */
48956: int n_cur;
48957: int val; /* the index to remove */
48958: int n_val;
48959:
48960: for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
48961: for (n_val = 0;n_val < gen_nb_int;n_val++) {
48962: mem_base = xmlMemBlocks();
48963: cur = gen_xmlNodeSetPtr(n_cur, 0);
48964: val = gen_int(n_val, 1);
48965:
48966: xmlXPathNodeSetRemove(cur, val);
48967: call_tests++;
48968: des_xmlNodeSetPtr(n_cur, cur, 0);
48969: des_int(n_val, val, 1);
48970: xmlResetLastError();
48971: if (mem_base != xmlMemBlocks()) {
48972: printf("Leak of %d blocks found in xmlXPathNodeSetRemove",
48973: xmlMemBlocks() - mem_base);
48974: test_ret++;
48975: printf(" %d", n_cur);
48976: printf(" %d", n_val);
48977: printf("\n");
48978: }
48979: }
48980: }
48981: function_tests++;
48982: #endif
48983:
48984: return(test_ret);
48985: }
48986:
48987:
48988: static int
48989: test_xmlXPathNodeSetSort(void) {
48990: int test_ret = 0;
48991:
48992: #if defined(LIBXML_XPATH_ENABLED)
48993: int mem_base;
48994: xmlNodeSetPtr set; /* the node set */
48995: int n_set;
48996:
48997: for (n_set = 0;n_set < gen_nb_xmlNodeSetPtr;n_set++) {
48998: mem_base = xmlMemBlocks();
48999: set = gen_xmlNodeSetPtr(n_set, 0);
49000:
49001: xmlXPathNodeSetSort(set);
49002: call_tests++;
49003: des_xmlNodeSetPtr(n_set, set, 0);
49004: xmlResetLastError();
49005: if (mem_base != xmlMemBlocks()) {
49006: printf("Leak of %d blocks found in xmlXPathNodeSetSort",
49007: xmlMemBlocks() - mem_base);
49008: test_ret++;
49009: printf(" %d", n_set);
49010: printf("\n");
49011: }
49012: }
49013: function_tests++;
49014: #endif
49015:
49016: return(test_ret);
49017: }
49018:
49019:
49020: static int
49021: test_xmlXPathNodeTrailing(void) {
49022: int test_ret = 0;
49023:
49024: #if defined(LIBXML_XPATH_ENABLED)
49025: int mem_base;
49026: xmlNodeSetPtr ret_val;
49027: xmlNodeSetPtr nodes; /* a node-set */
49028: int n_nodes;
49029: xmlNodePtr node; /* a node */
49030: int n_node;
49031:
49032: for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
49033: for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
49034: mem_base = xmlMemBlocks();
49035: nodes = gen_xmlNodeSetPtr(n_nodes, 0);
49036: node = gen_xmlNodePtr(n_node, 1);
49037:
49038: ret_val = xmlXPathNodeTrailing(nodes, node);
49039: desret_xmlNodeSetPtr(ret_val);
49040: call_tests++;
49041: des_xmlNodeSetPtr(n_nodes, nodes, 0);
49042: des_xmlNodePtr(n_node, node, 1);
49043: xmlResetLastError();
49044: if (mem_base != xmlMemBlocks()) {
49045: printf("Leak of %d blocks found in xmlXPathNodeTrailing",
49046: xmlMemBlocks() - mem_base);
49047: test_ret++;
49048: printf(" %d", n_nodes);
49049: printf(" %d", n_node);
49050: printf("\n");
49051: }
49052: }
49053: }
49054: function_tests++;
49055: #endif
49056:
49057: return(test_ret);
49058: }
49059:
49060:
49061: static int
49062: test_xmlXPathNodeTrailingSorted(void) {
49063: int test_ret = 0;
49064:
49065: #if defined(LIBXML_XPATH_ENABLED)
49066: int mem_base;
49067: xmlNodeSetPtr ret_val;
49068: xmlNodeSetPtr nodes; /* a node-set, sorted by document order */
49069: int n_nodes;
49070: xmlNodePtr node; /* a node */
49071: int n_node;
49072:
49073: for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
49074: for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
49075: mem_base = xmlMemBlocks();
49076: nodes = gen_xmlNodeSetPtr(n_nodes, 0);
49077: node = gen_xmlNodePtr(n_node, 1);
49078:
49079: ret_val = xmlXPathNodeTrailingSorted(nodes, node);
49080: desret_xmlNodeSetPtr(ret_val);
49081: call_tests++;
49082: des_xmlNodeSetPtr(n_nodes, nodes, 0);
49083: des_xmlNodePtr(n_node, node, 1);
49084: xmlResetLastError();
49085: if (mem_base != xmlMemBlocks()) {
49086: printf("Leak of %d blocks found in xmlXPathNodeTrailingSorted",
49087: xmlMemBlocks() - mem_base);
49088: test_ret++;
49089: printf(" %d", n_nodes);
49090: printf(" %d", n_node);
49091: printf("\n");
49092: }
49093: }
49094: }
49095: function_tests++;
49096: #endif
49097:
49098: return(test_ret);
49099: }
49100:
49101:
49102: static int
49103: test_xmlXPathNormalizeFunction(void) {
49104: int test_ret = 0;
49105:
49106: #if defined(LIBXML_XPATH_ENABLED)
49107: int mem_base;
49108: xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49109: int n_ctxt;
49110: int nargs; /* the number of arguments */
49111: int n_nargs;
49112:
49113: for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49114: for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49115: mem_base = xmlMemBlocks();
49116: ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49117: nargs = gen_int(n_nargs, 1);
49118:
49119: xmlXPathNormalizeFunction(ctxt, nargs);
49120: call_tests++;
49121: des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49122: des_int(n_nargs, nargs, 1);
49123: xmlResetLastError();
49124: if (mem_base != xmlMemBlocks()) {
49125: printf("Leak of %d blocks found in xmlXPathNormalizeFunction",
49126: xmlMemBlocks() - mem_base);
49127: test_ret++;
49128: printf(" %d", n_ctxt);
49129: printf(" %d", n_nargs);
49130: printf("\n");
49131: }
49132: }
49133: }
49134: function_tests++;
49135: #endif
49136:
49137: return(test_ret);
49138: }
49139:
49140:
49141: static int
49142: test_xmlXPathNotEqualValues(void) {
49143: int test_ret = 0;
49144:
49145: #if defined(LIBXML_XPATH_ENABLED)
49146: int mem_base;
49147: int ret_val;
49148: xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49149: int n_ctxt;
49150:
49151: for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49152: mem_base = xmlMemBlocks();
49153: ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49154:
49155: ret_val = xmlXPathNotEqualValues(ctxt);
49156: desret_int(ret_val);
49157: call_tests++;
49158: des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49159: xmlResetLastError();
49160: if (mem_base != xmlMemBlocks()) {
49161: printf("Leak of %d blocks found in xmlXPathNotEqualValues",
49162: xmlMemBlocks() - mem_base);
49163: test_ret++;
49164: printf(" %d", n_ctxt);
49165: printf("\n");
49166: }
49167: }
49168: function_tests++;
49169: #endif
49170:
49171: return(test_ret);
49172: }
49173:
49174:
49175: static int
49176: test_xmlXPathNotFunction(void) {
49177: int test_ret = 0;
49178:
49179: #if defined(LIBXML_XPATH_ENABLED)
49180: int mem_base;
49181: xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49182: int n_ctxt;
49183: int nargs; /* the number of arguments */
49184: int n_nargs;
49185:
49186: for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49187: for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49188: mem_base = xmlMemBlocks();
49189: ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49190: nargs = gen_int(n_nargs, 1);
49191:
49192: xmlXPathNotFunction(ctxt, nargs);
49193: call_tests++;
49194: des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49195: des_int(n_nargs, nargs, 1);
49196: xmlResetLastError();
49197: if (mem_base != xmlMemBlocks()) {
49198: printf("Leak of %d blocks found in xmlXPathNotFunction",
49199: xmlMemBlocks() - mem_base);
49200: test_ret++;
49201: printf(" %d", n_ctxt);
49202: printf(" %d", n_nargs);
49203: printf("\n");
49204: }
49205: }
49206: }
49207: function_tests++;
49208: #endif
49209:
49210: return(test_ret);
49211: }
49212:
49213:
49214: static int
49215: test_xmlXPathNsLookup(void) {
49216: int test_ret = 0;
49217:
49218: #if defined(LIBXML_XPATH_ENABLED)
49219: int mem_base;
49220: const xmlChar * ret_val;
49221: xmlXPathContextPtr ctxt; /* the XPath context */
49222: int n_ctxt;
49223: xmlChar * prefix; /* the namespace prefix value */
49224: int n_prefix;
49225:
49226: for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
49227: for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
49228: mem_base = xmlMemBlocks();
49229: ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
49230: prefix = gen_const_xmlChar_ptr(n_prefix, 1);
49231:
49232: ret_val = xmlXPathNsLookup(ctxt, (const xmlChar *)prefix);
49233: desret_const_xmlChar_ptr(ret_val);
49234: call_tests++;
49235: des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
49236: des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
49237: xmlResetLastError();
49238: if (mem_base != xmlMemBlocks()) {
49239: printf("Leak of %d blocks found in xmlXPathNsLookup",
49240: xmlMemBlocks() - mem_base);
49241: test_ret++;
49242: printf(" %d", n_ctxt);
49243: printf(" %d", n_prefix);
49244: printf("\n");
49245: }
49246: }
49247: }
49248: function_tests++;
49249: #endif
49250:
49251: return(test_ret);
49252: }
49253:
49254:
49255: static int
49256: test_xmlXPathNumberFunction(void) {
49257: int test_ret = 0;
49258:
49259: #if defined(LIBXML_XPATH_ENABLED)
49260: int mem_base;
49261: xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49262: int n_ctxt;
49263: int nargs; /* the number of arguments */
49264: int n_nargs;
49265:
49266: for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49267: for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49268: mem_base = xmlMemBlocks();
49269: ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49270: nargs = gen_int(n_nargs, 1);
49271:
49272: xmlXPathNumberFunction(ctxt, nargs);
49273: call_tests++;
49274: des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49275: des_int(n_nargs, nargs, 1);
49276: xmlResetLastError();
49277: if (mem_base != xmlMemBlocks()) {
49278: printf("Leak of %d blocks found in xmlXPathNumberFunction",
49279: xmlMemBlocks() - mem_base);
49280: test_ret++;
49281: printf(" %d", n_ctxt);
49282: printf(" %d", n_nargs);
49283: printf("\n");
49284: }
49285: }
49286: }
49287: function_tests++;
49288: #endif
49289:
49290: return(test_ret);
49291: }
49292:
49293:
49294: static int
49295: test_xmlXPathParseNCName(void) {
49296: int test_ret = 0;
49297:
49298: #if defined(LIBXML_XPATH_ENABLED)
49299: int mem_base;
49300: xmlChar * ret_val;
49301: xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49302: int n_ctxt;
49303:
49304: for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49305: mem_base = xmlMemBlocks();
49306: ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49307:
49308: ret_val = xmlXPathParseNCName(ctxt);
49309: desret_xmlChar_ptr(ret_val);
49310: call_tests++;
49311: des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49312: xmlResetLastError();
49313: if (mem_base != xmlMemBlocks()) {
49314: printf("Leak of %d blocks found in xmlXPathParseNCName",
49315: xmlMemBlocks() - mem_base);
49316: test_ret++;
49317: printf(" %d", n_ctxt);
49318: printf("\n");
49319: }
49320: }
49321: function_tests++;
49322: #endif
49323:
49324: return(test_ret);
49325: }
49326:
49327:
49328: static int
49329: test_xmlXPathParseName(void) {
49330: int test_ret = 0;
49331:
49332: #if defined(LIBXML_XPATH_ENABLED)
49333: int mem_base;
49334: xmlChar * ret_val;
49335: xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49336: int n_ctxt;
49337:
49338: for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49339: mem_base = xmlMemBlocks();
49340: ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49341:
49342: ret_val = xmlXPathParseName(ctxt);
49343: desret_xmlChar_ptr(ret_val);
49344: call_tests++;
49345: des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49346: xmlResetLastError();
49347: if (mem_base != xmlMemBlocks()) {
49348: printf("Leak of %d blocks found in xmlXPathParseName",
49349: xmlMemBlocks() - mem_base);
49350: test_ret++;
49351: printf(" %d", n_ctxt);
49352: printf("\n");
49353: }
49354: }
49355: function_tests++;
49356: #endif
49357:
49358: return(test_ret);
49359: }
49360:
49361:
49362: static int
49363: test_xmlXPathPopBoolean(void) {
49364: int test_ret = 0;
49365:
49366: #if defined(LIBXML_XPATH_ENABLED)
49367: int mem_base;
49368: int ret_val;
49369: xmlXPathParserContextPtr ctxt; /* an XPath parser context */
49370: int n_ctxt;
49371:
49372: for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49373: mem_base = xmlMemBlocks();
49374: ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49375:
49376: ret_val = xmlXPathPopBoolean(ctxt);
49377: desret_int(ret_val);
49378: call_tests++;
49379: des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49380: xmlResetLastError();
49381: if (mem_base != xmlMemBlocks()) {
49382: printf("Leak of %d blocks found in xmlXPathPopBoolean",
49383: xmlMemBlocks() - mem_base);
49384: test_ret++;
49385: printf(" %d", n_ctxt);
49386: printf("\n");
49387: }
49388: }
49389: function_tests++;
49390: #endif
49391:
49392: return(test_ret);
49393: }
49394:
49395:
49396: static int
49397: test_xmlXPathPopExternal(void) {
49398: int test_ret = 0;
49399:
49400: #if defined(LIBXML_XPATH_ENABLED)
49401: int mem_base;
49402: void * ret_val;
49403: xmlXPathParserContextPtr ctxt; /* an XPath parser context */
49404: int n_ctxt;
49405:
49406: for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49407: mem_base = xmlMemBlocks();
49408: ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49409:
49410: ret_val = xmlXPathPopExternal(ctxt);
49411: desret_void_ptr(ret_val);
49412: call_tests++;
49413: des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49414: xmlResetLastError();
49415: if (mem_base != xmlMemBlocks()) {
49416: printf("Leak of %d blocks found in xmlXPathPopExternal",
49417: xmlMemBlocks() - mem_base);
49418: test_ret++;
49419: printf(" %d", n_ctxt);
49420: printf("\n");
49421: }
49422: }
49423: function_tests++;
49424: #endif
49425:
49426: return(test_ret);
49427: }
49428:
49429:
49430: static int
49431: test_xmlXPathPopNodeSet(void) {
49432: int test_ret = 0;
49433:
49434: #if defined(LIBXML_XPATH_ENABLED)
49435: int mem_base;
49436: xmlNodeSetPtr ret_val;
49437: xmlXPathParserContextPtr ctxt; /* an XPath parser context */
49438: int n_ctxt;
49439:
49440: for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49441: mem_base = xmlMemBlocks();
49442: ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49443:
49444: ret_val = xmlXPathPopNodeSet(ctxt);
49445: desret_xmlNodeSetPtr(ret_val);
49446: call_tests++;
49447: des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49448: xmlResetLastError();
49449: if (mem_base != xmlMemBlocks()) {
49450: printf("Leak of %d blocks found in xmlXPathPopNodeSet",
49451: xmlMemBlocks() - mem_base);
49452: test_ret++;
49453: printf(" %d", n_ctxt);
49454: printf("\n");
49455: }
49456: }
49457: function_tests++;
49458: #endif
49459:
49460: return(test_ret);
49461: }
49462:
49463:
49464: static int
49465: test_xmlXPathPopNumber(void) {
49466: int test_ret = 0;
49467:
49468: #if defined(LIBXML_XPATH_ENABLED)
49469: int mem_base;
49470: double ret_val;
49471: xmlXPathParserContextPtr ctxt; /* an XPath parser context */
49472: int n_ctxt;
49473:
49474: for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49475: mem_base = xmlMemBlocks();
49476: ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49477:
49478: ret_val = xmlXPathPopNumber(ctxt);
49479: desret_double(ret_val);
49480: call_tests++;
49481: des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49482: xmlResetLastError();
49483: if (mem_base != xmlMemBlocks()) {
49484: printf("Leak of %d blocks found in xmlXPathPopNumber",
49485: xmlMemBlocks() - mem_base);
49486: test_ret++;
49487: printf(" %d", n_ctxt);
49488: printf("\n");
49489: }
49490: }
49491: function_tests++;
49492: #endif
49493:
49494: return(test_ret);
49495: }
49496:
49497:
49498: static int
49499: test_xmlXPathPopString(void) {
49500: int test_ret = 0;
49501:
49502: #if defined(LIBXML_XPATH_ENABLED)
49503: int mem_base;
49504: xmlChar * ret_val;
49505: xmlXPathParserContextPtr ctxt; /* an XPath parser context */
49506: int n_ctxt;
49507:
49508: for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49509: mem_base = xmlMemBlocks();
49510: ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49511:
49512: ret_val = xmlXPathPopString(ctxt);
49513: desret_xmlChar_ptr(ret_val);
49514: call_tests++;
49515: des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49516: xmlResetLastError();
49517: if (mem_base != xmlMemBlocks()) {
49518: printf("Leak of %d blocks found in xmlXPathPopString",
49519: xmlMemBlocks() - mem_base);
49520: test_ret++;
49521: printf(" %d", n_ctxt);
49522: printf("\n");
49523: }
49524: }
49525: function_tests++;
49526: #endif
49527:
49528: return(test_ret);
49529: }
49530:
49531:
49532: static int
49533: test_xmlXPathPositionFunction(void) {
49534: int test_ret = 0;
49535:
49536: #if defined(LIBXML_XPATH_ENABLED)
49537: int mem_base;
49538: xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49539: int n_ctxt;
49540: int nargs; /* the number of arguments */
49541: int n_nargs;
49542:
49543: for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49544: for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49545: mem_base = xmlMemBlocks();
49546: ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49547: nargs = gen_int(n_nargs, 1);
49548:
49549: xmlXPathPositionFunction(ctxt, nargs);
49550: call_tests++;
49551: des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49552: des_int(n_nargs, nargs, 1);
49553: xmlResetLastError();
49554: if (mem_base != xmlMemBlocks()) {
49555: printf("Leak of %d blocks found in xmlXPathPositionFunction",
49556: xmlMemBlocks() - mem_base);
49557: test_ret++;
49558: printf(" %d", n_ctxt);
49559: printf(" %d", n_nargs);
49560: printf("\n");
49561: }
49562: }
49563: }
49564: function_tests++;
49565: #endif
49566:
49567: return(test_ret);
49568: }
49569:
49570:
49571: static int
49572: test_xmlXPathRegisterAllFunctions(void) {
49573: int test_ret = 0;
49574:
49575: #if defined(LIBXML_XPATH_ENABLED)
49576: int mem_base;
49577: xmlXPathContextPtr ctxt; /* the XPath context */
49578: int n_ctxt;
49579:
49580: for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
49581: mem_base = xmlMemBlocks();
49582: ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
49583:
49584: xmlXPathRegisterAllFunctions(ctxt);
49585: call_tests++;
49586: des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
49587: xmlResetLastError();
49588: if (mem_base != xmlMemBlocks()) {
49589: printf("Leak of %d blocks found in xmlXPathRegisterAllFunctions",
49590: xmlMemBlocks() - mem_base);
49591: test_ret++;
49592: printf(" %d", n_ctxt);
49593: printf("\n");
49594: }
49595: }
49596: function_tests++;
49597: #endif
49598:
49599: return(test_ret);
49600: }
49601:
49602:
49603: static int
49604: test_xmlXPathRegisterFunc(void) {
49605: int test_ret = 0;
49606:
49607:
49608: /* missing type support */
49609: return(test_ret);
49610: }
49611:
49612:
49613: static int
49614: test_xmlXPathRegisterFuncLookup(void) {
49615: int test_ret = 0;
49616:
49617:
49618: /* missing type support */
49619: return(test_ret);
49620: }
49621:
49622:
49623: static int
49624: test_xmlXPathRegisterFuncNS(void) {
49625: int test_ret = 0;
49626:
49627:
49628: /* missing type support */
49629: return(test_ret);
49630: }
49631:
49632:
49633: static int
49634: test_xmlXPathRegisterNs(void) {
49635: int test_ret = 0;
49636:
49637: #if defined(LIBXML_XPATH_ENABLED)
49638: int mem_base;
49639: int ret_val;
49640: xmlXPathContextPtr ctxt; /* the XPath context */
49641: int n_ctxt;
49642: xmlChar * prefix; /* the namespace prefix cannot be NULL or empty string */
49643: int n_prefix;
49644: xmlChar * ns_uri; /* the namespace name */
49645: int n_ns_uri;
49646:
49647: for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
49648: for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
49649: for (n_ns_uri = 0;n_ns_uri < gen_nb_const_xmlChar_ptr;n_ns_uri++) {
49650: mem_base = xmlMemBlocks();
49651: ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
49652: prefix = gen_const_xmlChar_ptr(n_prefix, 1);
49653: ns_uri = gen_const_xmlChar_ptr(n_ns_uri, 2);
49654:
49655: ret_val = xmlXPathRegisterNs(ctxt, (const xmlChar *)prefix, (const xmlChar *)ns_uri);
49656: desret_int(ret_val);
49657: call_tests++;
49658: des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
49659: des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
49660: des_const_xmlChar_ptr(n_ns_uri, (const xmlChar *)ns_uri, 2);
49661: xmlResetLastError();
49662: if (mem_base != xmlMemBlocks()) {
49663: printf("Leak of %d blocks found in xmlXPathRegisterNs",
49664: xmlMemBlocks() - mem_base);
49665: test_ret++;
49666: printf(" %d", n_ctxt);
49667: printf(" %d", n_prefix);
49668: printf(" %d", n_ns_uri);
49669: printf("\n");
49670: }
49671: }
49672: }
49673: }
49674: function_tests++;
49675: #endif
49676:
49677: return(test_ret);
49678: }
49679:
49680:
49681: static int
49682: test_xmlXPathRegisterVariable(void) {
49683: int test_ret = 0;
49684:
49685: #if defined(LIBXML_XPATH_ENABLED)
49686: int mem_base;
49687: int ret_val;
49688: xmlXPathContextPtr ctxt; /* the XPath context */
49689: int n_ctxt;
49690: xmlChar * name; /* the variable name */
49691: int n_name;
49692: xmlXPathObjectPtr value; /* the variable value or NULL */
49693: int n_value;
49694:
49695: for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
49696: for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
49697: for (n_value = 0;n_value < gen_nb_xmlXPathObjectPtr;n_value++) {
49698: mem_base = xmlMemBlocks();
49699: ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
49700: name = gen_const_xmlChar_ptr(n_name, 1);
49701: value = gen_xmlXPathObjectPtr(n_value, 2);
49702:
49703: ret_val = xmlXPathRegisterVariable(ctxt, (const xmlChar *)name, value);
49704: desret_int(ret_val);
49705: call_tests++;
49706: des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
49707: des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
49708: des_xmlXPathObjectPtr(n_value, value, 2);
49709: xmlResetLastError();
49710: if (mem_base != xmlMemBlocks()) {
49711: printf("Leak of %d blocks found in xmlXPathRegisterVariable",
49712: xmlMemBlocks() - mem_base);
49713: test_ret++;
49714: printf(" %d", n_ctxt);
49715: printf(" %d", n_name);
49716: printf(" %d", n_value);
49717: printf("\n");
49718: }
49719: }
49720: }
49721: }
49722: function_tests++;
49723: #endif
49724:
49725: return(test_ret);
49726: }
49727:
49728:
49729: static int
49730: test_xmlXPathRegisterVariableLookup(void) {
49731: int test_ret = 0;
49732:
49733:
49734: /* missing type support */
49735: return(test_ret);
49736: }
49737:
49738:
49739: static int
49740: test_xmlXPathRegisterVariableNS(void) {
49741: int test_ret = 0;
49742:
49743: #if defined(LIBXML_XPATH_ENABLED)
49744: int mem_base;
49745: int ret_val;
49746: xmlXPathContextPtr ctxt; /* the XPath context */
49747: int n_ctxt;
49748: xmlChar * name; /* the variable name */
49749: int n_name;
49750: xmlChar * ns_uri; /* the variable namespace URI */
49751: int n_ns_uri;
49752: xmlXPathObjectPtr value; /* the variable value or NULL */
49753: int n_value;
49754:
49755: for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
49756: for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
49757: for (n_ns_uri = 0;n_ns_uri < gen_nb_const_xmlChar_ptr;n_ns_uri++) {
49758: for (n_value = 0;n_value < gen_nb_xmlXPathObjectPtr;n_value++) {
49759: mem_base = xmlMemBlocks();
49760: ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
49761: name = gen_const_xmlChar_ptr(n_name, 1);
49762: ns_uri = gen_const_xmlChar_ptr(n_ns_uri, 2);
49763: value = gen_xmlXPathObjectPtr(n_value, 3);
49764:
49765: ret_val = xmlXPathRegisterVariableNS(ctxt, (const xmlChar *)name, (const xmlChar *)ns_uri, value);
49766: desret_int(ret_val);
49767: call_tests++;
49768: des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
49769: des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
49770: des_const_xmlChar_ptr(n_ns_uri, (const xmlChar *)ns_uri, 2);
49771: des_xmlXPathObjectPtr(n_value, value, 3);
49772: xmlResetLastError();
49773: if (mem_base != xmlMemBlocks()) {
49774: printf("Leak of %d blocks found in xmlXPathRegisterVariableNS",
49775: xmlMemBlocks() - mem_base);
49776: test_ret++;
49777: printf(" %d", n_ctxt);
49778: printf(" %d", n_name);
49779: printf(" %d", n_ns_uri);
49780: printf(" %d", n_value);
49781: printf("\n");
49782: }
49783: }
49784: }
49785: }
49786: }
49787: function_tests++;
49788: #endif
49789:
49790: return(test_ret);
49791: }
49792:
49793:
49794: static int
49795: test_xmlXPathRegisteredFuncsCleanup(void) {
49796: int test_ret = 0;
49797:
49798: #if defined(LIBXML_XPATH_ENABLED)
49799: int mem_base;
49800: xmlXPathContextPtr ctxt; /* the XPath context */
49801: int n_ctxt;
49802:
49803: for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
49804: mem_base = xmlMemBlocks();
49805: ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
49806:
49807: xmlXPathRegisteredFuncsCleanup(ctxt);
49808: call_tests++;
49809: des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
49810: xmlResetLastError();
49811: if (mem_base != xmlMemBlocks()) {
49812: printf("Leak of %d blocks found in xmlXPathRegisteredFuncsCleanup",
49813: xmlMemBlocks() - mem_base);
49814: test_ret++;
49815: printf(" %d", n_ctxt);
49816: printf("\n");
49817: }
49818: }
49819: function_tests++;
49820: #endif
49821:
49822: return(test_ret);
49823: }
49824:
49825:
49826: static int
49827: test_xmlXPathRegisteredNsCleanup(void) {
49828: int test_ret = 0;
49829:
49830: #if defined(LIBXML_XPATH_ENABLED)
49831: int mem_base;
49832: xmlXPathContextPtr ctxt; /* the XPath context */
49833: int n_ctxt;
49834:
49835: for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
49836: mem_base = xmlMemBlocks();
49837: ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
49838:
49839: xmlXPathRegisteredNsCleanup(ctxt);
49840: call_tests++;
49841: des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
49842: xmlResetLastError();
49843: if (mem_base != xmlMemBlocks()) {
49844: printf("Leak of %d blocks found in xmlXPathRegisteredNsCleanup",
49845: xmlMemBlocks() - mem_base);
49846: test_ret++;
49847: printf(" %d", n_ctxt);
49848: printf("\n");
49849: }
49850: }
49851: function_tests++;
49852: #endif
49853:
49854: return(test_ret);
49855: }
49856:
49857:
49858: static int
49859: test_xmlXPathRegisteredVariablesCleanup(void) {
49860: int test_ret = 0;
49861:
49862: #if defined(LIBXML_XPATH_ENABLED)
49863: int mem_base;
49864: xmlXPathContextPtr ctxt; /* the XPath context */
49865: int n_ctxt;
49866:
49867: for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
49868: mem_base = xmlMemBlocks();
49869: ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
49870:
49871: xmlXPathRegisteredVariablesCleanup(ctxt);
49872: call_tests++;
49873: des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
49874: xmlResetLastError();
49875: if (mem_base != xmlMemBlocks()) {
49876: printf("Leak of %d blocks found in xmlXPathRegisteredVariablesCleanup",
49877: xmlMemBlocks() - mem_base);
49878: test_ret++;
49879: printf(" %d", n_ctxt);
49880: printf("\n");
49881: }
49882: }
49883: function_tests++;
49884: #endif
49885:
49886: return(test_ret);
49887: }
49888:
49889:
49890: static int
49891: test_xmlXPathRoot(void) {
49892: int test_ret = 0;
49893:
49894: #if defined(LIBXML_XPATH_ENABLED)
49895: int mem_base;
49896: xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49897: int n_ctxt;
49898:
49899: for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49900: mem_base = xmlMemBlocks();
49901: ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49902:
49903: xmlXPathRoot(ctxt);
49904: call_tests++;
49905: des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49906: xmlResetLastError();
49907: if (mem_base != xmlMemBlocks()) {
49908: printf("Leak of %d blocks found in xmlXPathRoot",
49909: xmlMemBlocks() - mem_base);
49910: test_ret++;
49911: printf(" %d", n_ctxt);
49912: printf("\n");
49913: }
49914: }
49915: function_tests++;
49916: #endif
49917:
49918: return(test_ret);
49919: }
49920:
49921:
49922: static int
49923: test_xmlXPathRoundFunction(void) {
49924: int test_ret = 0;
49925:
49926: #if defined(LIBXML_XPATH_ENABLED)
49927: int mem_base;
49928: xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49929: int n_ctxt;
49930: int nargs; /* the number of arguments */
49931: int n_nargs;
49932:
49933: for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49934: for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49935: mem_base = xmlMemBlocks();
49936: ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49937: nargs = gen_int(n_nargs, 1);
49938:
49939: xmlXPathRoundFunction(ctxt, nargs);
49940: call_tests++;
49941: des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49942: des_int(n_nargs, nargs, 1);
49943: xmlResetLastError();
49944: if (mem_base != xmlMemBlocks()) {
49945: printf("Leak of %d blocks found in xmlXPathRoundFunction",
49946: xmlMemBlocks() - mem_base);
49947: test_ret++;
49948: printf(" %d", n_ctxt);
49949: printf(" %d", n_nargs);
49950: printf("\n");
49951: }
49952: }
49953: }
49954: function_tests++;
49955: #endif
49956:
49957: return(test_ret);
49958: }
49959:
49960:
49961: static int
49962: test_xmlXPathStartsWithFunction(void) {
49963: int test_ret = 0;
49964:
49965: #if defined(LIBXML_XPATH_ENABLED)
49966: int mem_base;
49967: xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49968: int n_ctxt;
49969: int nargs; /* the number of arguments */
49970: int n_nargs;
49971:
49972: for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49973: for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49974: mem_base = xmlMemBlocks();
49975: ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49976: nargs = gen_int(n_nargs, 1);
49977:
49978: xmlXPathStartsWithFunction(ctxt, nargs);
49979: call_tests++;
49980: des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49981: des_int(n_nargs, nargs, 1);
49982: xmlResetLastError();
49983: if (mem_base != xmlMemBlocks()) {
49984: printf("Leak of %d blocks found in xmlXPathStartsWithFunction",
49985: xmlMemBlocks() - mem_base);
49986: test_ret++;
49987: printf(" %d", n_ctxt);
49988: printf(" %d", n_nargs);
49989: printf("\n");
49990: }
49991: }
49992: }
49993: function_tests++;
49994: #endif
49995:
49996: return(test_ret);
49997: }
49998:
49999:
50000: static int
50001: test_xmlXPathStringEvalNumber(void) {
50002: int test_ret = 0;
50003:
50004: #if defined(LIBXML_XPATH_ENABLED)
50005: int mem_base;
50006: double ret_val;
50007: xmlChar * str; /* A string to scan */
50008: int n_str;
50009:
50010: for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
50011: mem_base = xmlMemBlocks();
50012: str = gen_const_xmlChar_ptr(n_str, 0);
50013:
50014: ret_val = xmlXPathStringEvalNumber((const xmlChar *)str);
50015: desret_double(ret_val);
50016: call_tests++;
50017: des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
50018: xmlResetLastError();
50019: if (mem_base != xmlMemBlocks()) {
50020: printf("Leak of %d blocks found in xmlXPathStringEvalNumber",
50021: xmlMemBlocks() - mem_base);
50022: test_ret++;
50023: printf(" %d", n_str);
50024: printf("\n");
50025: }
50026: }
50027: function_tests++;
50028: #endif
50029:
50030: return(test_ret);
50031: }
50032:
50033:
50034: static int
50035: test_xmlXPathStringFunction(void) {
50036: int test_ret = 0;
50037:
50038: #if defined(LIBXML_XPATH_ENABLED)
50039: int mem_base;
50040: xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50041: int n_ctxt;
50042: int nargs; /* the number of arguments */
50043: int n_nargs;
50044:
50045: for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50046: for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50047: mem_base = xmlMemBlocks();
50048: ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50049: nargs = gen_int(n_nargs, 1);
50050:
50051: xmlXPathStringFunction(ctxt, nargs);
50052: call_tests++;
50053: des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50054: des_int(n_nargs, nargs, 1);
50055: xmlResetLastError();
50056: if (mem_base != xmlMemBlocks()) {
50057: printf("Leak of %d blocks found in xmlXPathStringFunction",
50058: xmlMemBlocks() - mem_base);
50059: test_ret++;
50060: printf(" %d", n_ctxt);
50061: printf(" %d", n_nargs);
50062: printf("\n");
50063: }
50064: }
50065: }
50066: function_tests++;
50067: #endif
50068:
50069: return(test_ret);
50070: }
50071:
50072:
50073: static int
50074: test_xmlXPathStringLengthFunction(void) {
50075: int test_ret = 0;
50076:
50077: #if defined(LIBXML_XPATH_ENABLED)
50078: int mem_base;
50079: xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50080: int n_ctxt;
50081: int nargs; /* the number of arguments */
50082: int n_nargs;
50083:
50084: for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50085: for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50086: mem_base = xmlMemBlocks();
50087: ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50088: nargs = gen_int(n_nargs, 1);
50089:
50090: xmlXPathStringLengthFunction(ctxt, nargs);
50091: call_tests++;
50092: des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50093: des_int(n_nargs, nargs, 1);
50094: xmlResetLastError();
50095: if (mem_base != xmlMemBlocks()) {
50096: printf("Leak of %d blocks found in xmlXPathStringLengthFunction",
50097: xmlMemBlocks() - mem_base);
50098: test_ret++;
50099: printf(" %d", n_ctxt);
50100: printf(" %d", n_nargs);
50101: printf("\n");
50102: }
50103: }
50104: }
50105: function_tests++;
50106: #endif
50107:
50108: return(test_ret);
50109: }
50110:
50111:
50112: static int
50113: test_xmlXPathSubValues(void) {
50114: int test_ret = 0;
50115:
50116: #if defined(LIBXML_XPATH_ENABLED)
50117: int mem_base;
50118: xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50119: int n_ctxt;
50120:
50121: for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50122: mem_base = xmlMemBlocks();
50123: ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50124:
50125: xmlXPathSubValues(ctxt);
50126: call_tests++;
50127: des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50128: xmlResetLastError();
50129: if (mem_base != xmlMemBlocks()) {
50130: printf("Leak of %d blocks found in xmlXPathSubValues",
50131: xmlMemBlocks() - mem_base);
50132: test_ret++;
50133: printf(" %d", n_ctxt);
50134: printf("\n");
50135: }
50136: }
50137: function_tests++;
50138: #endif
50139:
50140: return(test_ret);
50141: }
50142:
50143:
50144: static int
50145: test_xmlXPathSubstringAfterFunction(void) {
50146: int test_ret = 0;
50147:
50148: #if defined(LIBXML_XPATH_ENABLED)
50149: int mem_base;
50150: xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50151: int n_ctxt;
50152: int nargs; /* the number of arguments */
50153: int n_nargs;
50154:
50155: for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50156: for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50157: mem_base = xmlMemBlocks();
50158: ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50159: nargs = gen_int(n_nargs, 1);
50160:
50161: xmlXPathSubstringAfterFunction(ctxt, nargs);
50162: call_tests++;
50163: des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50164: des_int(n_nargs, nargs, 1);
50165: xmlResetLastError();
50166: if (mem_base != xmlMemBlocks()) {
50167: printf("Leak of %d blocks found in xmlXPathSubstringAfterFunction",
50168: xmlMemBlocks() - mem_base);
50169: test_ret++;
50170: printf(" %d", n_ctxt);
50171: printf(" %d", n_nargs);
50172: printf("\n");
50173: }
50174: }
50175: }
50176: function_tests++;
50177: #endif
50178:
50179: return(test_ret);
50180: }
50181:
50182:
50183: static int
50184: test_xmlXPathSubstringBeforeFunction(void) {
50185: int test_ret = 0;
50186:
50187: #if defined(LIBXML_XPATH_ENABLED)
50188: int mem_base;
50189: xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50190: int n_ctxt;
50191: int nargs; /* the number of arguments */
50192: int n_nargs;
50193:
50194: for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50195: for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50196: mem_base = xmlMemBlocks();
50197: ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50198: nargs = gen_int(n_nargs, 1);
50199:
50200: xmlXPathSubstringBeforeFunction(ctxt, nargs);
50201: call_tests++;
50202: des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50203: des_int(n_nargs, nargs, 1);
50204: xmlResetLastError();
50205: if (mem_base != xmlMemBlocks()) {
50206: printf("Leak of %d blocks found in xmlXPathSubstringBeforeFunction",
50207: xmlMemBlocks() - mem_base);
50208: test_ret++;
50209: printf(" %d", n_ctxt);
50210: printf(" %d", n_nargs);
50211: printf("\n");
50212: }
50213: }
50214: }
50215: function_tests++;
50216: #endif
50217:
50218: return(test_ret);
50219: }
50220:
50221:
50222: static int
50223: test_xmlXPathSubstringFunction(void) {
50224: int test_ret = 0;
50225:
50226: #if defined(LIBXML_XPATH_ENABLED)
50227: int mem_base;
50228: xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50229: int n_ctxt;
50230: int nargs; /* the number of arguments */
50231: int n_nargs;
50232:
50233: for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50234: for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50235: mem_base = xmlMemBlocks();
50236: ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50237: nargs = gen_int(n_nargs, 1);
50238:
50239: xmlXPathSubstringFunction(ctxt, nargs);
50240: call_tests++;
50241: des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50242: des_int(n_nargs, nargs, 1);
50243: xmlResetLastError();
50244: if (mem_base != xmlMemBlocks()) {
50245: printf("Leak of %d blocks found in xmlXPathSubstringFunction",
50246: xmlMemBlocks() - mem_base);
50247: test_ret++;
50248: printf(" %d", n_ctxt);
50249: printf(" %d", n_nargs);
50250: printf("\n");
50251: }
50252: }
50253: }
50254: function_tests++;
50255: #endif
50256:
50257: return(test_ret);
50258: }
50259:
50260:
50261: static int
50262: test_xmlXPathSumFunction(void) {
50263: int test_ret = 0;
50264:
50265: #if defined(LIBXML_XPATH_ENABLED)
50266: int mem_base;
50267: xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50268: int n_ctxt;
50269: int nargs; /* the number of arguments */
50270: int n_nargs;
50271:
50272: for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50273: for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50274: mem_base = xmlMemBlocks();
50275: ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50276: nargs = gen_int(n_nargs, 1);
50277:
50278: xmlXPathSumFunction(ctxt, nargs);
50279: call_tests++;
50280: des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50281: des_int(n_nargs, nargs, 1);
50282: xmlResetLastError();
50283: if (mem_base != xmlMemBlocks()) {
50284: printf("Leak of %d blocks found in xmlXPathSumFunction",
50285: xmlMemBlocks() - mem_base);
50286: test_ret++;
50287: printf(" %d", n_ctxt);
50288: printf(" %d", n_nargs);
50289: printf("\n");
50290: }
50291: }
50292: }
50293: function_tests++;
50294: #endif
50295:
50296: return(test_ret);
50297: }
50298:
50299:
50300: static int
50301: test_xmlXPathTrailing(void) {
50302: int test_ret = 0;
50303:
50304: #if defined(LIBXML_XPATH_ENABLED)
50305: int mem_base;
50306: xmlNodeSetPtr ret_val;
50307: xmlNodeSetPtr nodes1; /* a node-set */
50308: int n_nodes1;
50309: xmlNodeSetPtr nodes2; /* a node-set */
50310: int n_nodes2;
50311:
50312: for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
50313: for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
50314: mem_base = xmlMemBlocks();
50315: nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
50316: nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
50317:
50318: ret_val = xmlXPathTrailing(nodes1, nodes2);
50319: desret_xmlNodeSetPtr(ret_val);
50320: call_tests++;
50321: des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
50322: des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
50323: xmlResetLastError();
50324: if (mem_base != xmlMemBlocks()) {
50325: printf("Leak of %d blocks found in xmlXPathTrailing",
50326: xmlMemBlocks() - mem_base);
50327: test_ret++;
50328: printf(" %d", n_nodes1);
50329: printf(" %d", n_nodes2);
50330: printf("\n");
50331: }
50332: }
50333: }
50334: function_tests++;
50335: #endif
50336:
50337: return(test_ret);
50338: }
50339:
50340:
50341: static int
50342: test_xmlXPathTrailingSorted(void) {
50343: int test_ret = 0;
50344:
50345: #if defined(LIBXML_XPATH_ENABLED)
50346: int mem_base;
50347: xmlNodeSetPtr ret_val;
50348: xmlNodeSetPtr nodes1; /* a node-set, sorted by document order */
50349: int n_nodes1;
50350: xmlNodeSetPtr nodes2; /* a node-set, sorted by document order */
50351: int n_nodes2;
50352:
50353: for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
50354: for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
50355: mem_base = xmlMemBlocks();
50356: nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
50357: nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
50358:
50359: ret_val = xmlXPathTrailingSorted(nodes1, nodes2);
50360: desret_xmlNodeSetPtr(ret_val);
50361: call_tests++;
50362: des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
50363: des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
50364: xmlResetLastError();
50365: if (mem_base != xmlMemBlocks()) {
50366: printf("Leak of %d blocks found in xmlXPathTrailingSorted",
50367: xmlMemBlocks() - mem_base);
50368: test_ret++;
50369: printf(" %d", n_nodes1);
50370: printf(" %d", n_nodes2);
50371: printf("\n");
50372: }
50373: }
50374: }
50375: function_tests++;
50376: #endif
50377:
50378: return(test_ret);
50379: }
50380:
50381:
50382: static int
50383: test_xmlXPathTranslateFunction(void) {
50384: int test_ret = 0;
50385:
50386: #if defined(LIBXML_XPATH_ENABLED)
50387: int mem_base;
50388: xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50389: int n_ctxt;
50390: int nargs; /* the number of arguments */
50391: int n_nargs;
50392:
50393: for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50394: for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50395: mem_base = xmlMemBlocks();
50396: ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50397: nargs = gen_int(n_nargs, 1);
50398:
50399: xmlXPathTranslateFunction(ctxt, nargs);
50400: call_tests++;
50401: des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50402: des_int(n_nargs, nargs, 1);
50403: xmlResetLastError();
50404: if (mem_base != xmlMemBlocks()) {
50405: printf("Leak of %d blocks found in xmlXPathTranslateFunction",
50406: xmlMemBlocks() - mem_base);
50407: test_ret++;
50408: printf(" %d", n_ctxt);
50409: printf(" %d", n_nargs);
50410: printf("\n");
50411: }
50412: }
50413: }
50414: function_tests++;
50415: #endif
50416:
50417: return(test_ret);
50418: }
50419:
50420:
50421: static int
50422: test_xmlXPathTrueFunction(void) {
50423: int test_ret = 0;
50424:
50425: #if defined(LIBXML_XPATH_ENABLED)
50426: int mem_base;
50427: xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50428: int n_ctxt;
50429: int nargs; /* the number of arguments */
50430: int n_nargs;
50431:
50432: for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50433: for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50434: mem_base = xmlMemBlocks();
50435: ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50436: nargs = gen_int(n_nargs, 1);
50437:
50438: xmlXPathTrueFunction(ctxt, nargs);
50439: call_tests++;
50440: des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50441: des_int(n_nargs, nargs, 1);
50442: xmlResetLastError();
50443: if (mem_base != xmlMemBlocks()) {
50444: printf("Leak of %d blocks found in xmlXPathTrueFunction",
50445: xmlMemBlocks() - mem_base);
50446: test_ret++;
50447: printf(" %d", n_ctxt);
50448: printf(" %d", n_nargs);
50449: printf("\n");
50450: }
50451: }
50452: }
50453: function_tests++;
50454: #endif
50455:
50456: return(test_ret);
50457: }
50458:
50459:
50460: static int
50461: test_xmlXPathValueFlipSign(void) {
50462: int test_ret = 0;
50463:
50464: #if defined(LIBXML_XPATH_ENABLED)
50465: int mem_base;
50466: xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50467: int n_ctxt;
50468:
50469: for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50470: mem_base = xmlMemBlocks();
50471: ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50472:
50473: xmlXPathValueFlipSign(ctxt);
50474: call_tests++;
50475: des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50476: xmlResetLastError();
50477: if (mem_base != xmlMemBlocks()) {
50478: printf("Leak of %d blocks found in xmlXPathValueFlipSign",
50479: xmlMemBlocks() - mem_base);
50480: test_ret++;
50481: printf(" %d", n_ctxt);
50482: printf("\n");
50483: }
50484: }
50485: function_tests++;
50486: #endif
50487:
50488: return(test_ret);
50489: }
50490:
50491:
50492: static int
50493: test_xmlXPathVariableLookup(void) {
50494: int test_ret = 0;
50495:
50496: #if defined(LIBXML_XPATH_ENABLED)
50497: int mem_base;
50498: xmlXPathObjectPtr ret_val;
50499: xmlXPathContextPtr ctxt; /* the XPath context */
50500: int n_ctxt;
50501: xmlChar * name; /* the variable name */
50502: int n_name;
50503:
50504: for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
50505: for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
50506: mem_base = xmlMemBlocks();
50507: ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
50508: name = gen_const_xmlChar_ptr(n_name, 1);
50509:
50510: ret_val = xmlXPathVariableLookup(ctxt, (const xmlChar *)name);
50511: desret_xmlXPathObjectPtr(ret_val);
50512: call_tests++;
50513: des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
50514: des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
50515: xmlResetLastError();
50516: if (mem_base != xmlMemBlocks()) {
50517: printf("Leak of %d blocks found in xmlXPathVariableLookup",
50518: xmlMemBlocks() - mem_base);
50519: test_ret++;
50520: printf(" %d", n_ctxt);
50521: printf(" %d", n_name);
50522: printf("\n");
50523: }
50524: }
50525: }
50526: function_tests++;
50527: #endif
50528:
50529: return(test_ret);
50530: }
50531:
50532:
50533: static int
50534: test_xmlXPathVariableLookupNS(void) {
50535: int test_ret = 0;
50536:
50537: #if defined(LIBXML_XPATH_ENABLED)
50538: int mem_base;
50539: xmlXPathObjectPtr ret_val;
50540: xmlXPathContextPtr ctxt; /* the XPath context */
50541: int n_ctxt;
50542: xmlChar * name; /* the variable name */
50543: int n_name;
50544: xmlChar * ns_uri; /* the variable namespace URI */
50545: int n_ns_uri;
50546:
50547: for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
50548: for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
50549: for (n_ns_uri = 0;n_ns_uri < gen_nb_const_xmlChar_ptr;n_ns_uri++) {
50550: mem_base = xmlMemBlocks();
50551: ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
50552: name = gen_const_xmlChar_ptr(n_name, 1);
50553: ns_uri = gen_const_xmlChar_ptr(n_ns_uri, 2);
50554:
50555: ret_val = xmlXPathVariableLookupNS(ctxt, (const xmlChar *)name, (const xmlChar *)ns_uri);
50556: desret_xmlXPathObjectPtr(ret_val);
50557: call_tests++;
50558: des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
50559: des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
50560: des_const_xmlChar_ptr(n_ns_uri, (const xmlChar *)ns_uri, 2);
50561: xmlResetLastError();
50562: if (mem_base != xmlMemBlocks()) {
50563: printf("Leak of %d blocks found in xmlXPathVariableLookupNS",
50564: xmlMemBlocks() - mem_base);
50565: test_ret++;
50566: printf(" %d", n_ctxt);
50567: printf(" %d", n_name);
50568: printf(" %d", n_ns_uri);
50569: printf("\n");
50570: }
50571: }
50572: }
50573: }
50574: function_tests++;
50575: #endif
50576:
50577: return(test_ret);
50578: }
50579:
50580:
50581: static int
50582: test_xmlXPathWrapCString(void) {
50583: int test_ret = 0;
50584:
50585: #if defined(LIBXML_XPATH_ENABLED)
50586: int mem_base;
50587: xmlXPathObjectPtr ret_val;
50588: char * val; /* the char * value */
50589: int n_val;
50590:
50591: for (n_val = 0;n_val < gen_nb_char_ptr;n_val++) {
50592: mem_base = xmlMemBlocks();
50593: val = gen_char_ptr(n_val, 0);
50594:
50595: ret_val = xmlXPathWrapCString(val);
50596: desret_xmlXPathObjectPtr(ret_val);
50597: call_tests++;
50598: des_char_ptr(n_val, val, 0);
50599: xmlResetLastError();
50600: if (mem_base != xmlMemBlocks()) {
50601: printf("Leak of %d blocks found in xmlXPathWrapCString",
50602: xmlMemBlocks() - mem_base);
50603: test_ret++;
50604: printf(" %d", n_val);
50605: printf("\n");
50606: }
50607: }
50608: function_tests++;
50609: #endif
50610:
50611: return(test_ret);
50612: }
50613:
50614:
50615: static int
50616: test_xmlXPathWrapExternal(void) {
50617: int test_ret = 0;
50618:
50619: #if defined(LIBXML_XPATH_ENABLED)
50620: int mem_base;
50621: xmlXPathObjectPtr ret_val;
50622: void * val; /* the user data */
50623: int n_val;
50624:
50625: for (n_val = 0;n_val < gen_nb_void_ptr;n_val++) {
50626: mem_base = xmlMemBlocks();
50627: val = gen_void_ptr(n_val, 0);
50628:
50629: ret_val = xmlXPathWrapExternal(val);
50630: desret_xmlXPathObjectPtr(ret_val);
50631: call_tests++;
50632: des_void_ptr(n_val, val, 0);
50633: xmlResetLastError();
50634: if (mem_base != xmlMemBlocks()) {
50635: printf("Leak of %d blocks found in xmlXPathWrapExternal",
50636: xmlMemBlocks() - mem_base);
50637: test_ret++;
50638: printf(" %d", n_val);
50639: printf("\n");
50640: }
50641: }
50642: function_tests++;
50643: #endif
50644:
50645: return(test_ret);
50646: }
50647:
50648:
50649: static int
50650: test_xmlXPathWrapNodeSet(void) {
50651: int test_ret = 0;
50652:
50653: #if defined(LIBXML_XPATH_ENABLED)
50654: int mem_base;
50655: xmlXPathObjectPtr ret_val;
50656: xmlNodeSetPtr val; /* the NodePtr value */
50657: int n_val;
50658:
50659: for (n_val = 0;n_val < gen_nb_xmlNodeSetPtr;n_val++) {
50660: mem_base = xmlMemBlocks();
50661: val = gen_xmlNodeSetPtr(n_val, 0);
50662:
50663: ret_val = xmlXPathWrapNodeSet(val);
50664: desret_xmlXPathObjectPtr(ret_val);
50665: call_tests++;
50666: des_xmlNodeSetPtr(n_val, val, 0);
50667: xmlResetLastError();
50668: if (mem_base != xmlMemBlocks()) {
50669: printf("Leak of %d blocks found in xmlXPathWrapNodeSet",
50670: xmlMemBlocks() - mem_base);
50671: test_ret++;
50672: printf(" %d", n_val);
50673: printf("\n");
50674: }
50675: }
50676: function_tests++;
50677: #endif
50678:
50679: return(test_ret);
50680: }
50681:
50682:
50683: static int
50684: test_xmlXPatherror(void) {
50685: int test_ret = 0;
50686:
50687: #if defined(LIBXML_XPATH_ENABLED)
50688: int mem_base;
50689: xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50690: int n_ctxt;
50691: const char * file; /* the file name */
50692: int n_file;
50693: int line; /* the line number */
50694: int n_line;
50695: int no; /* the error number */
50696: int n_no;
50697:
50698: for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50699: for (n_file = 0;n_file < gen_nb_filepath;n_file++) {
50700: for (n_line = 0;n_line < gen_nb_int;n_line++) {
50701: for (n_no = 0;n_no < gen_nb_int;n_no++) {
50702: mem_base = xmlMemBlocks();
50703: ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50704: file = gen_filepath(n_file, 1);
50705: line = gen_int(n_line, 2);
50706: no = gen_int(n_no, 3);
50707:
50708: xmlXPatherror(ctxt, file, line, no);
50709: call_tests++;
50710: des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50711: des_filepath(n_file, file, 1);
50712: des_int(n_line, line, 2);
50713: des_int(n_no, no, 3);
50714: xmlResetLastError();
50715: if (mem_base != xmlMemBlocks()) {
50716: printf("Leak of %d blocks found in xmlXPatherror",
50717: xmlMemBlocks() - mem_base);
50718: test_ret++;
50719: printf(" %d", n_ctxt);
50720: printf(" %d", n_file);
50721: printf(" %d", n_line);
50722: printf(" %d", n_no);
50723: printf("\n");
50724: }
50725: }
50726: }
50727: }
50728: }
50729: function_tests++;
50730: #endif
50731:
50732: return(test_ret);
50733: }
50734:
50735: static int
50736: test_xpathInternals(void) {
50737: int test_ret = 0;
50738:
50739: if (quiet == 0) printf("Testing xpathInternals : 106 of 117 functions ...\n");
50740: test_ret += test_valuePop();
50741: test_ret += test_valuePush();
50742: test_ret += test_xmlXPathAddValues();
50743: test_ret += test_xmlXPathBooleanFunction();
50744: test_ret += test_xmlXPathCeilingFunction();
50745: test_ret += test_xmlXPathCompareValues();
50746: test_ret += test_xmlXPathConcatFunction();
50747: test_ret += test_xmlXPathContainsFunction();
50748: test_ret += test_xmlXPathCountFunction();
50749: test_ret += test_xmlXPathDebugDumpCompExpr();
50750: test_ret += test_xmlXPathDebugDumpObject();
50751: test_ret += test_xmlXPathDifference();
50752: test_ret += test_xmlXPathDistinct();
50753: test_ret += test_xmlXPathDistinctSorted();
50754: test_ret += test_xmlXPathDivValues();
50755: test_ret += test_xmlXPathEqualValues();
50756: test_ret += test_xmlXPathErr();
50757: test_ret += test_xmlXPathEvalExpr();
50758: test_ret += test_xmlXPathEvaluatePredicateResult();
50759: test_ret += test_xmlXPathFalseFunction();
50760: test_ret += test_xmlXPathFloorFunction();
50761: test_ret += test_xmlXPathFunctionLookup();
50762: test_ret += test_xmlXPathFunctionLookupNS();
50763: test_ret += test_xmlXPathHasSameNodes();
50764: test_ret += test_xmlXPathIdFunction();
50765: test_ret += test_xmlXPathIntersection();
50766: test_ret += test_xmlXPathIsNodeType();
50767: test_ret += test_xmlXPathLangFunction();
50768: test_ret += test_xmlXPathLastFunction();
50769: test_ret += test_xmlXPathLeading();
50770: test_ret += test_xmlXPathLeadingSorted();
50771: test_ret += test_xmlXPathLocalNameFunction();
50772: test_ret += test_xmlXPathModValues();
50773: test_ret += test_xmlXPathMultValues();
50774: test_ret += test_xmlXPathNamespaceURIFunction();
50775: test_ret += test_xmlXPathNewBoolean();
50776: test_ret += test_xmlXPathNewCString();
50777: test_ret += test_xmlXPathNewFloat();
50778: test_ret += test_xmlXPathNewNodeSet();
50779: test_ret += test_xmlXPathNewNodeSetList();
50780: test_ret += test_xmlXPathNewParserContext();
50781: test_ret += test_xmlXPathNewString();
50782: test_ret += test_xmlXPathNextAncestor();
50783: test_ret += test_xmlXPathNextAncestorOrSelf();
50784: test_ret += test_xmlXPathNextAttribute();
50785: test_ret += test_xmlXPathNextChild();
50786: test_ret += test_xmlXPathNextDescendant();
50787: test_ret += test_xmlXPathNextDescendantOrSelf();
50788: test_ret += test_xmlXPathNextFollowing();
50789: test_ret += test_xmlXPathNextFollowingSibling();
50790: test_ret += test_xmlXPathNextNamespace();
50791: test_ret += test_xmlXPathNextParent();
50792: test_ret += test_xmlXPathNextPreceding();
50793: test_ret += test_xmlXPathNextPrecedingSibling();
50794: test_ret += test_xmlXPathNextSelf();
50795: test_ret += test_xmlXPathNodeLeading();
50796: test_ret += test_xmlXPathNodeLeadingSorted();
50797: test_ret += test_xmlXPathNodeSetAdd();
50798: test_ret += test_xmlXPathNodeSetAddNs();
50799: test_ret += test_xmlXPathNodeSetAddUnique();
50800: test_ret += test_xmlXPathNodeSetContains();
50801: test_ret += test_xmlXPathNodeSetDel();
50802: test_ret += test_xmlXPathNodeSetMerge();
50803: test_ret += test_xmlXPathNodeSetRemove();
50804: test_ret += test_xmlXPathNodeSetSort();
50805: test_ret += test_xmlXPathNodeTrailing();
50806: test_ret += test_xmlXPathNodeTrailingSorted();
50807: test_ret += test_xmlXPathNormalizeFunction();
50808: test_ret += test_xmlXPathNotEqualValues();
50809: test_ret += test_xmlXPathNotFunction();
50810: test_ret += test_xmlXPathNsLookup();
50811: test_ret += test_xmlXPathNumberFunction();
50812: test_ret += test_xmlXPathParseNCName();
50813: test_ret += test_xmlXPathParseName();
50814: test_ret += test_xmlXPathPopBoolean();
50815: test_ret += test_xmlXPathPopExternal();
50816: test_ret += test_xmlXPathPopNodeSet();
50817: test_ret += test_xmlXPathPopNumber();
50818: test_ret += test_xmlXPathPopString();
50819: test_ret += test_xmlXPathPositionFunction();
50820: test_ret += test_xmlXPathRegisterAllFunctions();
50821: test_ret += test_xmlXPathRegisterFunc();
50822: test_ret += test_xmlXPathRegisterFuncLookup();
50823: test_ret += test_xmlXPathRegisterFuncNS();
50824: test_ret += test_xmlXPathRegisterNs();
50825: test_ret += test_xmlXPathRegisterVariable();
50826: test_ret += test_xmlXPathRegisterVariableLookup();
50827: test_ret += test_xmlXPathRegisterVariableNS();
50828: test_ret += test_xmlXPathRegisteredFuncsCleanup();
50829: test_ret += test_xmlXPathRegisteredNsCleanup();
50830: test_ret += test_xmlXPathRegisteredVariablesCleanup();
50831: test_ret += test_xmlXPathRoot();
50832: test_ret += test_xmlXPathRoundFunction();
50833: test_ret += test_xmlXPathStartsWithFunction();
50834: test_ret += test_xmlXPathStringEvalNumber();
50835: test_ret += test_xmlXPathStringFunction();
50836: test_ret += test_xmlXPathStringLengthFunction();
50837: test_ret += test_xmlXPathSubValues();
50838: test_ret += test_xmlXPathSubstringAfterFunction();
50839: test_ret += test_xmlXPathSubstringBeforeFunction();
50840: test_ret += test_xmlXPathSubstringFunction();
50841: test_ret += test_xmlXPathSumFunction();
50842: test_ret += test_xmlXPathTrailing();
50843: test_ret += test_xmlXPathTrailingSorted();
50844: test_ret += test_xmlXPathTranslateFunction();
50845: test_ret += test_xmlXPathTrueFunction();
50846: test_ret += test_xmlXPathValueFlipSign();
50847: test_ret += test_xmlXPathVariableLookup();
50848: test_ret += test_xmlXPathVariableLookupNS();
50849: test_ret += test_xmlXPathWrapCString();
50850: test_ret += test_xmlXPathWrapExternal();
50851: test_ret += test_xmlXPathWrapNodeSet();
50852: test_ret += test_xmlXPatherror();
50853:
50854: if (test_ret != 0)
50855: printf("Module xpathInternals: %d errors\n", test_ret);
50856: return(test_ret);
50857: }
50858:
50859: static int
50860: test_xmlXPtrBuildNodeList(void) {
50861: int test_ret = 0;
50862:
50863: #if defined(LIBXML_XPTR_ENABLED)
50864: int mem_base;
50865: xmlNodePtr ret_val;
50866: xmlXPathObjectPtr obj; /* the XPointer result from the evaluation. */
50867: int n_obj;
50868:
50869: for (n_obj = 0;n_obj < gen_nb_xmlXPathObjectPtr;n_obj++) {
50870: mem_base = xmlMemBlocks();
50871: obj = gen_xmlXPathObjectPtr(n_obj, 0);
50872:
50873: ret_val = xmlXPtrBuildNodeList(obj);
50874: desret_xmlNodePtr(ret_val);
50875: call_tests++;
50876: des_xmlXPathObjectPtr(n_obj, obj, 0);
50877: xmlResetLastError();
50878: if (mem_base != xmlMemBlocks()) {
50879: printf("Leak of %d blocks found in xmlXPtrBuildNodeList",
50880: xmlMemBlocks() - mem_base);
50881: test_ret++;
50882: printf(" %d", n_obj);
50883: printf("\n");
50884: }
50885: }
50886: function_tests++;
50887: #endif
50888:
50889: return(test_ret);
50890: }
50891:
50892:
50893: static int
50894: test_xmlXPtrEval(void) {
50895: int test_ret = 0;
50896:
50897: #if defined(LIBXML_XPTR_ENABLED)
50898: int mem_base;
50899: xmlXPathObjectPtr ret_val;
50900: xmlChar * str; /* the XPointer expression */
50901: int n_str;
50902: xmlXPathContextPtr ctx; /* the XPointer context */
50903: int n_ctx;
50904:
50905: for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
50906: for (n_ctx = 0;n_ctx < gen_nb_xmlXPathContextPtr;n_ctx++) {
50907: mem_base = xmlMemBlocks();
50908: str = gen_const_xmlChar_ptr(n_str, 0);
50909: ctx = gen_xmlXPathContextPtr(n_ctx, 1);
50910:
50911: ret_val = xmlXPtrEval((const xmlChar *)str, ctx);
50912: desret_xmlXPathObjectPtr(ret_val);
50913: call_tests++;
50914: des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
50915: des_xmlXPathContextPtr(n_ctx, ctx, 1);
50916: xmlResetLastError();
50917: if (mem_base != xmlMemBlocks()) {
50918: printf("Leak of %d blocks found in xmlXPtrEval",
50919: xmlMemBlocks() - mem_base);
50920: test_ret++;
50921: printf(" %d", n_str);
50922: printf(" %d", n_ctx);
50923: printf("\n");
50924: }
50925: }
50926: }
50927: function_tests++;
50928: #endif
50929:
50930: return(test_ret);
50931: }
50932:
50933:
50934: static int
50935: test_xmlXPtrEvalRangePredicate(void) {
50936: int test_ret = 0;
50937:
50938: #if defined(LIBXML_XPTR_ENABLED)
50939: int mem_base;
50940: xmlXPathParserContextPtr ctxt; /* the XPointer Parser context */
50941: int n_ctxt;
50942:
50943: for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50944: mem_base = xmlMemBlocks();
50945: ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50946:
50947: xmlXPtrEvalRangePredicate(ctxt);
50948: call_tests++;
50949: des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50950: xmlResetLastError();
50951: if (mem_base != xmlMemBlocks()) {
50952: printf("Leak of %d blocks found in xmlXPtrEvalRangePredicate",
50953: xmlMemBlocks() - mem_base);
50954: test_ret++;
50955: printf(" %d", n_ctxt);
50956: printf("\n");
50957: }
50958: }
50959: function_tests++;
50960: #endif
50961:
50962: return(test_ret);
50963: }
50964:
50965: #ifdef LIBXML_XPTR_ENABLED
50966:
50967: #define gen_nb_xmlLocationSetPtr 1
50968: static xmlLocationSetPtr gen_xmlLocationSetPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
50969: return(NULL);
50970: }
50971: static void des_xmlLocationSetPtr(int no ATTRIBUTE_UNUSED, xmlLocationSetPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
50972: }
50973: #endif
50974:
50975:
50976: static int
50977: test_xmlXPtrLocationSetAdd(void) {
50978: int test_ret = 0;
50979:
50980: #if defined(LIBXML_XPTR_ENABLED)
50981: int mem_base;
50982: xmlLocationSetPtr cur; /* the initial range set */
50983: int n_cur;
50984: xmlXPathObjectPtr val; /* a new xmlXPathObjectPtr */
50985: int n_val;
50986:
50987: for (n_cur = 0;n_cur < gen_nb_xmlLocationSetPtr;n_cur++) {
50988: for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
50989: mem_base = xmlMemBlocks();
50990: cur = gen_xmlLocationSetPtr(n_cur, 0);
50991: val = gen_xmlXPathObjectPtr(n_val, 1);
50992:
50993: xmlXPtrLocationSetAdd(cur, val);
50994: call_tests++;
50995: des_xmlLocationSetPtr(n_cur, cur, 0);
50996: des_xmlXPathObjectPtr(n_val, val, 1);
50997: xmlResetLastError();
50998: if (mem_base != xmlMemBlocks()) {
50999: printf("Leak of %d blocks found in xmlXPtrLocationSetAdd",
51000: xmlMemBlocks() - mem_base);
51001: test_ret++;
51002: printf(" %d", n_cur);
51003: printf(" %d", n_val);
51004: printf("\n");
51005: }
51006: }
51007: }
51008: function_tests++;
51009: #endif
51010:
51011: return(test_ret);
51012: }
51013:
51014:
51015: static int
51016: test_xmlXPtrLocationSetCreate(void) {
51017: int test_ret = 0;
51018:
51019:
51020: /* missing type support */
51021: return(test_ret);
51022: }
51023:
51024:
51025: static int
51026: test_xmlXPtrLocationSetDel(void) {
51027: int test_ret = 0;
51028:
51029: #if defined(LIBXML_XPTR_ENABLED)
51030: int mem_base;
51031: xmlLocationSetPtr cur; /* the initial range set */
51032: int n_cur;
51033: xmlXPathObjectPtr val; /* an xmlXPathObjectPtr */
51034: int n_val;
51035:
51036: for (n_cur = 0;n_cur < gen_nb_xmlLocationSetPtr;n_cur++) {
51037: for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
51038: mem_base = xmlMemBlocks();
51039: cur = gen_xmlLocationSetPtr(n_cur, 0);
51040: val = gen_xmlXPathObjectPtr(n_val, 1);
51041:
51042: xmlXPtrLocationSetDel(cur, val);
51043: call_tests++;
51044: des_xmlLocationSetPtr(n_cur, cur, 0);
51045: des_xmlXPathObjectPtr(n_val, val, 1);
51046: xmlResetLastError();
51047: if (mem_base != xmlMemBlocks()) {
51048: printf("Leak of %d blocks found in xmlXPtrLocationSetDel",
51049: xmlMemBlocks() - mem_base);
51050: test_ret++;
51051: printf(" %d", n_cur);
51052: printf(" %d", n_val);
51053: printf("\n");
51054: }
51055: }
51056: }
51057: function_tests++;
51058: #endif
51059:
51060: return(test_ret);
51061: }
51062:
51063:
51064: static int
51065: test_xmlXPtrLocationSetMerge(void) {
51066: int test_ret = 0;
51067:
51068:
51069: /* missing type support */
51070: return(test_ret);
51071: }
51072:
51073:
51074: static int
51075: test_xmlXPtrLocationSetRemove(void) {
51076: int test_ret = 0;
51077:
51078: #if defined(LIBXML_XPTR_ENABLED)
51079: int mem_base;
51080: xmlLocationSetPtr cur; /* the initial range set */
51081: int n_cur;
51082: int val; /* the index to remove */
51083: int n_val;
51084:
51085: for (n_cur = 0;n_cur < gen_nb_xmlLocationSetPtr;n_cur++) {
51086: for (n_val = 0;n_val < gen_nb_int;n_val++) {
51087: mem_base = xmlMemBlocks();
51088: cur = gen_xmlLocationSetPtr(n_cur, 0);
51089: val = gen_int(n_val, 1);
51090:
51091: xmlXPtrLocationSetRemove(cur, val);
51092: call_tests++;
51093: des_xmlLocationSetPtr(n_cur, cur, 0);
51094: des_int(n_val, val, 1);
51095: xmlResetLastError();
51096: if (mem_base != xmlMemBlocks()) {
51097: printf("Leak of %d blocks found in xmlXPtrLocationSetRemove",
51098: xmlMemBlocks() - mem_base);
51099: test_ret++;
51100: printf(" %d", n_cur);
51101: printf(" %d", n_val);
51102: printf("\n");
51103: }
51104: }
51105: }
51106: function_tests++;
51107: #endif
51108:
51109: return(test_ret);
51110: }
51111:
51112:
51113: static int
51114: test_xmlXPtrNewCollapsedRange(void) {
51115: int test_ret = 0;
51116:
51117: #if defined(LIBXML_XPTR_ENABLED)
51118: int mem_base;
51119: xmlXPathObjectPtr ret_val;
51120: xmlNodePtr start; /* the starting and ending node */
51121: int n_start;
51122:
51123: for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
51124: mem_base = xmlMemBlocks();
51125: start = gen_xmlNodePtr(n_start, 0);
51126:
51127: ret_val = xmlXPtrNewCollapsedRange(start);
51128: desret_xmlXPathObjectPtr(ret_val);
51129: call_tests++;
51130: des_xmlNodePtr(n_start, start, 0);
51131: xmlResetLastError();
51132: if (mem_base != xmlMemBlocks()) {
51133: printf("Leak of %d blocks found in xmlXPtrNewCollapsedRange",
51134: xmlMemBlocks() - mem_base);
51135: test_ret++;
51136: printf(" %d", n_start);
51137: printf("\n");
51138: }
51139: }
51140: function_tests++;
51141: #endif
51142:
51143: return(test_ret);
51144: }
51145:
51146:
51147: static int
51148: test_xmlXPtrNewContext(void) {
51149: int test_ret = 0;
51150:
51151:
51152: /* missing type support */
51153: return(test_ret);
51154: }
51155:
51156:
51157: static int
51158: test_xmlXPtrNewLocationSetNodeSet(void) {
51159: int test_ret = 0;
51160:
51161: #if defined(LIBXML_XPTR_ENABLED)
51162: int mem_base;
51163: xmlXPathObjectPtr ret_val;
51164: xmlNodeSetPtr set; /* a node set */
51165: int n_set;
51166:
51167: for (n_set = 0;n_set < gen_nb_xmlNodeSetPtr;n_set++) {
51168: mem_base = xmlMemBlocks();
51169: set = gen_xmlNodeSetPtr(n_set, 0);
51170:
51171: ret_val = xmlXPtrNewLocationSetNodeSet(set);
51172: desret_xmlXPathObjectPtr(ret_val);
51173: call_tests++;
51174: des_xmlNodeSetPtr(n_set, set, 0);
51175: xmlResetLastError();
51176: if (mem_base != xmlMemBlocks()) {
51177: printf("Leak of %d blocks found in xmlXPtrNewLocationSetNodeSet",
51178: xmlMemBlocks() - mem_base);
51179: test_ret++;
51180: printf(" %d", n_set);
51181: printf("\n");
51182: }
51183: }
51184: function_tests++;
51185: #endif
51186:
51187: return(test_ret);
51188: }
51189:
51190:
51191: static int
51192: test_xmlXPtrNewLocationSetNodes(void) {
51193: int test_ret = 0;
51194:
51195: #if defined(LIBXML_XPTR_ENABLED)
51196: int mem_base;
51197: xmlXPathObjectPtr ret_val;
51198: xmlNodePtr start; /* the start NodePtr value */
51199: int n_start;
51200: xmlNodePtr end; /* the end NodePtr value or NULL */
51201: int n_end;
51202:
51203: for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
51204: for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) {
51205: mem_base = xmlMemBlocks();
51206: start = gen_xmlNodePtr(n_start, 0);
51207: end = gen_xmlNodePtr(n_end, 1);
51208:
51209: ret_val = xmlXPtrNewLocationSetNodes(start, end);
51210: desret_xmlXPathObjectPtr(ret_val);
51211: call_tests++;
51212: des_xmlNodePtr(n_start, start, 0);
51213: des_xmlNodePtr(n_end, end, 1);
51214: xmlResetLastError();
51215: if (mem_base != xmlMemBlocks()) {
51216: printf("Leak of %d blocks found in xmlXPtrNewLocationSetNodes",
51217: xmlMemBlocks() - mem_base);
51218: test_ret++;
51219: printf(" %d", n_start);
51220: printf(" %d", n_end);
51221: printf("\n");
51222: }
51223: }
51224: }
51225: function_tests++;
51226: #endif
51227:
51228: return(test_ret);
51229: }
51230:
51231:
51232: static int
51233: test_xmlXPtrNewRange(void) {
51234: int test_ret = 0;
51235:
51236: #if defined(LIBXML_XPTR_ENABLED)
51237: int mem_base;
51238: xmlXPathObjectPtr ret_val;
51239: xmlNodePtr start; /* the starting node */
51240: int n_start;
51241: int startindex; /* the start index */
51242: int n_startindex;
51243: xmlNodePtr end; /* the ending point */
51244: int n_end;
51245: int endindex; /* the ending index */
51246: int n_endindex;
51247:
51248: for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
51249: for (n_startindex = 0;n_startindex < gen_nb_int;n_startindex++) {
51250: for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) {
51251: for (n_endindex = 0;n_endindex < gen_nb_int;n_endindex++) {
51252: mem_base = xmlMemBlocks();
51253: start = gen_xmlNodePtr(n_start, 0);
51254: startindex = gen_int(n_startindex, 1);
51255: end = gen_xmlNodePtr(n_end, 2);
51256: endindex = gen_int(n_endindex, 3);
51257:
51258: ret_val = xmlXPtrNewRange(start, startindex, end, endindex);
51259: desret_xmlXPathObjectPtr(ret_val);
51260: call_tests++;
51261: des_xmlNodePtr(n_start, start, 0);
51262: des_int(n_startindex, startindex, 1);
51263: des_xmlNodePtr(n_end, end, 2);
51264: des_int(n_endindex, endindex, 3);
51265: xmlResetLastError();
51266: if (mem_base != xmlMemBlocks()) {
51267: printf("Leak of %d blocks found in xmlXPtrNewRange",
51268: xmlMemBlocks() - mem_base);
51269: test_ret++;
51270: printf(" %d", n_start);
51271: printf(" %d", n_startindex);
51272: printf(" %d", n_end);
51273: printf(" %d", n_endindex);
51274: printf("\n");
51275: }
51276: }
51277: }
51278: }
51279: }
51280: function_tests++;
51281: #endif
51282:
51283: return(test_ret);
51284: }
51285:
51286:
51287: static int
51288: test_xmlXPtrNewRangeNodeObject(void) {
51289: int test_ret = 0;
51290:
51291: #if defined(LIBXML_XPTR_ENABLED)
51292: int mem_base;
51293: xmlXPathObjectPtr ret_val;
51294: xmlNodePtr start; /* the starting node */
51295: int n_start;
51296: xmlXPathObjectPtr end; /* the ending object */
51297: int n_end;
51298:
51299: for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
51300: for (n_end = 0;n_end < gen_nb_xmlXPathObjectPtr;n_end++) {
51301: mem_base = xmlMemBlocks();
51302: start = gen_xmlNodePtr(n_start, 0);
51303: end = gen_xmlXPathObjectPtr(n_end, 1);
51304:
51305: ret_val = xmlXPtrNewRangeNodeObject(start, end);
51306: desret_xmlXPathObjectPtr(ret_val);
51307: call_tests++;
51308: des_xmlNodePtr(n_start, start, 0);
51309: des_xmlXPathObjectPtr(n_end, end, 1);
51310: xmlResetLastError();
51311: if (mem_base != xmlMemBlocks()) {
51312: printf("Leak of %d blocks found in xmlXPtrNewRangeNodeObject",
51313: xmlMemBlocks() - mem_base);
51314: test_ret++;
51315: printf(" %d", n_start);
51316: printf(" %d", n_end);
51317: printf("\n");
51318: }
51319: }
51320: }
51321: function_tests++;
51322: #endif
51323:
51324: return(test_ret);
51325: }
51326:
51327:
51328: static int
51329: test_xmlXPtrNewRangeNodePoint(void) {
51330: int test_ret = 0;
51331:
51332: #if defined(LIBXML_XPTR_ENABLED)
51333: int mem_base;
51334: xmlXPathObjectPtr ret_val;
51335: xmlNodePtr start; /* the starting node */
51336: int n_start;
51337: xmlXPathObjectPtr end; /* the ending point */
51338: int n_end;
51339:
51340: for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
51341: for (n_end = 0;n_end < gen_nb_xmlXPathObjectPtr;n_end++) {
51342: mem_base = xmlMemBlocks();
51343: start = gen_xmlNodePtr(n_start, 0);
51344: end = gen_xmlXPathObjectPtr(n_end, 1);
51345:
51346: ret_val = xmlXPtrNewRangeNodePoint(start, end);
51347: desret_xmlXPathObjectPtr(ret_val);
51348: call_tests++;
51349: des_xmlNodePtr(n_start, start, 0);
51350: des_xmlXPathObjectPtr(n_end, end, 1);
51351: xmlResetLastError();
51352: if (mem_base != xmlMemBlocks()) {
51353: printf("Leak of %d blocks found in xmlXPtrNewRangeNodePoint",
51354: xmlMemBlocks() - mem_base);
51355: test_ret++;
51356: printf(" %d", n_start);
51357: printf(" %d", n_end);
51358: printf("\n");
51359: }
51360: }
51361: }
51362: function_tests++;
51363: #endif
51364:
51365: return(test_ret);
51366: }
51367:
51368:
51369: static int
51370: test_xmlXPtrNewRangeNodes(void) {
51371: int test_ret = 0;
51372:
51373: #if defined(LIBXML_XPTR_ENABLED)
51374: int mem_base;
51375: xmlXPathObjectPtr ret_val;
51376: xmlNodePtr start; /* the starting node */
51377: int n_start;
51378: xmlNodePtr end; /* the ending node */
51379: int n_end;
51380:
51381: for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
51382: for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) {
51383: mem_base = xmlMemBlocks();
51384: start = gen_xmlNodePtr(n_start, 0);
51385: end = gen_xmlNodePtr(n_end, 1);
51386:
51387: ret_val = xmlXPtrNewRangeNodes(start, end);
51388: desret_xmlXPathObjectPtr(ret_val);
51389: call_tests++;
51390: des_xmlNodePtr(n_start, start, 0);
51391: des_xmlNodePtr(n_end, end, 1);
51392: xmlResetLastError();
51393: if (mem_base != xmlMemBlocks()) {
51394: printf("Leak of %d blocks found in xmlXPtrNewRangeNodes",
51395: xmlMemBlocks() - mem_base);
51396: test_ret++;
51397: printf(" %d", n_start);
51398: printf(" %d", n_end);
51399: printf("\n");
51400: }
51401: }
51402: }
51403: function_tests++;
51404: #endif
51405:
51406: return(test_ret);
51407: }
51408:
51409:
51410: static int
51411: test_xmlXPtrNewRangePointNode(void) {
51412: int test_ret = 0;
51413:
51414: #if defined(LIBXML_XPTR_ENABLED)
51415: int mem_base;
51416: xmlXPathObjectPtr ret_val;
51417: xmlXPathObjectPtr start; /* the starting point */
51418: int n_start;
51419: xmlNodePtr end; /* the ending node */
51420: int n_end;
51421:
51422: for (n_start = 0;n_start < gen_nb_xmlXPathObjectPtr;n_start++) {
51423: for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) {
51424: mem_base = xmlMemBlocks();
51425: start = gen_xmlXPathObjectPtr(n_start, 0);
51426: end = gen_xmlNodePtr(n_end, 1);
51427:
51428: ret_val = xmlXPtrNewRangePointNode(start, end);
51429: desret_xmlXPathObjectPtr(ret_val);
51430: call_tests++;
51431: des_xmlXPathObjectPtr(n_start, start, 0);
51432: des_xmlNodePtr(n_end, end, 1);
51433: xmlResetLastError();
51434: if (mem_base != xmlMemBlocks()) {
51435: printf("Leak of %d blocks found in xmlXPtrNewRangePointNode",
51436: xmlMemBlocks() - mem_base);
51437: test_ret++;
51438: printf(" %d", n_start);
51439: printf(" %d", n_end);
51440: printf("\n");
51441: }
51442: }
51443: }
51444: function_tests++;
51445: #endif
51446:
51447: return(test_ret);
51448: }
51449:
51450:
51451: static int
51452: test_xmlXPtrNewRangePoints(void) {
51453: int test_ret = 0;
51454:
51455: #if defined(LIBXML_XPTR_ENABLED)
51456: int mem_base;
51457: xmlXPathObjectPtr ret_val;
51458: xmlXPathObjectPtr start; /* the starting point */
51459: int n_start;
51460: xmlXPathObjectPtr end; /* the ending point */
51461: int n_end;
51462:
51463: for (n_start = 0;n_start < gen_nb_xmlXPathObjectPtr;n_start++) {
51464: for (n_end = 0;n_end < gen_nb_xmlXPathObjectPtr;n_end++) {
51465: mem_base = xmlMemBlocks();
51466: start = gen_xmlXPathObjectPtr(n_start, 0);
51467: end = gen_xmlXPathObjectPtr(n_end, 1);
51468:
51469: ret_val = xmlXPtrNewRangePoints(start, end);
51470: desret_xmlXPathObjectPtr(ret_val);
51471: call_tests++;
51472: des_xmlXPathObjectPtr(n_start, start, 0);
51473: des_xmlXPathObjectPtr(n_end, end, 1);
51474: xmlResetLastError();
51475: if (mem_base != xmlMemBlocks()) {
51476: printf("Leak of %d blocks found in xmlXPtrNewRangePoints",
51477: xmlMemBlocks() - mem_base);
51478: test_ret++;
51479: printf(" %d", n_start);
51480: printf(" %d", n_end);
51481: printf("\n");
51482: }
51483: }
51484: }
51485: function_tests++;
51486: #endif
51487:
51488: return(test_ret);
51489: }
51490:
51491:
51492: static int
51493: test_xmlXPtrRangeToFunction(void) {
51494: int test_ret = 0;
51495:
51496: #if defined(LIBXML_XPTR_ENABLED)
51497: int mem_base;
51498: xmlXPathParserContextPtr ctxt; /* the XPointer Parser context */
51499: int n_ctxt;
51500: int nargs; /* the number of args */
51501: int n_nargs;
51502:
51503: for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
51504: for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
51505: mem_base = xmlMemBlocks();
51506: ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
51507: nargs = gen_int(n_nargs, 1);
51508:
51509: xmlXPtrRangeToFunction(ctxt, nargs);
51510: call_tests++;
51511: des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
51512: des_int(n_nargs, nargs, 1);
51513: xmlResetLastError();
51514: if (mem_base != xmlMemBlocks()) {
51515: printf("Leak of %d blocks found in xmlXPtrRangeToFunction",
51516: xmlMemBlocks() - mem_base);
51517: test_ret++;
51518: printf(" %d", n_ctxt);
51519: printf(" %d", n_nargs);
51520: printf("\n");
51521: }
51522: }
51523: }
51524: function_tests++;
51525: #endif
51526:
51527: return(test_ret);
51528: }
51529:
51530:
51531: static int
51532: test_xmlXPtrWrapLocationSet(void) {
51533: int test_ret = 0;
51534:
51535: #if defined(LIBXML_XPTR_ENABLED)
51536: int mem_base;
51537: xmlXPathObjectPtr ret_val;
51538: xmlLocationSetPtr val; /* the LocationSet value */
51539: int n_val;
51540:
51541: for (n_val = 0;n_val < gen_nb_xmlLocationSetPtr;n_val++) {
51542: mem_base = xmlMemBlocks();
51543: val = gen_xmlLocationSetPtr(n_val, 0);
51544:
51545: ret_val = xmlXPtrWrapLocationSet(val);
51546: desret_xmlXPathObjectPtr(ret_val);
51547: call_tests++;
51548: des_xmlLocationSetPtr(n_val, val, 0);
51549: xmlResetLastError();
51550: if (mem_base != xmlMemBlocks()) {
51551: printf("Leak of %d blocks found in xmlXPtrWrapLocationSet",
51552: xmlMemBlocks() - mem_base);
51553: test_ret++;
51554: printf(" %d", n_val);
51555: printf("\n");
51556: }
51557: }
51558: function_tests++;
51559: #endif
51560:
51561: return(test_ret);
51562: }
51563:
51564: static int
51565: test_xpointer(void) {
51566: int test_ret = 0;
51567:
51568: if (quiet == 0) printf("Testing xpointer : 17 of 21 functions ...\n");
51569: test_ret += test_xmlXPtrBuildNodeList();
51570: test_ret += test_xmlXPtrEval();
51571: test_ret += test_xmlXPtrEvalRangePredicate();
51572: test_ret += test_xmlXPtrLocationSetAdd();
51573: test_ret += test_xmlXPtrLocationSetCreate();
51574: test_ret += test_xmlXPtrLocationSetDel();
51575: test_ret += test_xmlXPtrLocationSetMerge();
51576: test_ret += test_xmlXPtrLocationSetRemove();
51577: test_ret += test_xmlXPtrNewCollapsedRange();
51578: test_ret += test_xmlXPtrNewContext();
51579: test_ret += test_xmlXPtrNewLocationSetNodeSet();
51580: test_ret += test_xmlXPtrNewLocationSetNodes();
51581: test_ret += test_xmlXPtrNewRange();
51582: test_ret += test_xmlXPtrNewRangeNodeObject();
51583: test_ret += test_xmlXPtrNewRangeNodePoint();
51584: test_ret += test_xmlXPtrNewRangeNodes();
51585: test_ret += test_xmlXPtrNewRangePointNode();
51586: test_ret += test_xmlXPtrNewRangePoints();
51587: test_ret += test_xmlXPtrRangeToFunction();
51588: test_ret += test_xmlXPtrWrapLocationSet();
51589:
51590: if (test_ret != 0)
51591: printf("Module xpointer: %d errors\n", test_ret);
51592: return(test_ret);
51593: }
51594: static int
51595: test_module(const char *module) {
51596: if (!strcmp(module, "HTMLparser")) return(test_HTMLparser());
51597: if (!strcmp(module, "HTMLtree")) return(test_HTMLtree());
51598: if (!strcmp(module, "SAX2")) return(test_SAX2());
51599: if (!strcmp(module, "c14n")) return(test_c14n());
51600: if (!strcmp(module, "catalog")) return(test_catalog());
51601: if (!strcmp(module, "chvalid")) return(test_chvalid());
51602: if (!strcmp(module, "debugXML")) return(test_debugXML());
51603: if (!strcmp(module, "dict")) return(test_dict());
51604: if (!strcmp(module, "encoding")) return(test_encoding());
51605: if (!strcmp(module, "entities")) return(test_entities());
51606: if (!strcmp(module, "hash")) return(test_hash());
51607: if (!strcmp(module, "list")) return(test_list());
51608: if (!strcmp(module, "nanoftp")) return(test_nanoftp());
51609: if (!strcmp(module, "nanohttp")) return(test_nanohttp());
51610: if (!strcmp(module, "parser")) return(test_parser());
51611: if (!strcmp(module, "parserInternals")) return(test_parserInternals());
51612: if (!strcmp(module, "pattern")) return(test_pattern());
51613: if (!strcmp(module, "relaxng")) return(test_relaxng());
51614: if (!strcmp(module, "schemasInternals")) return(test_schemasInternals());
51615: if (!strcmp(module, "schematron")) return(test_schematron());
51616: if (!strcmp(module, "tree")) return(test_tree());
51617: if (!strcmp(module, "uri")) return(test_uri());
51618: if (!strcmp(module, "valid")) return(test_valid());
51619: if (!strcmp(module, "xinclude")) return(test_xinclude());
51620: if (!strcmp(module, "xmlIO")) return(test_xmlIO());
51621: if (!strcmp(module, "xmlautomata")) return(test_xmlautomata());
51622: if (!strcmp(module, "xmlerror")) return(test_xmlerror());
51623: if (!strcmp(module, "xmlmodule")) return(test_xmlmodule());
51624: if (!strcmp(module, "xmlreader")) return(test_xmlreader());
51625: if (!strcmp(module, "xmlregexp")) return(test_xmlregexp());
51626: if (!strcmp(module, "xmlsave")) return(test_xmlsave());
51627: if (!strcmp(module, "xmlschemas")) return(test_xmlschemas());
51628: if (!strcmp(module, "xmlschemastypes")) return(test_xmlschemastypes());
51629: if (!strcmp(module, "xmlstring")) return(test_xmlstring());
51630: if (!strcmp(module, "xmlunicode")) return(test_xmlunicode());
51631: if (!strcmp(module, "xmlwriter")) return(test_xmlwriter());
51632: if (!strcmp(module, "xpath")) return(test_xpath());
51633: if (!strcmp(module, "xpathInternals")) return(test_xpathInternals());
51634: if (!strcmp(module, "xpointer")) return(test_xpointer());
51635: return(0);
51636: }
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>