* daniel@veillard.com
*/
-#ifdef HAVE_CONFIG_H
#include "libxml.h"
-#else
#include <stdio.h>
-#endif
#include <stdlib.h> /* for putenv() */
#include <string.h>
#include <libxml/xmlerror.h>
#include <libxml/relaxng.h>
-#if defined(_WIN32) && !defined(__CYGWIN__) && !defined(__MINGW32__)
-#define snprintf _snprintf
-#endif
static int testlibxml2(void);
static int test_module(const char *module);
if ((api_root == NULL) || (api_root->type != XML_ELEMENT_NODE)) {
get_api_root();
}
- if (api_root == NULL)
+ if (api_root == NULL)
return(NULL);
if (api_root->properties != NULL) {
api_attr = api_root->properties;
int ret;
int blocks, mem;
+#ifdef HAVE_PUTENV
/* access to the proxy can slow up regression tests a lot */
putenv((char *) "http_proxy=");
+#endif
memset(chartab, 0, sizeof(chartab));
strncpy((char *) chartab, " chartab\n", 20);
#include <libxml/xpointer.h>
#include <libxml/debugXML.h>
-/*
+/*
We manually define xmlErrMemory because it's normal declaration
is "hidden" by #ifdef IN_LIBXML
*/
static xmlChar gen_xmlChar(int no, int nr ATTRIBUTE_UNUSED) {
if (no == 0) return('a');
if (no == 1) return(' ');
- if (no == 2) return((xmlChar) 'ø');
+ if (no == 2) return((xmlChar) '\xf8');
return(0);
}
static xmlChar *gen_const_xmlChar_ptr(int no, int nr ATTRIBUTE_UNUSED) {
if (no == 0) return((xmlChar *) "foo");
if (no == 1) return((xmlChar *) "<foo/>");
- if (no == 2) return((xmlChar *) "nøne");
+ if (no == 2) return((xmlChar *) "n" "\xf8" "ne");
if (no == 3) return((xmlChar *) " 2ab ");
return(NULL);
}
#define gen_nb_xmlDtdPtr 3
static xmlDtdPtr gen_xmlDtdPtr(int no, int nr ATTRIBUTE_UNUSED) {
- if (no == 0)
+ if (no == 0)
return(xmlNewDtd(NULL, BAD_CAST "dtd", BAD_CAST"foo", BAD_CAST"bar"));
if (no == 1) return(get_api_dtd());
return(NULL);
#endif /* LIBXML_SCHEMAS_ENABLED */
#define gen_nb_xmlHashDeallocator 2
-static void
+static void
test_xmlHashDeallocator(void *payload ATTRIBUTE_UNUSED, xmlChar *name ATTRIBUTE_UNUSED) {
}
#define gen_nb_xmlBufferAllocationScheme 4
static xmlBufferAllocationScheme gen_xmlBufferAllocationScheme(int no, int nr ATTRIBUTE_UNUSED) {
- if (no == 1) return(XML_BUFFER_ALLOC_DOUBLEIT);
- if (no == 2) return(XML_BUFFER_ALLOC_EXACT);
- if (no == 3) return(XML_BUFFER_ALLOC_HYBRID);
- if (no == 4) return(XML_BUFFER_ALLOC_IMMUTABLE);
+ if (no == 1) return(XML_BUFFER_ALLOC_BOUNDED);
+ if (no == 2) return(XML_BUFFER_ALLOC_DOUBLEIT);
+ if (no == 3) return(XML_BUFFER_ALLOC_EXACT);
+ if (no == 4) return(XML_BUFFER_ALLOC_HYBRID);
return(0);
}
test_xmlSAX2EndElement(void) {
int test_ret = 0;
-#if defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_DOCB_ENABLED)
+#if defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_DOCB_ENABLED) || defined(LIBXML_LEGACY_ENABLED)
#ifdef LIBXML_SAX1_ENABLED
int mem_base;
void * ctx; /* the user data (XML parser context) */
test_xmlSAX2StartElement(void) {
int test_ret = 0;
-#if defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_DOCB_ENABLED)
+#if defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_DOCB_ENABLED) || defined(LIBXML_LEGACY_ENABLED)
#ifdef LIBXML_SAX1_ENABLED
int mem_base;
void * ctx; /* the user data (XML parser context) */
int mem_base;
xmlDictPtr ret_val;
- xmlDictPtr sub; /* an existing dictionnary */
+ xmlDictPtr sub; /* an existing dictionary */
int n_sub;
for (n_sub = 0;n_sub < gen_nb_xmlDictPtr;n_sub++) {
int mem_base;
const xmlChar * ret_val;
- xmlDictPtr dict; /* the dictionnary */
+ xmlDictPtr dict; /* the dictionary */
int n_dict;
xmlChar * name; /* the name of the userdata */
int n_name;
static int
+test_xmlDictGetUsage(void) {
+ int test_ret = 0;
+
+
+ /* missing type support */
+ return(test_ret);
+}
+
+
+static int
test_xmlDictLookup(void) {
int test_ret = 0;
int mem_base;
const xmlChar * ret_val;
- xmlDictPtr dict; /* the dictionnary */
+ xmlDictPtr dict; /* the dictionary */
int n_dict;
xmlChar * name; /* the name of the userdata */
int n_name;
int mem_base;
int ret_val;
- xmlDictPtr dict; /* the dictionnary */
+ xmlDictPtr dict; /* the dictionary */
int n_dict;
xmlChar * str; /* the string */
int n_str;
int mem_base;
const xmlChar * ret_val;
- xmlDictPtr dict; /* the dictionnary */
+ xmlDictPtr dict; /* the dictionary */
int n_dict;
xmlChar * prefix; /* the prefix */
int n_prefix;
int mem_base;
int ret_val;
- xmlDictPtr dict; /* the dictionnary */
+ xmlDictPtr dict; /* the dictionary */
int n_dict;
for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
static int
+test_xmlDictSetLimit(void) {
+ int test_ret = 0;
+
+
+ /* missing type support */
+ return(test_ret);
+}
+
+
+static int
test_xmlDictSize(void) {
int test_ret = 0;
int mem_base;
int ret_val;
- xmlDictPtr dict; /* the dictionnary */
+ xmlDictPtr dict; /* the dictionary */
int n_dict;
for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
test_dict(void) {
int test_ret = 0;
- if (quiet == 0) printf("Testing dict : 10 of 11 functions ...\n");
+ if (quiet == 0) printf("Testing dict : 10 of 13 functions ...\n");
test_ret += test_xmlDictCleanup();
test_ret += test_xmlDictCreate();
test_ret += test_xmlDictCreateSub();
test_ret += test_xmlDictExists();
+ test_ret += test_xmlDictGetUsage();
test_ret += test_xmlDictLookup();
test_ret += test_xmlDictOwns();
test_ret += test_xmlDictQLookup();
test_ret += test_xmlDictReference();
+ test_ret += test_xmlDictSetLimit();
test_ret += test_xmlDictSize();
test_ret += test_xmlInitializeDict();
}
+#define gen_nb_const_xmlDoc_ptr 1
+static xmlDoc * gen_const_xmlDoc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+ return(NULL);
+}
+static void des_const_xmlDoc_ptr(int no ATTRIBUTE_UNUSED, const xmlDoc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+}
+
static int
test_xmlEncodeSpecialChars(void) {
int test_ret = 0;
int mem_base;
xmlChar * ret_val;
- xmlDocPtr doc; /* the document containing the string */
+ xmlDoc * doc; /* the document containing the string */
int n_doc;
xmlChar * input; /* A string to convert to XML. */
int n_input;
- for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
+ for (n_doc = 0;n_doc < gen_nb_const_xmlDoc_ptr;n_doc++) {
for (n_input = 0;n_input < gen_nb_const_xmlChar_ptr;n_input++) {
mem_base = xmlMemBlocks();
- doc = gen_xmlDocPtr(n_doc, 0);
+ doc = gen_const_xmlDoc_ptr(n_doc, 0);
input = gen_const_xmlChar_ptr(n_input, 1);
- ret_val = xmlEncodeSpecialChars(doc, (const xmlChar *)input);
+ ret_val = xmlEncodeSpecialChars((const xmlDoc *)doc, (const xmlChar *)input);
desret_xmlChar_ptr(ret_val);
call_tests++;
- des_xmlDocPtr(n_doc, doc, 0);
+ des_const_xmlDoc_ptr(n_doc, (const xmlDoc *)doc, 0);
des_const_xmlChar_ptr(n_input, (const xmlChar *)input, 1);
xmlResetLastError();
if (mem_base != xmlMemBlocks()) {
int mem_base;
xmlEntityPtr ret_val;
- xmlDocPtr doc; /* the document referencing the entity */
+ xmlDoc * doc; /* the document referencing the entity */
int n_doc;
xmlChar * name; /* the entity name */
int n_name;
- for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
+ for (n_doc = 0;n_doc < gen_nb_const_xmlDoc_ptr;n_doc++) {
for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
mem_base = xmlMemBlocks();
- doc = gen_xmlDocPtr(n_doc, 0);
+ doc = gen_const_xmlDoc_ptr(n_doc, 0);
name = gen_const_xmlChar_ptr(n_name, 1);
- ret_val = xmlGetDocEntity(doc, (const xmlChar *)name);
+ ret_val = xmlGetDocEntity((const xmlDoc *)doc, (const xmlChar *)name);
desret_xmlEntityPtr(ret_val);
call_tests++;
- des_xmlDocPtr(n_doc, doc, 0);
+ des_const_xmlDoc_ptr(n_doc, (const xmlDoc *)doc, 0);
des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
xmlResetLastError();
if (mem_base != xmlMemBlocks()) {
int n_ctxt;
xmlChar * data; /* some character data read */
int n_data;
- int len; /* the lenght of the data */
+ int len; /* the length of the data */
int n_len;
for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
test_xmlAddPrevSibling(void) {
int test_ret = 0;
-#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
+#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED)
int mem_base;
xmlNodePtr ret_val;
xmlNodePtr cur; /* the child node */
}
+#define gen_nb_const_xmlBuf_ptr 1
+static xmlBuf * gen_const_xmlBuf_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+ return(NULL);
+}
+static void des_const_xmlBuf_ptr(int no ATTRIBUTE_UNUSED, const xmlBuf * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+}
+
+static int
+test_xmlBufContent(void) {
+ int test_ret = 0;
+
+ int mem_base;
+ xmlChar * ret_val;
+ xmlBuf * buf; /* the buffer */
+ int n_buf;
+
+ for (n_buf = 0;n_buf < gen_nb_const_xmlBuf_ptr;n_buf++) {
+ mem_base = xmlMemBlocks();
+ buf = gen_const_xmlBuf_ptr(n_buf, 0);
+
+ ret_val = xmlBufContent((const xmlBuf *)buf);
+ desret_xmlChar_ptr(ret_val);
+ call_tests++;
+ des_const_xmlBuf_ptr(n_buf, (const xmlBuf *)buf, 0);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in xmlBufContent",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_buf);
+ printf("\n");
+ }
+ }
+ function_tests++;
+
+ return(test_ret);
+}
+
+
+#define gen_nb_xmlBufPtr 1
+static xmlBufPtr gen_xmlBufPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+ return(NULL);
+}
+static void des_xmlBufPtr(int no ATTRIBUTE_UNUSED, xmlBufPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+}
+
+static int
+test_xmlBufEnd(void) {
+ int test_ret = 0;
+
+ int mem_base;
+ xmlChar * ret_val;
+ xmlBufPtr buf; /* the buffer */
+ int n_buf;
+
+ for (n_buf = 0;n_buf < gen_nb_xmlBufPtr;n_buf++) {
+ mem_base = xmlMemBlocks();
+ buf = gen_xmlBufPtr(n_buf, 0);
+
+ ret_val = xmlBufEnd(buf);
+ desret_xmlChar_ptr(ret_val);
+ call_tests++;
+ des_xmlBufPtr(n_buf, buf, 0);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in xmlBufEnd",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_buf);
+ printf("\n");
+ }
+ }
+ function_tests++;
+
+ return(test_ret);
+}
+
+
+#define gen_nb_const_xmlNode_ptr 1
+static xmlNode * gen_const_xmlNode_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+ return(NULL);
+}
+static void des_const_xmlNode_ptr(int no ATTRIBUTE_UNUSED, const xmlNode * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+}
+
+static int
+test_xmlBufGetNodeContent(void) {
+ int test_ret = 0;
+
+ int mem_base;
+ int ret_val;
+ xmlBufPtr buf; /* a buffer xmlBufPtr */
+ int n_buf;
+ xmlNode * cur; /* the node being read */
+ int n_cur;
+
+ for (n_buf = 0;n_buf < gen_nb_xmlBufPtr;n_buf++) {
+ for (n_cur = 0;n_cur < gen_nb_const_xmlNode_ptr;n_cur++) {
+ mem_base = xmlMemBlocks();
+ buf = gen_xmlBufPtr(n_buf, 0);
+ cur = gen_const_xmlNode_ptr(n_cur, 1);
+
+ ret_val = xmlBufGetNodeContent(buf, (const xmlNode *)cur);
+ desret_int(ret_val);
+ call_tests++;
+ des_xmlBufPtr(n_buf, buf, 0);
+ des_const_xmlNode_ptr(n_cur, (const xmlNode *)cur, 1);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in xmlBufGetNodeContent",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_buf);
+ printf(" %d", n_cur);
+ printf("\n");
+ }
+ }
+ }
+ function_tests++;
+
+ return(test_ret);
+}
+
+
+static int
+test_xmlBufNodeDump(void) {
+ int test_ret = 0;
+
+
+ /* missing type support */
+ return(test_ret);
+}
+
+
+static int
+test_xmlBufShrink(void) {
+ int test_ret = 0;
+
+
+ /* missing type support */
+ return(test_ret);
+}
+
+
+#define gen_nb_const_xmlBufPtr 1
+static xmlBufPtr gen_const_xmlBufPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+ return(NULL);
+}
+static void des_const_xmlBufPtr(int no ATTRIBUTE_UNUSED, const xmlBufPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+}
+
+static int
+test_xmlBufUse(void) {
+ int test_ret = 0;
+
+
+ /* missing type support */
+ return(test_ret);
+}
+
+
static int
test_xmlBufferAdd(void) {
int test_ret = 0;
}
-#define gen_nb_const_xmlBufferPtr 1
-static xmlBufferPtr gen_const_xmlBufferPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+#define gen_nb_const_xmlBuffer_ptr 1
+static xmlBuffer * gen_const_xmlBuffer_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
return(NULL);
}
-static void des_const_xmlBufferPtr(int no ATTRIBUTE_UNUSED, const xmlBufferPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+static void des_const_xmlBuffer_ptr(int no ATTRIBUTE_UNUSED, const xmlBuffer * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
}
static int
int mem_base;
const xmlChar * ret_val;
- xmlBufferPtr buf; /* the buffer */
+ xmlBuffer * buf; /* the buffer */
int n_buf;
- for (n_buf = 0;n_buf < gen_nb_const_xmlBufferPtr;n_buf++) {
+ for (n_buf = 0;n_buf < gen_nb_const_xmlBuffer_ptr;n_buf++) {
mem_base = xmlMemBlocks();
- buf = gen_const_xmlBufferPtr(n_buf, 0);
+ buf = gen_const_xmlBuffer_ptr(n_buf, 0);
- ret_val = xmlBufferContent((const xmlBufferPtr)buf);
+ ret_val = xmlBufferContent((const xmlBuffer *)buf);
desret_const_xmlChar_ptr(ret_val);
call_tests++;
- des_const_xmlBufferPtr(n_buf, (const xmlBufferPtr)buf, 0);
+ des_const_xmlBuffer_ptr(n_buf, (const xmlBuffer *)buf, 0);
xmlResetLastError();
if (mem_base != xmlMemBlocks()) {
printf("Leak of %d blocks found in xmlBufferContent",
int mem_base;
int ret_val;
- xmlBufferPtr buf; /* the buffer */
+ xmlBuffer * buf; /* the buffer */
int n_buf;
- for (n_buf = 0;n_buf < gen_nb_const_xmlBufferPtr;n_buf++) {
+ for (n_buf = 0;n_buf < gen_nb_const_xmlBuffer_ptr;n_buf++) {
mem_base = xmlMemBlocks();
- buf = gen_const_xmlBufferPtr(n_buf, 0);
+ buf = gen_const_xmlBuffer_ptr(n_buf, 0);
- ret_val = xmlBufferLength((const xmlBufferPtr)buf);
+ ret_val = xmlBufferLength((const xmlBuffer *)buf);
desret_int(ret_val);
call_tests++;
- des_const_xmlBufferPtr(n_buf, (const xmlBufferPtr)buf, 0);
+ des_const_xmlBuffer_ptr(n_buf, (const xmlBuffer *)buf, 0);
xmlResetLastError();
if (mem_base != xmlMemBlocks()) {
printf("Leak of %d blocks found in xmlBufferLength",
int extended; /* if 1 do a recursive copy (properties, namespaces and children when applicable) if 2 copy properties and namespaces (when applicable) */
int n_extended;
- for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
+ for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
for (n_extended = 0;n_extended < gen_nb_int;n_extended++) {
mem_base = xmlMemBlocks();
- node = gen_const_xmlNodePtr(n_node, 0);
+ node = gen_xmlNodePtr(n_node, 0);
extended = gen_int(n_extended, 1);
- ret_val = xmlCopyNode((const xmlNodePtr)node, extended);
+ ret_val = xmlCopyNode(node, extended);
desret_xmlNodePtr(ret_val);
call_tests++;
- des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 0);
+ des_xmlNodePtr(n_node, node, 0);
des_int(n_extended, extended, 1);
xmlResetLastError();
if (mem_base != xmlMemBlocks()) {
xmlNodePtr node; /* the first node in the list. */
int n_node;
- for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
+ for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
mem_base = xmlMemBlocks();
- node = gen_const_xmlNodePtr(n_node, 0);
+ node = gen_xmlNodePtr(n_node, 0);
- ret_val = xmlCopyNodeList((const xmlNodePtr)node);
+ ret_val = xmlCopyNodeList(node);
desret_xmlNodePtr(ret_val);
call_tests++;
- des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 0);
+ des_xmlNodePtr(n_node, node, 0);
xmlResetLastError();
if (mem_base != xmlMemBlocks()) {
printf("Leak of %d blocks found in xmlCopyNodeList",
int extended; /* if 1 do a recursive copy (properties, namespaces and children when applicable) if 2 copy properties and namespaces (when applicable) */
int n_extended;
- for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
+ for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
for (n_extended = 0;n_extended < gen_nb_int;n_extended++) {
mem_base = xmlMemBlocks();
- node = gen_const_xmlNodePtr(n_node, 0);
+ node = gen_xmlNodePtr(n_node, 0);
doc = gen_xmlDocPtr(n_doc, 1);
extended = gen_int(n_extended, 2);
- ret_val = xmlDocCopyNode((const xmlNodePtr)node, doc, extended);
+ ret_val = xmlDocCopyNode(node, doc, extended);
desret_xmlNodePtr(ret_val);
call_tests++;
- des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 0);
+ des_xmlNodePtr(n_node, node, 0);
des_xmlDocPtr(n_doc, doc, 1);
des_int(n_extended, extended, 2);
xmlResetLastError();
int n_node;
for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
- for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
+ for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
mem_base = xmlMemBlocks();
doc = gen_xmlDocPtr(n_doc, 0);
- node = gen_const_xmlNodePtr(n_node, 1);
+ node = gen_xmlNodePtr(n_node, 1);
- ret_val = xmlDocCopyNodeList(doc, (const xmlNodePtr)node);
+ ret_val = xmlDocCopyNodeList(doc, node);
desret_xmlNodePtr(ret_val);
call_tests++;
des_xmlDocPtr(n_doc, doc, 0);
- des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 1);
+ des_xmlNodePtr(n_node, node, 1);
xmlResetLastError();
if (mem_base != xmlMemBlocks()) {
printf("Leak of %d blocks found in xmlDocCopyNodeList",
int mem_base;
xmlNodePtr ret_val;
- xmlDocPtr doc; /* the document */
+ xmlDoc * doc; /* the document */
int n_doc;
- for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
+ for (n_doc = 0;n_doc < gen_nb_const_xmlDoc_ptr;n_doc++) {
mem_base = xmlMemBlocks();
- doc = gen_xmlDocPtr(n_doc, 0);
+ doc = gen_const_xmlDoc_ptr(n_doc, 0);
- ret_val = xmlDocGetRootElement(doc);
+ ret_val = xmlDocGetRootElement((const xmlDoc *)doc);
desret_xmlNodePtr(ret_val);
call_tests++;
- des_xmlDocPtr(n_doc, doc, 0);
+ des_const_xmlDoc_ptr(n_doc, (const xmlDoc *)doc, 0);
xmlResetLastError();
if (mem_base != xmlMemBlocks()) {
printf("Leak of %d blocks found in xmlDocGetRootElement",
int mem_base;
int ret_val;
- xmlDocPtr doc; /* the document */
+ xmlDoc * doc; /* the document */
int n_doc;
- for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
+ for (n_doc = 0;n_doc < gen_nb_const_xmlDoc_ptr;n_doc++) {
mem_base = xmlMemBlocks();
- doc = gen_xmlDocPtr(n_doc, 0);
+ doc = gen_const_xmlDoc_ptr(n_doc, 0);
- ret_val = xmlGetDocCompressMode(doc);
+ ret_val = xmlGetDocCompressMode((const xmlDoc *)doc);
desret_int(ret_val);
call_tests++;
- des_xmlDocPtr(n_doc, doc, 0);
+ des_const_xmlDoc_ptr(n_doc, (const xmlDoc *)doc, 0);
xmlResetLastError();
if (mem_base != xmlMemBlocks()) {
printf("Leak of %d blocks found in xmlGetDocCompressMode",
int mem_base;
xmlDtdPtr ret_val;
- xmlDocPtr doc; /* the document pointer */
+ xmlDoc * doc; /* the document pointer */
int n_doc;
- for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
+ for (n_doc = 0;n_doc < gen_nb_const_xmlDoc_ptr;n_doc++) {
mem_base = xmlMemBlocks();
- doc = gen_xmlDocPtr(n_doc, 0);
+ doc = gen_const_xmlDoc_ptr(n_doc, 0);
- ret_val = xmlGetIntSubset(doc);
+ ret_val = xmlGetIntSubset((const xmlDoc *)doc);
desret_xmlDtdPtr(ret_val);
call_tests++;
- des_xmlDocPtr(n_doc, doc, 0);
+ des_const_xmlDoc_ptr(n_doc, (const xmlDoc *)doc, 0);
xmlResetLastError();
if (mem_base != xmlMemBlocks()) {
printf("Leak of %d blocks found in xmlGetIntSubset",
int mem_base;
xmlNodePtr ret_val;
- xmlNodePtr parent; /* the parent node */
+ xmlNode * parent; /* the parent node */
int n_parent;
- for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
+ for (n_parent = 0;n_parent < gen_nb_const_xmlNode_ptr;n_parent++) {
mem_base = xmlMemBlocks();
- parent = gen_xmlNodePtr(n_parent, 0);
+ parent = gen_const_xmlNode_ptr(n_parent, 0);
- ret_val = xmlGetLastChild(parent);
+ ret_val = xmlGetLastChild((const xmlNode *)parent);
desret_xmlNodePtr(ret_val);
call_tests++;
- des_xmlNodePtr(n_parent, parent, 0);
+ des_const_xmlNode_ptr(n_parent, (const xmlNode *)parent, 0);
xmlResetLastError();
if (mem_base != xmlMemBlocks()) {
printf("Leak of %d blocks found in xmlGetLastChild",
int mem_base;
long ret_val;
- xmlNodePtr node; /* valid node */
+ xmlNode * node; /* valid node */
int n_node;
- for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
+ for (n_node = 0;n_node < gen_nb_const_xmlNode_ptr;n_node++) {
mem_base = xmlMemBlocks();
- node = gen_xmlNodePtr(n_node, 0);
+ node = gen_const_xmlNode_ptr(n_node, 0);
- ret_val = xmlGetLineNo(node);
+ ret_val = xmlGetLineNo((const xmlNode *)node);
desret_long(ret_val);
call_tests++;
- des_xmlNodePtr(n_node, node, 0);
+ des_const_xmlNode_ptr(n_node, (const xmlNode *)node, 0);
xmlResetLastError();
if (mem_base != xmlMemBlocks()) {
printf("Leak of %d blocks found in xmlGetLineNo",
int mem_base;
xmlChar * ret_val;
- xmlNodePtr node; /* the node */
+ xmlNode * node; /* the node */
int n_node;
xmlChar * name; /* the attribute name */
int n_name;
- for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
+ for (n_node = 0;n_node < gen_nb_const_xmlNode_ptr;n_node++) {
for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
mem_base = xmlMemBlocks();
- node = gen_xmlNodePtr(n_node, 0);
+ node = gen_const_xmlNode_ptr(n_node, 0);
name = gen_const_xmlChar_ptr(n_name, 1);
- ret_val = xmlGetNoNsProp(node, (const xmlChar *)name);
+ ret_val = xmlGetNoNsProp((const xmlNode *)node, (const xmlChar *)name);
desret_xmlChar_ptr(ret_val);
call_tests++;
- des_xmlNodePtr(n_node, node, 0);
+ des_const_xmlNode_ptr(n_node, (const xmlNode *)node, 0);
des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
xmlResetLastError();
if (mem_base != xmlMemBlocks()) {
#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_DEBUG_ENABLED)
int mem_base;
xmlChar * ret_val;
- xmlNodePtr node; /* a node */
+ xmlNode * node; /* a node */
int n_node;
- for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
+ for (n_node = 0;n_node < gen_nb_const_xmlNode_ptr;n_node++) {
mem_base = xmlMemBlocks();
- node = gen_xmlNodePtr(n_node, 0);
+ node = gen_const_xmlNode_ptr(n_node, 0);
- ret_val = xmlGetNodePath(node);
+ ret_val = xmlGetNodePath((const xmlNode *)node);
desret_xmlChar_ptr(ret_val);
call_tests++;
- des_xmlNodePtr(n_node, node, 0);
+ des_const_xmlNode_ptr(n_node, (const xmlNode *)node, 0);
xmlResetLastError();
if (mem_base != xmlMemBlocks()) {
printf("Leak of %d blocks found in xmlGetNodePath",
int mem_base;
xmlChar * ret_val;
- xmlNodePtr node; /* the node */
+ xmlNode * node; /* the node */
int n_node;
xmlChar * name; /* the attribute name */
int n_name;
xmlChar * nameSpace; /* the URI of the namespace */
int n_nameSpace;
- for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
+ for (n_node = 0;n_node < gen_nb_const_xmlNode_ptr;n_node++) {
for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
for (n_nameSpace = 0;n_nameSpace < gen_nb_const_xmlChar_ptr;n_nameSpace++) {
mem_base = xmlMemBlocks();
- node = gen_xmlNodePtr(n_node, 0);
+ node = gen_const_xmlNode_ptr(n_node, 0);
name = gen_const_xmlChar_ptr(n_name, 1);
nameSpace = gen_const_xmlChar_ptr(n_nameSpace, 2);
- ret_val = xmlGetNsProp(node, (const xmlChar *)name, (const xmlChar *)nameSpace);
+ ret_val = xmlGetNsProp((const xmlNode *)node, (const xmlChar *)name, (const xmlChar *)nameSpace);
desret_xmlChar_ptr(ret_val);
call_tests++;
- des_xmlNodePtr(n_node, node, 0);
+ des_const_xmlNode_ptr(n_node, (const xmlNode *)node, 0);
des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
des_const_xmlChar_ptr(n_nameSpace, (const xmlChar *)nameSpace, 2);
xmlResetLastError();
int mem_base;
xmlChar * ret_val;
- xmlNodePtr node; /* the node */
+ xmlNode * node; /* the node */
int n_node;
xmlChar * name; /* the attribute name */
int n_name;
- for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
+ for (n_node = 0;n_node < gen_nb_const_xmlNode_ptr;n_node++) {
for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
mem_base = xmlMemBlocks();
- node = gen_xmlNodePtr(n_node, 0);
+ node = gen_const_xmlNode_ptr(n_node, 0);
name = gen_const_xmlChar_ptr(n_name, 1);
- ret_val = xmlGetProp(node, (const xmlChar *)name);
+ ret_val = xmlGetProp((const xmlNode *)node, (const xmlChar *)name);
desret_xmlChar_ptr(ret_val);
call_tests++;
- des_xmlNodePtr(n_node, node, 0);
+ des_const_xmlNode_ptr(n_node, (const xmlNode *)node, 0);
des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
xmlResetLastError();
if (mem_base != xmlMemBlocks()) {
int mem_base;
xmlAttrPtr ret_val;
- xmlNodePtr node; /* the node */
+ xmlNode * node; /* the node */
int n_node;
xmlChar * name; /* the attribute name */
int n_name;
xmlChar * nameSpace; /* the URI of the namespace */
int n_nameSpace;
- for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
+ for (n_node = 0;n_node < gen_nb_const_xmlNode_ptr;n_node++) {
for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
for (n_nameSpace = 0;n_nameSpace < gen_nb_const_xmlChar_ptr;n_nameSpace++) {
mem_base = xmlMemBlocks();
- node = gen_xmlNodePtr(n_node, 0);
+ node = gen_const_xmlNode_ptr(n_node, 0);
name = gen_const_xmlChar_ptr(n_name, 1);
nameSpace = gen_const_xmlChar_ptr(n_nameSpace, 2);
- ret_val = xmlHasNsProp(node, (const xmlChar *)name, (const xmlChar *)nameSpace);
+ ret_val = xmlHasNsProp((const xmlNode *)node, (const xmlChar *)name, (const xmlChar *)nameSpace);
desret_xmlAttrPtr(ret_val);
call_tests++;
- des_xmlNodePtr(n_node, node, 0);
+ des_const_xmlNode_ptr(n_node, (const xmlNode *)node, 0);
des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
des_const_xmlChar_ptr(n_nameSpace, (const xmlChar *)nameSpace, 2);
xmlResetLastError();
int mem_base;
xmlAttrPtr ret_val;
- xmlNodePtr node; /* the node */
+ xmlNode * node; /* the node */
int n_node;
xmlChar * name; /* the attribute name */
int n_name;
- for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
+ for (n_node = 0;n_node < gen_nb_const_xmlNode_ptr;n_node++) {
for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
mem_base = xmlMemBlocks();
- node = gen_xmlNodePtr(n_node, 0);
+ node = gen_const_xmlNode_ptr(n_node, 0);
name = gen_const_xmlChar_ptr(n_name, 1);
- ret_val = xmlHasProp(node, (const xmlChar *)name);
+ ret_val = xmlHasProp((const xmlNode *)node, (const xmlChar *)name);
desret_xmlAttrPtr(ret_val);
call_tests++;
- des_xmlNodePtr(n_node, node, 0);
+ des_const_xmlNode_ptr(n_node, (const xmlNode *)node, 0);
des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
xmlResetLastError();
if (mem_base != xmlMemBlocks()) {
int mem_base;
int ret_val;
- xmlNodePtr node; /* the node */
+ xmlNode * node; /* the node */
int n_node;
- for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
+ for (n_node = 0;n_node < gen_nb_const_xmlNode_ptr;n_node++) {
mem_base = xmlMemBlocks();
- node = gen_xmlNodePtr(n_node, 0);
+ node = gen_const_xmlNode_ptr(n_node, 0);
- ret_val = xmlIsBlankNode(node);
+ ret_val = xmlIsBlankNode((const xmlNode *)node);
desret_int(ret_val);
call_tests++;
- des_xmlNodePtr(n_node, node, 0);
+ des_const_xmlNode_ptr(n_node, (const xmlNode *)node, 0);
xmlResetLastError();
if (mem_base != xmlMemBlocks()) {
printf("Leak of %d blocks found in xmlIsBlankNode",
int mem_base;
xmlNodePtr ret_val;
- xmlDocPtr doc; /* the document */
+ xmlDoc * doc; /* the document */
int n_doc;
xmlChar * content; /* the text content */
int n_content;
- for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
+ for (n_doc = 0;n_doc < gen_nb_const_xmlDoc_ptr;n_doc++) {
for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
mem_base = xmlMemBlocks();
- doc = gen_xmlDocPtr(n_doc, 0);
+ doc = gen_const_xmlDoc_ptr(n_doc, 0);
content = gen_const_xmlChar_ptr(n_content, 1);
- ret_val = xmlNewDocText(doc, (const xmlChar *)content);
+ ret_val = xmlNewDocText((const xmlDoc *)doc, (const xmlChar *)content);
desret_xmlNodePtr(ret_val);
call_tests++;
- des_xmlDocPtr(n_doc, doc, 0);
+ des_const_xmlDoc_ptr(n_doc, (const xmlDoc *)doc, 0);
des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
xmlResetLastError();
if (mem_base != xmlMemBlocks()) {
int mem_base;
xmlNodePtr ret_val;
- xmlDocPtr doc; /* the document */
+ xmlDoc * doc; /* the document */
int n_doc;
xmlChar * name; /* the reference name, or the reference string with & and ; */
int n_name;
- for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
+ for (n_doc = 0;n_doc < gen_nb_const_xmlDoc_ptr;n_doc++) {
for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
mem_base = xmlMemBlocks();
- doc = gen_xmlDocPtr(n_doc, 0);
+ doc = gen_const_xmlDoc_ptr(n_doc, 0);
name = gen_const_xmlChar_ptr(n_name, 1);
- ret_val = xmlNewReference(doc, (const xmlChar *)name);
+ ret_val = xmlNewReference((const xmlDoc *)doc, (const xmlChar *)name);
desret_xmlNodePtr(ret_val);
call_tests++;
- des_xmlDocPtr(n_doc, doc, 0);
+ des_const_xmlDoc_ptr(n_doc, (const xmlDoc *)doc, 0);
des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
xmlResetLastError();
if (mem_base != xmlMemBlocks()) {
int ret_val;
xmlBufferPtr buffer; /* a buffer */
int n_buffer;
- xmlNodePtr cur; /* the node being read */
+ xmlNode * cur; /* the node being read */
int n_cur;
for (n_buffer = 0;n_buffer < gen_nb_xmlBufferPtr;n_buffer++) {
- for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
+ for (n_cur = 0;n_cur < gen_nb_const_xmlNode_ptr;n_cur++) {
mem_base = xmlMemBlocks();
buffer = gen_xmlBufferPtr(n_buffer, 0);
- cur = gen_xmlNodePtr(n_cur, 1);
+ cur = gen_const_xmlNode_ptr(n_cur, 1);
- ret_val = xmlNodeBufGetContent(buffer, cur);
+ ret_val = xmlNodeBufGetContent(buffer, (const xmlNode *)cur);
desret_int(ret_val);
call_tests++;
des_xmlBufferPtr(n_buffer, buffer, 0);
- des_xmlNodePtr(n_cur, cur, 1);
+ des_const_xmlNode_ptr(n_cur, (const xmlNode *)cur, 1);
xmlResetLastError();
if (mem_base != xmlMemBlocks()) {
printf("Leak of %d blocks found in xmlNodeBufGetContent",
int mem_base;
xmlChar * ret_val;
- xmlDocPtr doc; /* the document the node pertains to */
+ xmlDoc * doc; /* the document the node pertains to */
int n_doc;
- xmlNodePtr cur; /* the node being checked */
+ xmlNode * cur; /* the node being checked */
int n_cur;
- for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
- for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
+ for (n_doc = 0;n_doc < gen_nb_const_xmlDoc_ptr;n_doc++) {
+ for (n_cur = 0;n_cur < gen_nb_const_xmlNode_ptr;n_cur++) {
mem_base = xmlMemBlocks();
- doc = gen_xmlDocPtr(n_doc, 0);
- cur = gen_xmlNodePtr(n_cur, 1);
+ doc = gen_const_xmlDoc_ptr(n_doc, 0);
+ cur = gen_const_xmlNode_ptr(n_cur, 1);
- ret_val = xmlNodeGetBase(doc, cur);
+ ret_val = xmlNodeGetBase((const xmlDoc *)doc, (const xmlNode *)cur);
desret_xmlChar_ptr(ret_val);
call_tests++;
- des_xmlDocPtr(n_doc, doc, 0);
- des_xmlNodePtr(n_cur, cur, 1);
+ des_const_xmlDoc_ptr(n_doc, (const xmlDoc *)doc, 0);
+ des_const_xmlNode_ptr(n_cur, (const xmlNode *)cur, 1);
xmlResetLastError();
if (mem_base != xmlMemBlocks()) {
printf("Leak of %d blocks found in xmlNodeGetBase",
int mem_base;
xmlChar * ret_val;
- xmlNodePtr cur; /* the node being read */
+ xmlNode * cur; /* the node being read */
int n_cur;
- for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
+ for (n_cur = 0;n_cur < gen_nb_const_xmlNode_ptr;n_cur++) {
mem_base = xmlMemBlocks();
- cur = gen_xmlNodePtr(n_cur, 0);
+ cur = gen_const_xmlNode_ptr(n_cur, 0);
- ret_val = xmlNodeGetContent(cur);
+ ret_val = xmlNodeGetContent((const xmlNode *)cur);
desret_xmlChar_ptr(ret_val);
call_tests++;
- des_xmlNodePtr(n_cur, cur, 0);
+ des_const_xmlNode_ptr(n_cur, (const xmlNode *)cur, 0);
xmlResetLastError();
if (mem_base != xmlMemBlocks()) {
printf("Leak of %d blocks found in xmlNodeGetContent",
int mem_base;
xmlChar * ret_val;
- xmlNodePtr cur; /* the node being checked */
+ xmlNode * cur; /* the node being checked */
int n_cur;
- for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
+ for (n_cur = 0;n_cur < gen_nb_const_xmlNode_ptr;n_cur++) {
mem_base = xmlMemBlocks();
- cur = gen_xmlNodePtr(n_cur, 0);
+ cur = gen_const_xmlNode_ptr(n_cur, 0);
- ret_val = xmlNodeGetLang(cur);
+ ret_val = xmlNodeGetLang((const xmlNode *)cur);
desret_xmlChar_ptr(ret_val);
call_tests++;
- des_xmlNodePtr(n_cur, cur, 0);
+ des_const_xmlNode_ptr(n_cur, (const xmlNode *)cur, 0);
xmlResetLastError();
if (mem_base != xmlMemBlocks()) {
printf("Leak of %d blocks found in xmlNodeGetLang",
int mem_base;
int ret_val;
- xmlNodePtr cur; /* the node being checked */
+ xmlNode * cur; /* the node being checked */
int n_cur;
- for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
+ for (n_cur = 0;n_cur < gen_nb_const_xmlNode_ptr;n_cur++) {
mem_base = xmlMemBlocks();
- cur = gen_xmlNodePtr(n_cur, 0);
+ cur = gen_const_xmlNode_ptr(n_cur, 0);
- ret_val = xmlNodeGetSpacePreserve(cur);
+ ret_val = xmlNodeGetSpacePreserve((const xmlNode *)cur);
desret_int(ret_val);
call_tests++;
- des_xmlNodePtr(n_cur, cur, 0);
+ des_const_xmlNode_ptr(n_cur, (const xmlNode *)cur, 0);
xmlResetLastError();
if (mem_base != xmlMemBlocks()) {
printf("Leak of %d blocks found in xmlNodeGetSpacePreserve",
int mem_base;
int ret_val;
- xmlNodePtr node; /* the node */
+ xmlNode * node; /* the node */
int n_node;
- for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
+ for (n_node = 0;n_node < gen_nb_const_xmlNode_ptr;n_node++) {
mem_base = xmlMemBlocks();
- node = gen_xmlNodePtr(n_node, 0);
+ node = gen_const_xmlNode_ptr(n_node, 0);
- ret_val = xmlNodeIsText(node);
+ ret_val = xmlNodeIsText((const xmlNode *)node);
desret_int(ret_val);
call_tests++;
- des_xmlNodePtr(n_node, node, 0);
+ des_const_xmlNode_ptr(n_node, (const xmlNode *)node, 0);
xmlResetLastError();
if (mem_base != xmlMemBlocks()) {
printf("Leak of %d blocks found in xmlNodeIsText",
#if defined(LIBXML_TREE_ENABLED)
int mem_base;
xmlChar * ret_val;
- xmlDocPtr doc; /* the document */
+ xmlDoc * doc; /* the document */
int n_doc;
- xmlNodePtr list; /* a Node list */
+ xmlNode * list; /* a Node list */
int n_list;
int inLine; /* should we replace entity contents or show their external form */
int n_inLine;
- for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
- for (n_list = 0;n_list < gen_nb_xmlNodePtr;n_list++) {
+ for (n_doc = 0;n_doc < gen_nb_const_xmlDoc_ptr;n_doc++) {
+ for (n_list = 0;n_list < gen_nb_const_xmlNode_ptr;n_list++) {
for (n_inLine = 0;n_inLine < gen_nb_int;n_inLine++) {
mem_base = xmlMemBlocks();
- doc = gen_xmlDocPtr(n_doc, 0);
- list = gen_xmlNodePtr(n_list, 1);
+ doc = gen_const_xmlDoc_ptr(n_doc, 0);
+ list = gen_const_xmlNode_ptr(n_list, 1);
inLine = gen_int(n_inLine, 2);
- ret_val = xmlNodeListGetRawString(doc, list, inLine);
+ ret_val = xmlNodeListGetRawString((const xmlDoc *)doc, (const xmlNode *)list, inLine);
desret_xmlChar_ptr(ret_val);
call_tests++;
- des_xmlDocPtr(n_doc, doc, 0);
- des_xmlNodePtr(n_list, list, 1);
+ des_const_xmlDoc_ptr(n_doc, (const xmlDoc *)doc, 0);
+ des_const_xmlNode_ptr(n_list, (const xmlNode *)list, 1);
des_int(n_inLine, inLine, 2);
xmlResetLastError();
if (mem_base != xmlMemBlocks()) {
xmlChar * ret_val;
xmlDocPtr doc; /* the document */
int n_doc;
- xmlNodePtr list; /* a Node list */
+ xmlNode * list; /* a Node list */
int n_list;
int inLine; /* should we replace entity contents or show their external form */
int n_inLine;
for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
- for (n_list = 0;n_list < gen_nb_xmlNodePtr;n_list++) {
+ for (n_list = 0;n_list < gen_nb_const_xmlNode_ptr;n_list++) {
for (n_inLine = 0;n_inLine < gen_nb_int;n_inLine++) {
mem_base = xmlMemBlocks();
doc = gen_xmlDocPtr(n_doc, 0);
- list = gen_xmlNodePtr(n_list, 1);
+ list = gen_const_xmlNode_ptr(n_list, 1);
inLine = gen_int(n_inLine, 2);
- ret_val = xmlNodeListGetString(doc, list, inLine);
+ ret_val = xmlNodeListGetString(doc, (const xmlNode *)list, inLine);
desret_xmlChar_ptr(ret_val);
call_tests++;
des_xmlDocPtr(n_doc, doc, 0);
- des_xmlNodePtr(n_list, list, 1);
+ des_const_xmlNode_ptr(n_list, (const xmlNode *)list, 1);
des_int(n_inLine, inLine, 2);
xmlResetLastError();
if (mem_base != xmlMemBlocks()) {
int mem_base;
xmlNodePtr ret_val;
- xmlDocPtr doc; /* the document */
+ xmlDoc * doc; /* the document */
int n_doc;
xmlChar * value; /* the value of the attribute */
int n_value;
- for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
+ for (n_doc = 0;n_doc < gen_nb_const_xmlDoc_ptr;n_doc++) {
for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
mem_base = xmlMemBlocks();
- doc = gen_xmlDocPtr(n_doc, 0);
+ doc = gen_const_xmlDoc_ptr(n_doc, 0);
value = gen_const_xmlChar_ptr(n_value, 1);
- ret_val = xmlStringGetNodeList(doc, (const xmlChar *)value);
+ ret_val = xmlStringGetNodeList((const xmlDoc *)doc, (const xmlChar *)value);
desret_xmlNodePtr(ret_val);
call_tests++;
- des_xmlDocPtr(n_doc, doc, 0);
+ des_const_xmlDoc_ptr(n_doc, (const xmlDoc *)doc, 0);
des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
xmlResetLastError();
if (mem_base != xmlMemBlocks()) {
int mem_base;
xmlNodePtr ret_val;
- xmlDocPtr doc; /* the document */
+ xmlDoc * doc; /* the document */
int n_doc;
xmlChar * value; /* the value of the text */
int n_value;
int len; /* the length of the string value */
int n_len;
- for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
+ for (n_doc = 0;n_doc < gen_nb_const_xmlDoc_ptr;n_doc++) {
for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
for (n_len = 0;n_len < gen_nb_int;n_len++) {
mem_base = xmlMemBlocks();
- doc = gen_xmlDocPtr(n_doc, 0);
+ doc = gen_const_xmlDoc_ptr(n_doc, 0);
value = gen_const_xmlChar_ptr(n_value, 1);
len = gen_int(n_len, 2);
- ret_val = xmlStringLenGetNodeList(doc, (const xmlChar *)value, len);
+ ret_val = xmlStringLenGetNodeList((const xmlDoc *)doc, (const xmlChar *)value, len);
desret_xmlNodePtr(ret_val);
call_tests++;
- des_xmlDocPtr(n_doc, doc, 0);
+ des_const_xmlDoc_ptr(n_doc, (const xmlDoc *)doc, 0);
des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
des_int(n_len, len, 2);
xmlResetLastError();
test_xmlValidateNCName(void) {
int test_ret = 0;
-#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)
+#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_DEBUG_ENABLED) || defined (LIBXML_HTML_ENABLED) || defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_DOCB_ENABLED) || defined(LIBXML_LEGACY_ENABLED)
#ifdef LIBXML_TREE_ENABLED
int mem_base;
int ret_val;
test_tree(void) {
int test_ret = 0;
- if (quiet == 0) printf("Testing tree : 139 of 158 functions ...\n");
+ if (quiet == 0) printf("Testing tree : 142 of 164 functions ...\n");
test_ret += test_xmlAddChild();
test_ret += test_xmlAddChildList();
test_ret += test_xmlAddNextSibling();
test_ret += test_xmlAddPrevSibling();
test_ret += test_xmlAddSibling();
test_ret += test_xmlAttrSerializeTxtContent();
+ test_ret += test_xmlBufContent();
+ test_ret += test_xmlBufEnd();
+ test_ret += test_xmlBufGetNodeContent();
+ test_ret += test_xmlBufNodeDump();
+ test_ret += test_xmlBufShrink();
+ test_ret += test_xmlBufUse();
test_ret += test_xmlBufferAdd();
test_ret += test_xmlBufferAddHead();
test_ret += test_xmlBufferCCat();
int n_ctxt;
xmlChar * data; /* some character data read */
int n_data;
- int len; /* the lenght of the data */
+ int len; /* the length of the data */
int n_len;
for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
static int
+test_xmlOutputBufferGetContent(void) {
+ int test_ret = 0;
+
+#if defined(LIBXML_OUTPUT_ENABLED)
+ int mem_base;
+ const xmlChar * ret_val;
+ xmlOutputBufferPtr out; /* an xmlOutputBufferPtr */
+ int n_out;
+
+ for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
+ mem_base = xmlMemBlocks();
+ out = gen_xmlOutputBufferPtr(n_out, 0);
+
+ ret_val = xmlOutputBufferGetContent(out);
+ desret_const_xmlChar_ptr(ret_val);
+ call_tests++;
+ des_xmlOutputBufferPtr(n_out, out, 0);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in xmlOutputBufferGetContent",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_out);
+ printf("\n");
+ }
+ }
+ function_tests++;
+#endif
+
+ return(test_ret);
+}
+
+
+static int
+test_xmlOutputBufferGetSize(void) {
+ int test_ret = 0;
+
+
+ /* missing type support */
+ return(test_ret);
+}
+
+
+static int
test_xmlOutputBufferWrite(void) {
int test_ret = 0;
test_xmlIO(void) {
int test_ret = 0;
- if (quiet == 0) printf("Testing xmlIO : 39 of 48 functions ...\n");
+ if (quiet == 0) printf("Testing xmlIO : 40 of 50 functions ...\n");
test_ret += test_xmlAllocOutputBuffer();
test_ret += test_xmlAllocParserInputBuffer();
test_ret += test_xmlCheckFilename();
test_ret += test_xmlOutputBufferCreateFile();
test_ret += test_xmlOutputBufferCreateFilename();
test_ret += test_xmlOutputBufferFlush();
+ test_ret += test_xmlOutputBufferGetContent();
+ test_ret += test_xmlOutputBufferGetSize();
test_ret += test_xmlOutputBufferWrite();
test_ret += test_xmlOutputBufferWriteEscape();
test_ret += test_xmlOutputBufferWriteString();
int n_exp;
xmlChar ** langList; /* where to store the tokens */
int n_langList;
- int len; /* the allocated lenght of @list */
+ int len; /* the allocated length of @list */
int n_len;
for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
int n_exp;
xmlChar ** tokList; /* where to store the tokens */
int n_tokList;
- int len; /* the allocated lenght of @list */
+ int len; /* the allocated length of @list */
int n_len;
for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
static int
+test_xmlSchemaValidateSetFilename(void) {
+ int test_ret = 0;
+
+#if defined(LIBXML_SCHEMAS_ENABLED)
+ int mem_base;
+ xmlSchemaValidCtxtPtr vctxt; /* the schema validation context */
+ int n_vctxt;
+ const char * filename; /* the file name */
+ int n_filename;
+
+ for (n_vctxt = 0;n_vctxt < gen_nb_xmlSchemaValidCtxtPtr;n_vctxt++) {
+ for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
+ mem_base = xmlMemBlocks();
+ vctxt = gen_xmlSchemaValidCtxtPtr(n_vctxt, 0);
+ filename = gen_filepath(n_filename, 1);
+
+ xmlSchemaValidateSetFilename(vctxt, filename);
+ call_tests++;
+ des_xmlSchemaValidCtxtPtr(n_vctxt, vctxt, 0);
+ des_filepath(n_filename, filename, 1);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in xmlSchemaValidateSetFilename",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_vctxt);
+ printf(" %d", n_filename);
+ printf("\n");
+ }
+ }
+ }
+ function_tests++;
+#endif
+
+ return(test_ret);
+}
+
+
+static int
+test_xmlSchemaValidateSetLocator(void) {
+ int test_ret = 0;
+
+
+ /* missing type support */
+ return(test_ret);
+}
+
+
+static int
test_xmlSchemaValidateStream(void) {
int test_ret = 0;
test_xmlschemas(void) {
int test_ret = 0;
- if (quiet == 0) printf("Testing xmlschemas : 15 of 25 functions ...\n");
+ if (quiet == 0) printf("Testing xmlschemas : 16 of 27 functions ...\n");
test_ret += test_xmlSchemaDump();
test_ret += test_xmlSchemaGetParserErrors();
test_ret += test_xmlSchemaGetValidErrors();
test_ret += test_xmlSchemaValidateDoc();
test_ret += test_xmlSchemaValidateFile();
test_ret += test_xmlSchemaValidateOneElement();
+ test_ret += test_xmlSchemaValidateSetFilename();
+ test_ret += test_xmlSchemaValidateSetLocator();
test_ret += test_xmlSchemaValidateStream();
if (test_ret != 0)
static int
+test_xmlTextWriterSetQuoteChar(void) {
+ int test_ret = 0;
+
+#if defined(LIBXML_WRITER_ENABLED)
+ int mem_base;
+ int ret_val;
+ xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
+ int n_writer;
+ xmlChar quotechar; /* the quote character */
+ int n_quotechar;
+
+ for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
+ for (n_quotechar = 0;n_quotechar < gen_nb_xmlChar;n_quotechar++) {
+ mem_base = xmlMemBlocks();
+ writer = gen_xmlTextWriterPtr(n_writer, 0);
+ quotechar = gen_xmlChar(n_quotechar, 1);
+
+ ret_val = xmlTextWriterSetQuoteChar(writer, quotechar);
+ desret_int(ret_val);
+ call_tests++;
+ des_xmlTextWriterPtr(n_writer, writer, 0);
+ des_xmlChar(n_quotechar, quotechar, 1);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in xmlTextWriterSetQuoteChar",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_writer);
+ printf(" %d", n_quotechar);
+ printf("\n");
+ }
+ }
+ }
+ function_tests++;
+#endif
+
+ return(test_ret);
+}
+
+
+static int
test_xmlTextWriterStartAttribute(void) {
int test_ret = 0;
test_xmlwriter(void) {
int test_ret = 0;
- if (quiet == 0) printf("Testing xmlwriter : 51 of 79 functions ...\n");
+ if (quiet == 0) printf("Testing xmlwriter : 52 of 80 functions ...\n");
test_ret += test_xmlNewTextWriter();
test_ret += test_xmlNewTextWriterFilename();
test_ret += test_xmlNewTextWriterMemory();
test_ret += test_xmlTextWriterFullEndElement();
test_ret += test_xmlTextWriterSetIndent();
test_ret += test_xmlTextWriterSetIndentString();
+ test_ret += test_xmlTextWriterSetQuoteChar();
test_ret += test_xmlTextWriterStartAttribute();
test_ret += test_xmlTextWriterStartAttributeNS();
test_ret += test_xmlTextWriterStartCDATA();
static int
+test_xmlXPathNodeEval(void) {
+ int test_ret = 0;
+
+#if defined(LIBXML_XPATH_ENABLED)
+ int mem_base;
+ xmlXPathObjectPtr ret_val;
+ xmlNodePtr node; /* the node to to use as the context node */
+ int n_node;
+ xmlChar * str; /* the XPath expression */
+ int n_str;
+ xmlXPathContextPtr ctx; /* the XPath context */
+ int n_ctx;
+
+ for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
+ for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
+ for (n_ctx = 0;n_ctx < gen_nb_xmlXPathContextPtr;n_ctx++) {
+ mem_base = xmlMemBlocks();
+ node = gen_xmlNodePtr(n_node, 0);
+ str = gen_const_xmlChar_ptr(n_str, 1);
+ ctx = gen_xmlXPathContextPtr(n_ctx, 2);
+
+ ret_val = xmlXPathNodeEval(node, (const xmlChar *)str, ctx);
+ desret_xmlXPathObjectPtr(ret_val);
+ call_tests++;
+ des_xmlNodePtr(n_node, node, 0);
+ des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
+ des_xmlXPathContextPtr(n_ctx, ctx, 2);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in xmlXPathNodeEval",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_node);
+ printf(" %d", n_str);
+ printf(" %d", n_ctx);
+ printf("\n");
+ }
+ }
+ }
+ }
+ function_tests++;
+#endif
+
+ return(test_ret);
+}
+
+
+static int
test_xmlXPathNodeSetCreate(void) {
int test_ret = 0;
return(test_ret);
}
+
+static int
+test_xmlXPathSetContextNode(void) {
+ int test_ret = 0;
+
+#if defined(LIBXML_XPATH_ENABLED)
+ int mem_base;
+ int ret_val;
+ xmlNodePtr node; /* the node to to use as the context node */
+ int n_node;
+ xmlXPathContextPtr ctx; /* the XPath context */
+ int n_ctx;
+
+ for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
+ for (n_ctx = 0;n_ctx < gen_nb_xmlXPathContextPtr;n_ctx++) {
+ mem_base = xmlMemBlocks();
+ node = gen_xmlNodePtr(n_node, 0);
+ ctx = gen_xmlXPathContextPtr(n_ctx, 1);
+
+ ret_val = xmlXPathSetContextNode(node, ctx);
+ desret_int(ret_val);
+ call_tests++;
+ des_xmlNodePtr(n_node, node, 0);
+ des_xmlXPathContextPtr(n_ctx, ctx, 1);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in xmlXPathSetContextNode",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_node);
+ printf(" %d", n_ctx);
+ printf("\n");
+ }
+ }
+ }
+ function_tests++;
+#endif
+
+ return(test_ret);
+}
+
static int
test_xpath(void) {
int test_ret = 0;
- if (quiet == 0) printf("Testing xpath : 30 of 38 functions ...\n");
+ if (quiet == 0) printf("Testing xpath : 32 of 40 functions ...\n");
test_ret += test_xmlXPathCastBooleanToNumber();
test_ret += test_xmlXPathCastBooleanToString();
test_ret += test_xmlXPathCastNodeSetToBoolean();
test_ret += test_xmlXPathIsInf();
test_ret += test_xmlXPathIsNaN();
test_ret += test_xmlXPathNewContext();
+ test_ret += test_xmlXPathNodeEval();
test_ret += test_xmlXPathNodeSetCreate();
test_ret += test_xmlXPathObjectCopy();
test_ret += test_xmlXPathOrderDocElems();
+ test_ret += test_xmlXPathSetContextNode();
if (test_ret != 0)
printf("Module xpath: %d errors\n", test_ret);
#if defined(LIBXML_XPATH_ENABLED)
int mem_base;
+ int ret_val;
xmlNodeSetPtr cur; /* the initial node set */
int n_cur;
xmlNodePtr val; /* a new xmlNodePtr */
cur = gen_xmlNodeSetPtr(n_cur, 0);
val = gen_xmlNodePtr(n_val, 1);
- xmlXPathNodeSetAdd(cur, val);
+ ret_val = xmlXPathNodeSetAdd(cur, val);
+ desret_int(ret_val);
call_tests++;
des_xmlNodeSetPtr(n_cur, cur, 0);
des_xmlNodePtr(n_val, val, 1);
#if defined(LIBXML_XPATH_ENABLED)
int mem_base;
+ int ret_val;
xmlNodeSetPtr cur; /* the initial node set */
int n_cur;
xmlNodePtr node; /* the hosting node */
node = gen_xmlNodePtr(n_node, 1);
ns = gen_xmlNsPtr(n_ns, 2);
- xmlXPathNodeSetAddNs(cur, node, ns);
+ ret_val = xmlXPathNodeSetAddNs(cur, node, ns);
+ desret_int(ret_val);
call_tests++;
des_xmlNodeSetPtr(n_cur, cur, 0);
des_xmlNodePtr(n_node, node, 1);
#if defined(LIBXML_XPATH_ENABLED)
int mem_base;
+ int ret_val;
xmlNodeSetPtr cur; /* the initial node set */
int n_cur;
xmlNodePtr val; /* a new xmlNodePtr */
cur = gen_xmlNodeSetPtr(n_cur, 0);
val = gen_xmlNodePtr(n_val, 1);
- xmlXPathNodeSetAddUnique(cur, val);
+ ret_val = xmlXPathNodeSetAddUnique(cur, val);
+ desret_int(ret_val);
call_tests++;
des_xmlNodeSetPtr(n_cur, cur, 0);
des_xmlNodePtr(n_val, val, 1);