diff --git a/ChangeLog b/ChangeLog index ec1f97f5..e31b0eaf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Mon Jul 4 00:39:35 CEST 2005 Daniel Veillard + + * gentest.py testapi.c: fix a problem with previous patch to + testapi.c + Sun Jul 3 23:42:31 CEST 2005 Daniel Veillard * testapi.c tree.c: fixing a leak detected by testapi in diff --git a/gentest.py b/gentest.py index e4ede364..465fdd79 100755 --- a/gentest.py +++ b/gentest.py @@ -254,6 +254,7 @@ extra_post_call = { "xmlParseDocument": "if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}", "xmlParseChunk": "if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}", "xmlParseExtParsedEnt": "if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}", + "xmlDOMWrapAdoptNode": "if ((node != NULL) && (node->parent == NULL)) {xmlUnlinkNode(node);xmlFreeNode(node);node = NULL;}", } modules = [] diff --git a/testapi.c b/testapi.c index 25752398..79efe8e1 100644 --- a/testapi.c +++ b/testapi.c @@ -519,10 +519,6 @@ static xmlNodePtr gen_xmlNodePtr(int no, int nr ATTRIBUTE_UNUSED) { } static void des_xmlNodePtr(int no, xmlNodePtr val, int nr ATTRIBUTE_UNUSED) { if (no == 1) { - if ((val != NULL) && (val->parent == NULL)) { - xmlUnlinkNode(val); - xmlFreeNode(val); - } free_api_doc(); } else if (val != NULL) { xmlUnlinkNode(val); @@ -18933,6 +18929,7 @@ test_xmlDOMWrapAdoptNode(void) { options = gen_int(n_options, 5); ret_val = xmlDOMWrapAdoptNode(ctxt, sourceDoc, node, destDoc, destParent, options); + if ((node != NULL) && (node->parent == NULL)) {xmlUnlinkNode(node);xmlFreeNode(node);node = NULL;} desret_int(ret_val); call_tests++; des_xmlDOMWrapCtxtPtr(n_ctxt, ctxt, 0);