| 236 | } |
| 237 | |
| 238 | static int |
| 239 | xmlconfTestNotNSWF(const char *id, const char *filename, int options) { |
| 240 | xmlParserCtxtPtr ctxt; |
| 241 | xmlDocPtr doc; |
| 242 | int ret = 1; |
| 243 | |
| 244 | ctxt = xmlNewParserCtxt(); |
| 245 | xmlCtxtSetErrorHandler(ctxt, testErrorHandler, NULL); |
| 246 | /* |
| 247 | * In case of Namespace errors, libxml2 will still parse the document |
| 248 | * but log a Namespace error. |
| 249 | */ |
| 250 | doc = xmlCtxtReadFile(ctxt, filename, NULL, options); |
| 251 | if (doc == NULL) { |
| 252 | test_log("test %s : %s failed to parse the XML\n", |
| 253 | id, filename); |
| 254 | nb_errors++; |
| 255 | ret = 0; |
| 256 | } else { |
| 257 | const xmlError *error = xmlGetLastError(); |
| 258 | |
| 259 | if ((error->code == XML_ERR_OK) || |
| 260 | (error->domain != XML_FROM_NAMESPACE)) { |
| 261 | test_log("test %s : %s failed to detect namespace error\n", |
| 262 | id, filename); |
| 263 | nb_errors++; |
| 264 | ret = 0; |
| 265 | } |
| 266 | xmlFreeDoc(doc); |
| 267 | } |
| 268 | xmlFreeParserCtxt(ctxt); |
| 269 | return(ret); |
| 270 | } |
| 271 | |
| 272 | static int |
| 273 | xmlconfTestNotWF(const char *id, const char *filename, int options) { |
no test coverage detected