Re: [PATCH 1/4] tests: schema: Add possibility to validate individual files

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

 



On Tue, 2017-03-28 at 13:58 +0200, Peter Krempa wrote:
[...]
> @@ -196,6 +192,30 @@ mymain(void)
>          }                                                                      \
>      } while (0)
> 
> +#define DO_TEST_FILE(sch, xmlfile)                                             \
> +    do {                                                                       \
> +        data.schema = sch;                                                     \
> +        data.xml_path = xmlfile;                                               \
> +        if (virTestRun("test schema grammar file: " sch,                       \
> +                       testSchemaGrammar, &data) == 0) {                       \
> +            /* initialize the validator even if the schema test                \
> +             * was skipped because of VIR_TEST_RANGE */                        \
> +            if (!data.validator && testSchemaGrammar(&data) < 0) {             \
> +                ret = -1;                                                      \
> +                break;                                                         \
> +            }                                                                  \
> +            if (virTestRun("Checking " xmlfile " against " sch,                \
> +                           testSchemaFile, &data) < 0)                         \
> +                ret = -1;                                                      \
> +                                                                               \
> +            virXMLValidatorFree(data.validator);                               \
> +            data.validator = NULL;                                             \
> +        } else {                                                               \
> +            ret = -1;                                                          \
> +        }                                                                      \
> +    } while (0)
> +
> +

Only one empty line here, please.


Now that you've introduced DO_TEST_FILE(), I think it would
make sense to rename DO_TEST() to DO_TEST_DIRS() for clarity.

ACK whether you feel the same or not.

-- 
Andrea Bolognani / Red Hat / Virtualization

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]
  Powered by Linux