[libvirt] [PATCH 3/6] conf: rename some test fields

Peter Krempa pkrempa at redhat.com
Wed Apr 9 09:39:00 UTC 2014


On 04/09/14 06:35, Eric Blake wrote:
> A later patch will be adding some new fields to
> virStorageFileMetadata; to minimize confusion, renaming the
> test fields now will make it more obvious which fields are
> being tested later.
> 
> * tests/virstoragetest.c (_testFileData): Alter names.
> (testStorageChain, mymain): Adjust clients.
> 
> Signed-off-by: Eric Blake <eblake at redhat.com>
> ---
>  tests/virstoragetest.c | 78 +++++++++++++++++++++++++-------------------------
>  1 file changed, 39 insertions(+), 39 deletions(-)
> 
> diff --git a/tests/virstoragetest.c b/tests/virstoragetest.c
> index 74ad15c..093053a 100644
> --- a/tests/virstoragetest.c
> +++ b/tests/virstoragetest.c
> @@ -212,9 +212,9 @@ struct _testFileData
>  {
>      const char *expBackingStore;
>      const char *expBackingStoreRaw;
> -    const char *expDirectoryRel;
> -    const char *expDirectoryAbs;
> -    enum virStorageFileFormat expFormat;
> +    const char *expBackingDirRel;
> +    const char *expBackingDirAbs;
> +    enum virStorageFileFormat expBackingFormat;
>      bool expIsFile;
>      unsigned long long expCapacity;
>      bool expEncrypted;
> @@ -285,21 +285,21 @@ testStorageChain(const void *args)
>      while (elt) {
>          char *expect = NULL;
>          char *actual = NULL;
> -        const char *expDirectory;
> +        const char *expBackingDirectory;
> 
>          if (i == data->nfiles) {
>              fprintf(stderr, "probed chain was too long\n");
>              goto cleanup;
>          }
> 
> -        expDirectory = abs ? data->files[i]->expDirectoryAbs
> -            : data->files[i]->expDirectoryRel;
> +        expBackingDirectory = abs ? data->files[i]->expBackingDirAbs
> +            : data->files[i]->expBackingDirRel;

This hunk has a merge conflict with:

commit a18c71301363d9accec5c26e8798b2615e68ef05
Author: Jean-Baptiste Rouault <jean-baptiste.rouault at diateam.net>
Date:   Wed Apr 9 08:50:24 2014 +0200

    build: avoid compiler warning on shadowed name

    Introduced in commit d1e55de3.
    virstoragetest.c: In function ‘testStorageChain’:
    virstoragetest.c:249:10: warning: declaration of ‘abs’ shadows a global
    declaration [-Wshadow]



>          if (virAsprintf(&expect,
>                          "store:%s\nraw:%s\ndirectory:%s\nother:%d %d %lld %d",
>                          NULLSTR(data->files[i]->expBackingStore),
>                          NULLSTR(data->files[i]->expBackingStoreRaw),
> -                        NULLSTR(expDirectory),
> -                        data->files[i]->expFormat,
> +                        NULLSTR(expBackingDirectory),
> +                        data->files[i]->expBackingFormat,
>                          data->files[i]->expIsFile,
>                          data->files[i]->expCapacity,
>                          data->files[i]->expEncrypted) < 0 ||

ACK,

Peter


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 901 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20140409/eefad8ec/attachment-0001.sig>


More information about the libvir-list mailing list