MCPcopy Create free account
hub / github.com/Kitware/VTK / initializeLibxml2

Function initializeLibxml2

ThirdParty/libxml2/vtklibxml2/runsuite.c:202–227  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

200static xmlXPathContextPtr ctxtXPath;
201
202static void
203initializeLibxml2(void) {
204 xmlMemSetup(xmlMemFree, xmlMemMalloc, xmlMemRealloc, xmlMemoryStrdup);
205 xmlInitParser();
206 xmlSetExternalEntityLoader(testExternalEntityLoader);
207 ctxtXPath = xmlXPathNewContext(NULL);
208 /*
209 * Deactivate the cache if created; otherwise we have to create/free it
210 * for every test, since it will confuse the memory leak detection.
211 * Note that normally this need not be done, since the cache is not
212 * created until set explicitly with xmlXPathContextSetCache();
213 * but for test purposes it is sometimes useful to activate the
214 * cache by default for the whole library.
215 */
216 if (ctxtXPath->cache != NULL)
217 xmlXPathContextSetCache(ctxtXPath, 0, -1, 0);
218 /* used as default namespace in xstc tests */
219 xmlXPathRegisterNs(ctxtXPath, BAD_CAST "ts", BAD_CAST "TestSuite");
220 xmlXPathRegisterNs(ctxtXPath, BAD_CAST "xlink",
221 BAD_CAST "http://www.w3.org/1999/xlink");
222 xmlSetGenericErrorFunc(NULL, testErrorHandler);
223#ifdef LIBXML_SCHEMAS_ENABLED
224 xmlSchemaInitTypes();
225 xmlRelaxNGInitTypes();
226#endif
227}
228
229static xmlNodePtr
230getNext(xmlNodePtr cur, const char *xpath) {

Callers 1

mainFunction · 0.70

Calls 9

xmlMemSetupFunction · 0.85
xmlInitParserFunction · 0.85
xmlXPathNewContextFunction · 0.85
xmlXPathContextSetCacheFunction · 0.85
xmlXPathRegisterNsFunction · 0.85
xmlSetGenericErrorFuncFunction · 0.85
xmlSchemaInitTypesFunction · 0.85
xmlRelaxNGInitTypesFunction · 0.85

Tested by

no test coverage detected