diff options
author | Daniel Veillard <veillard@src.gnome.org> | 2008-07-30 12:58:11 +0000 |
---|---|---|
committer | Daniel Veillard <veillard@src.gnome.org> | 2008-07-30 12:58:11 +0000 |
commit | 09459bf1078992a5dea8c1bbef4919b90bc25218 (patch) | |
tree | 7f23308e273dc630e69542ca128ba9aa4458b85e /runxmlconf.c | |
parent | 40ec29a56f4f03a8b4628b46fbc3582ade156bbd (diff) | |
download | android_external_libxml2-09459bf1078992a5dea8c1bbef4919b90bc25218.tar.gz android_external_libxml2-09459bf1078992a5dea8c1bbef4919b90bc25218.tar.bz2 android_external_libxml2-09459bf1078992a5dea8c1bbef4919b90bc25218.zip |
add xmlMemDisplayLast to help debug incremental memory leaks, and some
* include/libxml/xmlmemory.h xmlmemory.c: add xmlMemDisplayLast to
help debug incremental memory leaks, and some cleanups
* runxmlconf.c: use that new call and avoid ever touching the
system catalog in the regression tests
Daniel
svn path=/trunk/; revision=3760
Diffstat (limited to 'runxmlconf.c')
-rw-r--r-- | runxmlconf.c | 29 |
1 files changed, 3 insertions, 26 deletions
diff --git a/runxmlconf.c b/runxmlconf.c index 0f0e54fb..f0f11580 100644 --- a/runxmlconf.c +++ b/runxmlconf.c @@ -125,38 +125,14 @@ static int addEntity(char *name, char *content) { /* * We need to trap calls to the resolver to not account memory for the catalog - * which is shared to the current running test. We also don't want to have - * network downloads modifying tests. + * and not rely on any external resources. */ static xmlParserInputPtr testExternalEntityLoader(const char *URL, const char *ID, xmlParserCtxtPtr ctxt) { xmlParserInputPtr ret; - int i; - for (i = 0;i < nb_entities;i++) { - if (!strcmp(testEntitiesName[i], URL)) { - ret = xmlNewStringInputStream(ctxt, - (const xmlChar *) testEntitiesValue[i]); - if (ret != NULL) { - ret->filename = (const char *) - xmlStrdup((xmlChar *)testEntitiesName[i]); - } - return(ret); - } - } - if (checkTestFile(URL)) { - ret = xmlNoNetExternalEntityLoader(URL, ID, ctxt); - } else { - int memused = xmlMemUsed(); - ret = xmlNoNetExternalEntityLoader(URL, ID, ctxt); - extraMemoryFromResolver += xmlMemUsed() - memused; - } -#if 0 - if (ret == NULL) { - fprintf(stderr, "Failed to find resource %s\n", URL); - } -#endif + ret = xmlNewInputFromFile(ctxt, (const char *) URL); return(ret); } @@ -377,6 +353,7 @@ xmlconfTestItem(xmlDocPtr doc, xmlNodePtr cur) { test_log("test %s : %s leaked %d bytes\n", id, filename, final - mem); nb_leaks++; + xmlMemDisplayLast(logfile, final - mem); } nb_tests++; |