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

Function xmlconfTestCases

ThirdParty/libxml2/vtklibxml2/runxmlconf.c:443–480  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

441}
442
443static int
444xmlconfTestCases(xmlDocPtr doc, xmlNodePtr cur, int level) {
445 xmlChar *profile;
446 int ret = 0;
447 int tests = 0;
448 int output = 0;
449
450 if (level == 1) {
451 profile = xmlGetProp(cur, BAD_CAST "PROFILE");
452 if (profile != NULL) {
453 output = 1;
454 level++;
455 printf("Test cases: %s\n", (char *) profile);
456 xmlFree(profile);
457 }
458 }
459 cur = cur->children;
460 while (cur != NULL) {
461 /* look only at elements we ignore everything else */
462 if (cur->type == XML_ELEMENT_NODE) {
463 if (xmlStrEqual(cur->name, BAD_CAST "TESTCASES")) {
464 ret += xmlconfTestCases(doc, cur, level);
465 } else if (xmlStrEqual(cur->name, BAD_CAST "TEST")) {
466 if (xmlconfTestItem(doc, cur) >= 0)
467 ret++;
468 tests++;
469 } else {
470 fprintf(stderr, "Unhandled element %s\n", (char *)cur->name);
471 }
472 }
473 cur = cur->next;
474 }
475 if (output == 1) {
476 if (tests > 0)
477 printf("Test cases: %d tests\n", tests);
478 }
479 return(ret);
480}
481
482static int
483xmlconfTestSuite(xmlDocPtr doc, xmlNodePtr cur) {

Callers 1

xmlconfTestSuiteFunction · 0.85

Calls 5

xmlGetPropFunction · 0.85
printfFunction · 0.85
xmlStrEqualFunction · 0.85
xmlconfTestItemFunction · 0.85
fprintfFunction · 0.85

Tested by

no test coverage detected