summaryrefslogtreecommitdiff
path: root/runsuite.c
diff options
context:
space:
mode:
Diffstat (limited to 'runsuite.c')
-rw-r--r--runsuite.c37
1 files changed, 22 insertions, 15 deletions
diff --git a/runsuite.c b/runsuite.c
index aaab13e..d1dc2ca 100644
--- a/runsuite.c
+++ b/runsuite.c
@@ -1,13 +1,16 @@
/*
- * runsuite.c: C program to run libxml2 againts published testsuites
+ * runsuite.c: C program to run libxml2 againts published testsuites
*
* See Copyright for the status of this software.
*
* daniel@veillard.com
*/
+#ifdef HAVE_CONFIG_H
#include "libxml.h"
+#else
#include <stdio.h>
+#endif
#if !defined(_WIN32) || defined(__CYGWIN__)
#include <unistd.h>
@@ -35,6 +38,10 @@
static FILE *logfile = NULL;
static int verbose = 0;
+#if defined(_WIN32) && !defined(__CYGWIN__) && !defined(__MINGW32__)
+#define vsnprintf _vsnprintf
+#define snprintf _snprintf
+#endif
/************************************************************************
* *
@@ -123,7 +130,7 @@ static int addEntity(char *name, char *content) {
* which is shared to the current running test. We also don't want to have
* network downloads modifying tests.
*/
-static xmlParserInputPtr
+static xmlParserInputPtr
testExternalEntityLoader(const char *URL, const char *ID,
xmlParserCtxtPtr ctxt) {
xmlParserInputPtr ret;
@@ -152,7 +159,7 @@ testExternalEntityLoader(const char *URL, const char *ID,
fprintf(stderr, "Failed to find resource %s\n", URL);
}
#endif
-
+
return(ret);
}
@@ -415,7 +422,7 @@ installDirs(xmlNodePtr tst, const xmlChar *base) {
xmlFree(res);
}
-static int
+static int
xsdTestCase(xmlNodePtr tst) {
xmlNodePtr test, tmp, cur;
xmlBufferPtr buf;
@@ -442,7 +449,7 @@ xsdTestCase(xmlNodePtr tst) {
if (cur == NULL) {
return(xsdIncorectTestCase(tst));
}
-
+
test = getNext(cur, "./*");
if (test == NULL) {
fprintf(stderr, "Failed to find test in correct line %ld\n",
@@ -488,7 +495,7 @@ xsdTestCase(xmlNodePtr tst) {
if (test == NULL) {
fprintf(stderr, "Failed to find test in <valid> line %ld\n",
xmlGetLineNo(tmp));
-
+
} else {
xmlBufferEmpty(buf);
if (dtd != NULL)
@@ -547,7 +554,7 @@ xsdTestCase(xmlNodePtr tst) {
if (test == NULL) {
fprintf(stderr, "Failed to find test in <invalid> line %ld\n",
xmlGetLineNo(tmp));
-
+
} else {
xmlBufferEmpty(buf);
xmlNodeDump(buf, test->doc, test, 0, 0);
@@ -608,7 +615,7 @@ done:
return(ret);
}
-static int
+static int
xsdTestSuite(xmlNodePtr cur) {
if (verbose) {
xmlChar *doc = getString(cur, "string(documentation)");
@@ -623,11 +630,11 @@ xsdTestSuite(xmlNodePtr cur) {
xsdTestCase(cur);
cur = getNext(cur, "following-sibling::testCase[1]");
}
-
+
return(0);
}
-static int
+static int
xsdTest(void) {
xmlDocPtr doc;
xmlNodePtr cur;
@@ -665,7 +672,7 @@ done:
return(ret);
}
-static int
+static int
rngTestSuite(xmlNodePtr cur) {
if (verbose) {
xmlChar *doc = getString(cur, "string(documentation)");
@@ -686,11 +693,11 @@ rngTestSuite(xmlNodePtr cur) {
xsdTestSuite(cur);
cur = getNext(cur, "following-sibling::testSuite[1]");
}
-
+
return(0);
}
-static int
+static int
rngTest1(void) {
xmlDocPtr doc;
xmlNodePtr cur;
@@ -728,7 +735,7 @@ done:
return(ret);
}
-static int
+static int
rngTest2(void) {
xmlDocPtr doc;
xmlNodePtr cur;
@@ -938,7 +945,7 @@ xstcTestGroup(xmlNodePtr cur, const char *base) {
instance = getNext(cur, "./ts:instanceTest[1]");
while (instance != NULL) {
if (schemas != NULL) {
- xstcTestInstance(instance, schemas, path, base);
+ xstcTestInstance(instance, schemas, path, base);
} else {
/*
* We'll automatically mark the instances as failed