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

Re: [libvirt] [PATCH] tests: Add DO_TEST_PARSE_ERROR() to qemuxml2xml



On Tue, Jul 04, 2017 at 15:13:51 +0200, Andrea Bolognani wrote:
> qemuxml2argv already supports the ability to include test
> cases that are known not to make it past XML parsing, and
> since we want to keep qemuxml2xml in sync with it as much
> as possible, we need to implement this missing feature.

I must say that I don't really see the point to have them fail twice ...

I'd understand if this would be added to the genericxml2xmltest (if it's
not there)

> 
> Signed-off-by: Andrea Bolognani <abologna redhat com>
> ---
>  tests/qemuxml2xmltest.c | 104 +++++++++++++++++++++++++++++++-----------------
>  1 file changed, 67 insertions(+), 37 deletions(-)
> 
> diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c
> index c74614c..66729fa 100644
> --- a/tests/qemuxml2xmltest.c
> +++ b/tests/qemuxml2xmltest.c

> @@ -217,6 +231,17 @@ testCompareStatusXMLToXMLFiles(const void *opaque)
>  
>      ret = 0;
>  
> + ok:

This is not an okay name for a label.

> +    if (data->flags & FLAG_EXPECT_PARSE_ERROR) {
> +        if (ret < 0) {
> +            VIR_TEST_DEBUG("Got expected error");
> +            ret = 0;

The rest looks good, but the explanation for need to do this is not that
convincing, since testing the same thing twice does not really make
sense.

I'd make more sense if you plan to move the cases which are supposed to
fail here, since this is the test dealing with XML parsing.

Attachment: signature.asc
Description: PGP signature


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