diff options
Diffstat (limited to 'runtest.c')
-rw-r--r-- | runtest.c | 18 |
1 files changed, 11 insertions, 7 deletions
@@ -11,11 +11,16 @@ * daniel@veillard.com */ +#ifdef HAVE_CONFIG_H +#include "libxml.h" +#else +#include <stdio.h> +#endif + #if !defined(_WIN32) || defined(__CYGWIN__) #include <unistd.h> #endif #include <string.h> -#include <stdio.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> @@ -204,7 +209,6 @@ static void globfree(glob_t *pglob) { static int nb_tests = 0; static int nb_errors = 0; static int nb_leaks = 0; -static long libxmlMemoryAllocatedBase = 0; static int extraMemoryFromResolver = 0; static int @@ -536,7 +540,6 @@ initializeLibxml2(void) { xmlSchemaInitTypes(); xmlRelaxNGInitTypes(); #endif - libxmlMemoryAllocatedBase = xmlMemUsed(); } @@ -2926,14 +2929,15 @@ schemasOneTest(const char *sch, unlink(temp); free(temp); - if (err != NULL) { + if ((ret != 0) && (err != NULL)) { if (compareFileMem(err, testErrors, testErrorsSize)) { fprintf(stderr, "Error for %s on %s failed\n", filename, sch); ret = 1; + } else { + ret = 0; } } - xmlSchemaFreeValidCtxt(ctxt); xmlFreeDoc(doc); return(ret); @@ -3029,8 +3033,8 @@ schemasTest(const char *filename, nb_tests++; ret = schemasOneTest(filename, instance, result, err, options, schemas); - if (res != 0) - ret = res; + if (ret != 0) + res = ret; } } globfree(&globbuf); |