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

Function testExternalEntityLoader

ThirdParty/libxml2/vtklibxml2/runsuite.c:121–152  ·  view source on GitHub ↗

* 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. */

Source from the content-addressed store, hash-verified

119 * network downloads modifying tests.
120 */
121static xmlParserInputPtr
122testExternalEntityLoader(const char *URL, const char *ID,
123 xmlParserCtxtPtr ctxt) {
124 xmlParserInputPtr ret;
125 int i;
126
127 for (i = 0;i < nb_entities;i++) {
128 if (!strcmp(testEntitiesName[i], URL)) {
129 ret = xmlNewStringInputStream(ctxt,
130 (const xmlChar *) testEntitiesValue[i]);
131 if (ret != NULL) {
132 ret->filename = (const char *)
133 xmlStrdup((xmlChar *)testEntitiesName[i]);
134 }
135 return(ret);
136 }
137 }
138 if (checkTestFile(URL)) {
139 ret = xmlNoNetExternalEntityLoader(URL, ID, ctxt);
140 } else {
141 int memused = xmlMemUsed();
142 ret = xmlNoNetExternalEntityLoader(URL, ID, ctxt);
143 extraMemoryFromResolver += xmlMemUsed() - memused;
144 }
145#if 0
146 if (ret == NULL) {
147 fprintf(stderr, "Failed to find resource %s\n", URL);
148 }
149#endif
150
151 return(ret);
152}
153
154/*
155 * Trapping the error messages at the generic level to grab the equivalent of

Callers

nothing calls this directly

Calls 6

xmlNewStringInputStreamFunction · 0.85
xmlStrdupFunction · 0.85
xmlMemUsedFunction · 0.85
fprintfFunction · 0.85
checkTestFileFunction · 0.70

Tested by

no test coverage detected