Re: [PATCH 3/3] virjsontest: switch AddAndRemove tests to work with files

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

 



On Tue, 2019-02-12 at 16:57 +0100, Ján Tomko wrote:
[...]
> +++ b/tests/virjsontest.c
> @@ -114,12 +114,24 @@ static int
>  testJSONAddRemove(const void *data)
>  {
>      const struct testInfo *info = data;
> -    virJSONValuePtr json;
> +    virJSONValuePtr json = NULL;
>      virJSONValuePtr name = NULL;
> -    char *result = NULL;
> +    char *infile = NULL;
> +    char *indata = NULL;
> +    char *outfile = NULL;
> +    char *actual = NULL;

Feel free to convert this function and the rest of the file to
VIR_AUTOFREE() in a follow-up series O:-)

> @@ -159,20 +171,22 @@ testJSONAddRemove(const void *data)
>          VIR_TEST_VERBOSE("%s", "unexpected failure adding new key\n");
>          goto cleanup;
>      }
> -    if (!(result = virJSONValueToString(json, false))) {
> +    if (!(actual = virJSONValueToString(json, false))) {

The amount of data is much smaller in this case, so whether or not
it's pretty printed doesn't make a lot of difference. I'd still
pretty print everything for consistency and because it just looks
much better, but it's okay to leave it as is too.

Reviewed-by: Andrea Bolognani <abologna@xxxxxxxxxx>

-- 
Andrea Bolognani / Red Hat / Virtualization


[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