Re: [PATCH 08/12] qemucapabilitiestest: Test all capabilities

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

 



On Thu, May 05, 2016 at 18:42:10 +0200, Jiri Denemark wrote:
> Enhance the test to cover all capabilities we probe for rather than
> testing the flags only.
> 
> Signed-off-by: Jiri Denemark <jdenemar@xxxxxxxxxx>
> ---

[...]

> diff --git a/tests/qemucapabilitiestest.c b/tests/qemucapabilitiestest.c
> index 80f3cd8..1f2d5d7 100644
> --- a/tests/qemucapabilitiestest.c
> +++ b/tests/qemucapabilitiestest.c

[...]

> @@ -134,17 +137,19 @@ testQemuCaps(const void *opaque)
>      if (!(mon = testQemuFeedMonitor(replies, data->xmlopt)))
>          goto cleanup;
>  
> -    if (!(capsExpected = qemuTestParseCapabilities(capsFile)))
> -        goto cleanup;
> -
> -    if (!(capsActual = virQEMUCapsNew()))
> -        goto cleanup;
> -
> -    if (virQEMUCapsInitQMPMonitor(capsActual,
> +    if (!(capsActual = virQEMUCapsNew()) ||
> +        virQEMUCapsInitQMPMonitor(capsActual,
>                                    qemuMonitorTestGetMonitor(mon)) < 0)
>          goto cleanup;
>  
> -    if (testQemuCapsCompare(capsExpected, capsActual) < 0)
> +    if ((capsExpected = qemuTestParseCapabilities(capsFile)) &&
> +        testQemuCapsFlagsCompare(capsExpected, capsActual) < 0)

So here you compare the flags only ...

> +        goto cleanup;
> +
> +    if (!(actual = virQEMUCapsFormatCache(capsActual, 0, 0)))
> +        goto cleanup;
> +
> +    if (virtTestCompareToFile(actual, capsFile) < 0)

and here you compare them again with the rest of the file. 

>          goto cleanup;
>  
>      ret = 0;

I think the first comparison can be dropped. This would require to fix
the flags first and then in a second run fix all the rest. The second
check should do the trick by itself.

ACK with the first check dropped

Attachment: signature.asc
Description: Digital signature

--
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]