| 514 | } |
| 515 | |
| 516 | static int |
| 517 | xmlconfTest(void) { |
| 518 | const char *confxml = "xmlconf/xmlconf.xml"; |
| 519 | xmlDocPtr doc; |
| 520 | xmlNodePtr cur; |
| 521 | int ret = 0; |
| 522 | |
| 523 | if (!checkTestFile(confxml)) { |
| 524 | fprintf(stderr, "%s is missing \n", confxml); |
| 525 | xmlconfInfo(); |
| 526 | return(-1); |
| 527 | } |
| 528 | doc = xmlReadFile(confxml, NULL, XML_PARSE_NOENT); |
| 529 | if (doc == NULL) { |
| 530 | fprintf(stderr, "%s is corrupted \n", confxml); |
| 531 | xmlconfInfo(); |
| 532 | return(-1); |
| 533 | } |
| 534 | |
| 535 | cur = xmlDocGetRootElement(doc); |
| 536 | if ((cur == NULL) || (!xmlStrEqual(cur->name, BAD_CAST "TESTSUITE"))) { |
| 537 | fprintf(stderr, "Unexpected format %s\n", confxml); |
| 538 | xmlconfInfo(); |
| 539 | ret = -1; |
| 540 | } else { |
| 541 | ret = xmlconfTestSuite(doc, cur); |
| 542 | } |
| 543 | xmlFreeDoc(doc); |
| 544 | return(ret); |
| 545 | } |
| 546 | |
| 547 | /************************************************************************ |
| 548 | * * |
no test coverage detected