[libvirt] [PATCH 2/3] tests: invert the return logic in storagepoolcapstest

Peter Krempa pkrempa at redhat.com
Thu Mar 7 08:11:45 UTC 2019


On Wed, Mar 06, 2019 at 19:16:47 +0100, Pavel Hrdina wrote:
> This way if the first test "full" fails we will run the second test as
> well.
> 
> Signed-off-by: Pavel Hrdina <phrdina at redhat.com>
> ---
>  tests/storagepoolcapstest.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)

ACK, that's the way almost all our test files use.

Alternatively by using VIR_AUTOUNREF for both 'fullCaps' and 'fsCaps'
you can get rid of the whole cleanup label and just return -1 if any of
the virCapabilitiesNew calls fails. Then use 'ret' only in DO_TEST.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20190307/c2f86a42/attachment-0001.sig>


More information about the libvir-list mailing list