Re: [PATCH] test: Fix testNodeGetFreePages

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

 



On 9/26/23 14:20, Martin Kletzander wrote:
> The function is supposed to return the number of items filled into the
> array and not zero.  Also change the initialization of the "randomness"
> to be based on the startCell so that the values are different for each
> cell even for separate calls.
> 
> Signed-off-by: Martin Kletzander <mkletzan@xxxxxxxxxx>
> ---
>  src/test/test_driver.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/src/test/test_driver.c b/src/test/test_driver.c
> index c962aa74786e..998d102ddc5a 100644
> --- a/src/test/test_driver.c
> +++ b/src/test/test_driver.c
> @@ -4503,7 +4503,7 @@ testNodeGetFreePages(virConnectPtr conn G_GNUC_UNUSED,
>                       unsigned int flags)
>  {
>      size_t i = 0, j = 0;
> -    int x = 6;
> +    int x = startCell * 6;

So startCell is now used within the function and thus its G_GNUC_UNUSED
annotation should be dropped.

>  
>      virCheckFlags(0, -1);
>  
> @@ -4514,7 +4514,7 @@ testNodeGetFreePages(virConnectPtr conn G_GNUC_UNUSED,
>          }
>      }
>  
> -    return 0;
> +    return cellCount * npages;
>  }
>  
>  static int testDomainCreateWithFlags(virDomainPtr domain, unsigned int flags)

Reviewed-by: Michal Privoznik <mprivozn@xxxxxxxxxx>

Michal




[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