diff options
author | Mike Hommey <glandium@debian.org> | 2006-06-08 10:59:26 +0200 |
---|---|---|
committer | Mike Hommey <glandium@debian.org> | 2006-06-08 10:59:26 +0200 |
commit | a7e9d3f37d5e9fba4b9acaa43e7c12b6d9a669ae (patch) | |
tree | f70d9afbc2bc584860755cb0f933a4405ee3c338 /runsuite.c | |
parent | 07a67fa4bcc1b8bf2651ab41e5fc54a05059cf7e (diff) | |
download | libxml2-a7e9d3f37d5e9fba4b9acaa43e7c12b6d9a669ae.tar.gz |
Load /tmp/libxml2-2.6.26 intoupstream/2.6.26.dfsg
libxml2/branches/upstream/current.
Diffstat (limited to 'runsuite.c')
-rw-r--r-- | runsuite.c | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -225,6 +225,16 @@ initializeLibxml2(void) { xmlInitParser(); xmlSetExternalEntityLoader(testExternalEntityLoader); ctxtXPath = xmlXPathNewContext(NULL); + /* + * Deactivate the cache if created; otherwise we have to create/free it + * for every test, since it will confuse the memory leak detection. + * Note that normally this need not be done, since the cache is not + * created until set explicitely with xmlXPathContextSetCache(); + * but for test purposes it is sometimes usefull to activate the + * cache by default for the whole library. + */ + if (ctxtXPath->cache != NULL) + xmlXPathContextSetCache(ctxtXPath, 0, -1, 0); /* used as default nanemspace in xstc tests */ xmlXPathRegisterNs(ctxtXPath, BAD_CAST "ts", BAD_CAST "TestSuite"); xmlXPathRegisterNs(ctxtXPath, BAD_CAST "xlink", @@ -1158,7 +1168,6 @@ main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) { printf("Total %d tests, %d errors, %d leaks\n", nb_tests, nb_errors, nb_leaks); } - xmlXPathFreeContext(ctxtXPath); xmlCleanupParser(); xmlMemoryDump(); |