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

Function xstcTestGroup

ThirdParty/libxml2/vtklibxml2/runsuite.c:855–971  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

853}
854
855static int
856xstcTestGroup(xmlNodePtr cur, const char *base) {
857 xmlChar *href = NULL;
858 xmlChar *path = NULL;
859 xmlChar *validity = NULL;
860 xmlSchemaPtr schemas = NULL;
861 xmlSchemaParserCtxtPtr ctxt;
862 xmlNodePtr instance;
863 int ret = 0, mem;
864
865 xmlResetLastError();
866 testErrorsSize = 0; testErrors[0] = 0;
867 mem = xmlMemUsed();
868 href = getString(cur,
869 "string(ts:schemaTest/ts:schemaDocument/@xlink:href)");
870 if ((href == NULL) || (href[0] == 0)) {
871 test_log("testGroup line %ld misses href for schemaDocument\n",
872 xmlGetLineNo(cur));
873 ret = -1;
874 goto done;
875 }
876 path = xmlBuildURI(href, BAD_CAST base);
877 if (path == NULL) {
878 test_log("Failed to build path to schemas testGroup line %ld : %s\n",
879 xmlGetLineNo(cur), href);
880 ret = -1;
881 goto done;
882 }
883 if (checkTestFile((const char *) path) <= 0) {
884 test_log("schemas for testGroup line %ld is missing: %s\n",
885 xmlGetLineNo(cur), path);
886 ret = -1;
887 goto done;
888 }
889 validity = getString(cur,
890 "string(ts:schemaTest/ts:expected/@validity)");
891 if (validity == NULL) {
892 test_log("testGroup line %ld misses expected validity\n",
893 xmlGetLineNo(cur));
894 ret = -1;
895 goto done;
896 }
897 nb_tests++;
898 if (xmlStrEqual(validity, BAD_CAST "valid")) {
899 nb_schematas++;
900 ctxt = xmlSchemaNewParserCtxt((const char *) path);
901 xmlSchemaSetParserErrors(ctxt, testErrorHandler, testErrorHandler,
902 ctxt);
903 schemas = xmlSchemaParse(ctxt);
904 xmlSchemaFreeParserCtxt(ctxt);
905 if (schemas == NULL) {
906 test_log("valid schemas %s failed to parse\n",
907 path);
908 ret = 1;
909 nb_errors++;
910 }
911 if ((ret == 0) && (strstr(testErrors, "nimplemented") != NULL)) {
912 test_log("valid schemas %s hit an unimplemented block\n",

Callers 1

xstcMetadataFunction · 0.85

Calls 15

xmlResetLastErrorFunction · 0.85
xmlMemUsedFunction · 0.85
xmlGetLineNoFunction · 0.85
xmlBuildURIFunction · 0.85
xmlStrEqualFunction · 0.85
xmlSchemaNewParserCtxtFunction · 0.85
xmlSchemaSetParserErrorsFunction · 0.85
xmlSchemaParseFunction · 0.85
xmlSchemaFreeParserCtxtFunction · 0.85
getNextFunction · 0.85
xstcTestInstanceFunction · 0.85
xmlSchemaFreeFunction · 0.85

Tested by

no test coverage detected