Re: [xml] Error in runtest.c?



On Mon, Nov 14, 2005 at 03:59:35PM -0800, Hisashi T Fujinaka wrote:
I've noticed that there are schema errors that don't get counted in the
totals. Is this on purpose or is the following diff necessary?
[..]
--- runtest.c.orig    2005-11-14 15:55:48.557248536 -0800
+++ runtest.c 2005-11-14 16:01:11.300184152 -0800
@@ -3027,7 +3027,7 @@
      if (schemas == NULL) {
      } else {
          nb_tests++;
-         ret = schemasOneTest(filename, instance, result, err,
+         res = schemasOneTest(filename, instance, result, err,
                               options, schemas);
          if (res != 0)
              ret = res;
@@ -3036,7 +3036,7 @@
     globfree(&globbuf);
     xmlSchemaFree(schemas);

-    return(res);
+    return(ret);
 }

Hum, right there is something wrong but I think the correct fix should be

            ret = schemasOneTest(filename, instance, result, err,
                                 options, schemas);
            if (ret != 0)
                res = ret;

res is the returned value it is initialized as 0.
However schemasOneTest had to be fixed too, because some tests are failures
test and in that case if the error output matches it need to considered a
passed test:

    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;
        }
    }

with those two fixes commited in CVS the behaviour looks back to what
it should.

  Thanks,

Daniel

-- 
Daniel Veillard      | Red Hat http://redhat.com/
veillard redhat com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]