[libvirt] [PATCH v2 2/3] virTestCompareToULL: Rename local variables

Martin Kletzander mkletzan at redhat.com
Wed Feb 20 14:04:30 UTC 2019


On Wed, Feb 20, 2019 at 02:20:09PM +0100, Michal Privoznik wrote:
>The current naming makes it hard for me to see which holds the
>expected value and which holds the actual value. Rename them to
>make it obvious.
>

Well, the naming was confusing because of the function parameters, so I would
mainly focus on those as from a caller this is still weird naming.

I heard that Andrea already reviewed the whole series (as I can't see it because
our ML is acting up again), so this is just an extra hint.

>Signed-off-by: Michal Privoznik <mprivozn at redhat.com>
>---
> tests/testutils.c | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
>
>diff --git a/tests/testutils.c b/tests/testutils.c
>index ac86418653..01f3e8bb93 100644
>--- a/tests/testutils.c
>+++ b/tests/testutils.c
>@@ -822,16 +822,16 @@ int
> virTestCompareToULL(unsigned long long content,
>                     unsigned long long src)
> {
>-    VIR_AUTOFREE(char *) strcontent = NULL;
>-    VIR_AUTOFREE(char *) strsrc = NULL;
>+    VIR_AUTOFREE(char *) expectStr = NULL;
>+    VIR_AUTOFREE(char *) actualStr = NULL;
>
>-    if (virAsprintf(&strcontent, "%llu", content) < 0)
>+    if (virAsprintf(&expectStr, "%llu", content) < 0)
>         return -1;
>
>-    if (virAsprintf(&strsrc, "%llu", src) < 0)
>+    if (virAsprintf(&actualStr, "%llu", src) < 0)
>         return -1;
>
>-    return virTestCompareToString(strcontent, strsrc);
>+    return virTestCompareToString(expectStr, actualStr);
> }
>
> /*
>-- 
>2.19.2
>
>--
>libvir-list mailing list
>libvir-list at redhat.com
>https://www.redhat.com/mailman/listinfo/libvir-list
-------------- 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/20190220/37344ed1/attachment-0001.sig>


More information about the libvir-list mailing list