Re: [PATCH 1/3] tests: use virTestCompareToFile in storagepoolcapstest

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

 



On Wed, Mar 06, 2019 at 19:16:46 +0100, Pavel Hrdina wrote:
> This will allow to use VIR_TEST_REGENERATE_OUTPUT.
> 
> Signed-off-by: Pavel Hrdina <phrdina@xxxxxxxxxx>
> ---
>  tests/storagepoolcapstest.c | 7 +------
>  1 file changed, 1 insertion(+), 6 deletions(-)
> 
> diff --git a/tests/storagepoolcapstest.c b/tests/storagepoolcapstest.c
> index d31f50c957..ade586bcdd 100644
> --- a/tests/storagepoolcapstest.c
> +++ b/tests/storagepoolcapstest.c
> @@ -68,16 +68,11 @@ test_virStoragePoolCapsFormat(const void *opaque)
>                      abs_srcdir, data->filename) < 0)
>          goto cleanup;
>  
> -    if (virFileReadAll(path, 8192, &poolCapsFromFile) < 0)
> -        goto cleanup;
> -
>      if (!(poolCapsXML = virStoragePoolCapsFormat(poolCaps)))
>          goto cleanup;
>  
> -    if (STRNEQ(poolCapsFromFile, poolCapsXML)) {
> -        virTestDifference(stderr, poolCapsFromFile, poolCapsXML);
> +    if (virTestCompareToFile(poolCapsXML, path) < 0)
>          goto cleanup;

/home/pipo/libvirt/tests/storagepoolcapstest.c:60:26: error: unused variable
      'poolCapsFromFile' [-Werror,-Wunused-variable]
    VIR_AUTOFREE(char *) poolCapsFromFile = NULL;
                         ^
ACK with the obvious fix. Also you should consider using clang as a
final test before posting.

Attachment: signature.asc
Description: PGP 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]

  Powered by Linux