Re: [PATCH] test: Fix actual vs. expected in virtTestCompareFiles

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

 



On 04/27/2015 01:48 PM, Laine Stump wrote:
> Commit ca329299 added a utility function virtTestCompareFiles() to
> eliminate repetitive code in several test programs. It unfortunately
> calls virtTestDifference() with the arguments in the wrong order -
> strcontent is the "actual" output gathered by the test rig, while
> filecontent is the "expected", and virtTestDifference() wants expected
> (filecontent) followed by actual (strcontent), but
> virtTestCompareFiles() does the opposite, which can make the output a
> bit confusing when there is a failure.
> ---
>  tests/testutils.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/tests/testutils.c b/tests/testutils.c
> index acb2ef1..6a8fe6a 100644
> --- a/tests/testutils.c
> +++ b/tests/testutils.c
> @@ -1,7 +1,7 @@
>  /*
>   * testutils.c: basic test utils
>   *
> - * Copyright (C) 2005-2014 Red Hat, Inc.
> + * Copyright (C) 2005-2015 Red Hat, Inc.
>   *
>   * This library is free software; you can redistribute it and/or
>   * modify it under the terms of the GNU Lesser General Public
> @@ -641,7 +641,7 @@ virtTestCompareToFile(const char *strcontent,
>                  goto failure;
>              goto out;
>          }
> -        virtTestDifference(stderr, strcontent, filecontent);
> +        virtTestDifference(stderr, filecontent, strcontent);
>          goto failure;
>      }
>  
> 

ACK

- Cole

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