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

Function c14nCommonTest

ThirdParty/libxml2/vtklibxml2/runtest.c:4081–4122  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4079}
4080
4081static int
4082c14nCommonTest(const char *filename, int with_comments, int mode,
4083 const char *subdir) {
4084 char buf[500];
4085 char prefix[500];
4086 const char *base;
4087 int len;
4088 char *result = NULL;
4089 char *xpath = NULL;
4090 char *ns = NULL;
4091 int ret = 0;
4092
4093 base = baseFilename(filename);
4094 len = strlen(base);
4095 len -= 4;
4096 memcpy(prefix, base, len);
4097 prefix[len] = 0;
4098
4099 if (snprintf(buf, 499, "result/c14n/%s/%s", subdir, prefix) >= 499)
4100 buf[499] = 0;
4101 result = strdup(buf);
4102 if (snprintf(buf, 499, "test/c14n/%s/%s.xpath", subdir, prefix) >= 499)
4103 buf[499] = 0;
4104 if (checkTestFile(buf)) {
4105 xpath = strdup(buf);
4106 }
4107 if (snprintf(buf, 499, "test/c14n/%s/%s.ns", subdir, prefix) >= 499)
4108 buf[499] = 0;
4109 if (checkTestFile(buf)) {
4110 ns = strdup(buf);
4111 }
4112
4113 nb_tests++;
4114 if (c14nRunTest(filename, with_comments, mode,
4115 xpath, ns, result) < 0)
4116 ret = 1;
4117
4118 if (result != NULL) free(result);
4119 if (xpath != NULL) free(xpath);
4120 if (ns != NULL) free(ns);
4121 return(ret);
4122}
4123
4124static int
4125c14nWithCommentTest(const char *filename,

Callers 4

c14nWithCommentTestFunction · 0.85
c14nWithoutCommentTestFunction · 0.85
c14n11WithoutCommentTestFunction · 0.85

Calls 4

baseFilenameFunction · 0.85
strdupFunction · 0.85
c14nRunTestFunction · 0.85
checkTestFileFunction · 0.70

Tested by

no test coverage detected