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

Function xmlconfTest

ThirdParty/libxml2/vtklibxml2/runxmlconf.c:516–545  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

514}
515
516static int
517xmlconfTest(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 * *

Callers 1

mainFunction · 0.85

Calls 8

fprintfFunction · 0.85
xmlconfInfoFunction · 0.85
xmlReadFileFunction · 0.85
xmlDocGetRootElementFunction · 0.85
xmlStrEqualFunction · 0.85
xmlconfTestSuiteFunction · 0.85
xmlFreeDocFunction · 0.85
checkTestFileFunction · 0.70

Tested by

no test coverage detected