summaryrefslogtreecommitdiff
path: root/testapi.c
diff options
context:
space:
mode:
authorDaniel Veillard <veillard@redhat.com>2013-04-01 16:37:05 +0800
committerDaniel Veillard <veillard@redhat.com>2013-04-01 16:42:12 +0800
commit54ae471c147d280a137474c25fd76ca1f566efac (patch)
tree7f86c4372fcf782136596197c676373a677bb80b /testapi.c
parent28876afb4e67f9f4292fc2a7134f6b97f0618b7d (diff)
downloadlibxml2-54ae471c147d280a137474c25fd76ca1f566efac.tar.gz
Regenerated API, and testapi, rebuild documentation
After the previous commit adding 2 new entry points
Diffstat (limited to 'testapi.c')
-rw-r--r--testapi.c93
1 files changed, 92 insertions, 1 deletions
diff --git a/testapi.c b/testapi.c
index 289100e8..c745ec35 100644
--- a/testapi.c
+++ b/testapi.c
@@ -46852,6 +46852,54 @@ test_xmlXPathNewContext(void) {
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;
@@ -46952,11 +47000,52 @@ test_xmlXPathOrderDocElems(void) {
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();
@@ -46987,9 +47076,11 @@ test_xpath(void) {
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);