| OLD | NEW |
| 1 /* | 1 /* |
| 2 * runsuite.c: C program to run libxml2 againts published testsuites | 2 * runsuite.c: C program to run libxml2 againts published testsuites |
| 3 * | 3 * |
| 4 * See Copyright for the status of this software. | 4 * See Copyright for the status of this software. |
| 5 * | 5 * |
| 6 * daniel@veillard.com | 6 * daniel@veillard.com |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 #ifdef HAVE_CONFIG_H | 9 #ifdef HAVE_CONFIG_H |
| 10 #include "libxml.h" | 10 #include "libxml.h" |
| (...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 300 xmlXPathFreeObject(res); | 300 xmlXPathFreeObject(res); |
| 301 return(ret); | 301 return(ret); |
| 302 } | 302 } |
| 303 | 303 |
| 304 /************************************************************************ | 304 /************************************************************************ |
| 305 * * | 305 * * |
| 306 * Test test/xsdtest/xsdtestsuite.xml * | 306 * Test test/xsdtest/xsdtestsuite.xml * |
| 307 * * | 307 * * |
| 308 ************************************************************************/ | 308 ************************************************************************/ |
| 309 | 309 |
| 310 static int | 310 static int |
| 311 xsdIncorectTestCase(xmlNodePtr cur) { | 311 xsdIncorectTestCase(xmlNodePtr cur) { |
| 312 xmlNodePtr test; | 312 xmlNodePtr test; |
| 313 xmlBufferPtr buf; | 313 xmlBufferPtr buf; |
| 314 xmlRelaxNGParserCtxtPtr pctxt; | 314 xmlRelaxNGParserCtxtPtr pctxt; |
| 315 xmlRelaxNGPtr rng = NULL; | 315 xmlRelaxNGPtr rng = NULL; |
| 316 int ret = 0, memt; | 316 int ret = 0, memt; |
| 317 | 317 |
| 318 cur = getNext(cur, "./incorrect[1]"); | 318 cur = getNext(cur, "./incorrect[1]"); |
| 319 if (cur == NULL) { | 319 if (cur == NULL) { |
| 320 return(0); | 320 return(0); |
| 321 } | 321 } |
| 322 | 322 |
| 323 test = getNext(cur, "./*"); | 323 test = getNext(cur, "./*"); |
| 324 if (test == NULL) { | 324 if (test == NULL) { |
| 325 test_log("Failed to find test in correct line %ld\n", | 325 test_log("Failed to find test in correct line %ld\n", |
| 326 xmlGetLineNo(cur)); | 326 xmlGetLineNo(cur)); |
| 327 return(1); | 327 return(1); |
| 328 } | 328 } |
| 329 | 329 |
| 330 memt = xmlMemUsed(); | 330 memt = xmlMemUsed(); |
| 331 extraMemoryFromResolver = 0; | 331 extraMemoryFromResolver = 0; |
| 332 /* | 332 /* |
| (...skipping 18 matching lines...) Expand all Loading... |
| 351 ret = 1; | 351 ret = 1; |
| 352 goto done; | 352 goto done; |
| 353 } | 353 } |
| 354 | 354 |
| 355 done: | 355 done: |
| 356 if (buf != NULL) | 356 if (buf != NULL) |
| 357 xmlBufferFree(buf); | 357 xmlBufferFree(buf); |
| 358 if (rng != NULL) | 358 if (rng != NULL) |
| 359 xmlRelaxNGFree(rng); | 359 xmlRelaxNGFree(rng); |
| 360 xmlResetLastError(); | 360 xmlResetLastError(); |
| 361 if ((memt != xmlMemUsed()) && (extraMemoryFromResolver == 0)) { | 361 if ((memt < xmlMemUsed()) && (extraMemoryFromResolver == 0)) { |
| 362 test_log("Validation of tests starting line %ld leaked %d\n", | 362 test_log("Validation of tests starting line %ld leaked %d\n", |
| 363 xmlGetLineNo(cur), xmlMemUsed() - memt); | 363 xmlGetLineNo(cur), xmlMemUsed() - memt); |
| 364 nb_leaks++; | 364 nb_leaks++; |
| 365 } | 365 } |
| 366 return(ret); | 366 return(ret); |
| 367 } | 367 } |
| 368 | 368 |
| 369 static void | 369 static void |
| 370 installResources(xmlNodePtr tst, const xmlChar *base) { | 370 installResources(xmlNodePtr tst, const xmlChar *base) { |
| 371 xmlNodePtr test; | 371 xmlNodePtr test; |
| (...skipping 803 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1175 if (logfile != NULL) | 1175 if (logfile != NULL) |
| 1176 fclose(logfile); | 1176 fclose(logfile); |
| 1177 return(ret); | 1177 return(ret); |
| 1178 } | 1178 } |
| 1179 #else /* !SCHEMAS */ | 1179 #else /* !SCHEMAS */ |
| 1180 int | 1180 int |
| 1181 main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) { | 1181 main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) { |
| 1182 fprintf(stderr, "runsuite requires support for schemas and xpath in libxml2\
n"); | 1182 fprintf(stderr, "runsuite requires support for schemas and xpath in libxml2\
n"); |
| 1183 } | 1183 } |
| 1184 #endif | 1184 #endif |
| OLD | NEW |